Last active
November 23, 2023 16:27
-
-
Save markwhitfeld/53aa259706860110958ab10a8e1c403c to your computer and use it in GitHub Desktop.
VsCode Snippet for converting Camel/Pascal Case to kebab-case
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
{ | |
"Camel as Kebab": { | |
"prefix": "x-kebab", | |
"body": [ | |
"${1} -> ${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/downcase}${2:+-}${3:/downcase}${4:/downcase}/g}" | |
], | |
"description": "dash separators" | |
}, | |
"lowerFirstLetter": { | |
"prefix": "x-lower-first", | |
"body": [ | |
"${1} -> ${1/(^\\S)(.*)/${1:/downcase}${2}/g}" | |
], | |
"description": "lower first letter" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment