init project
This commit is contained in:
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
function words(input) {
|
||||
return input
|
||||
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
||||
.split(/[\s_-]+/)
|
||||
.filter(Boolean);
|
||||
}
|
||||
export function pascalCase(input) {
|
||||
return words(input)
|
||||
.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
|
||||
.join('');
|
||||
}
|
||||
export function camelCase(input) {
|
||||
const pascal = pascalCase(input);
|
||||
return pascal.charAt(0).toLowerCase() + pascal.slice(1);
|
||||
}
|
||||
export function kebabCase(input) {
|
||||
return words(input)
|
||||
.map((w) => w.toLowerCase())
|
||||
.join('-');
|
||||
}
|
||||
//# sourceMappingURL=strings.js.map
|
||||
Reference in New Issue
Block a user