mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
build(utils): build26 from 45504a2b
This commit is contained in:
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
//#region src/string/casing.ts
|
||||
function pascalCase(str) {
|
||||
return str.replace(/[-_](.)/g, (_, c) => c.toUpperCase()).replace(/^(.)/, (_, c) => c.toUpperCase());
|
||||
}
|
||||
function camelCase(str) {
|
||||
return pascalCase(str).replace(/^(.)/, (_, c) => c.toLowerCase());
|
||||
}
|
||||
function kebabCase(str) {
|
||||
return str.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
||||
}
|
||||
function snakeCase(str) {
|
||||
return str.replace(/[A-Z]/g, (m) => `_${m.toLowerCase()}`);
|
||||
}
|
||||
//#endregion
|
||||
export { camelCase, kebabCase, pascalCase, snakeCase };
|
||||
|
||||
//# sourceMappingURL=casing.js.map
|
||||
Reference in New Issue
Block a user