Created
April 24, 2024 22:25
-
-
Save zacjones93/19f31bbc94cb305cd711364ba34dcab9 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
// Author: Zac Jones | |
// Keyword: sw | |
import "@johnlindquist/kit" | |
import { titleCase, sentenceCase, paramCase, camelCase } from "text-case" | |
let options = { | |
"[t]itle": titleCase, | |
"[s]entence": sentenceCase, | |
"[p]aram": paramCase, | |
"[c]amel": camelCase, | |
} | |
let option = await arg("What case do you want to convert to?", Object.keys(options)) | |
let text = await getSelectedText() | |
let formattedText = options[option](text) | |
await setSelectedText(formattedText) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment