Created
September 21, 2021 18:51
-
-
Save zacjones93/7a1b4ea4ed16873f6ffcd0cba097c01d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shortcut: opt+shift+c | |
let { titleCase, sentenceCase, paramCase, camelCase } = await npm("text-case"); | |
let text = await kit.getSelectedText(); | |
let options = { | |
"Title Case": titleCase, | |
"Sentence case": sentenceCase, | |
"param-case": paramCase, | |
camelCase: camelCase, | |
}; | |
let option = await arg( | |
"What case do you want to convert to?", | |
Object.keys(options) | |
); | |
let formattedText = options[option](text); | |
await kit.setSelectedText(formattedText); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment