Skip to content

Instantly share code, notes, and snippets.

@sdwvit
Last active April 25, 2019 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdwvit/3a650c99a6ad597f70e00bbcb3c9538f to your computer and use it in GitHub Desktop.
Save sdwvit/3a650c99a6ad597f70e00bbcb3c9538f to your computer and use it in GitHub Desktop.
const login = 'sdwvit';
const type = {
feat: 'feature',
chore: 'chore',
main: 'maintenance',
fix: 'fix'
};
const pages = {
land: 'landing',
res: 'results',
home: 'home',
ch: 'checkout'
};
function getName(ticketName) {
const explanation = ticketName.toLowerCase().replace(/[^\w]/g, '-');
return `${login}/${type.feat}/${pages.res}/${explanation}`;
}
window.alert(getName(window.prompt('Ticket name?')));
// minified via https://jscompress.com:
// javascript:const login="sdwvit",type={feat:"feature",chore:"chore",main:"maintenance",fix:"fix"},pages={land:"landing",res:"results",home:"home",ch:"checkout"};function getName(a){const b=a.toLowerCase().replace(/[^\w]/g,"-");return`${login}/${type.feat}/${pages.res}/${b}`}window.alert(getName(window.prompt("Ticket name?")));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment