mirror of
https://github.com/zoriya/v10.git
synced 2026-08-14 09:59:44 +00:00
chore(root): prepare workspace for alpha (#276)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Converts a string to camel case.
|
||||
*
|
||||
* @param str - The string to convert.
|
||||
* @returns The camel case string.
|
||||
*/
|
||||
export function toCamelCase(str: string): string {
|
||||
return str
|
||||
.toLowerCase()
|
||||
.replace(/[-_]([a-z])/g, (_$0, $1) => $1.toUpperCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a string to kebab case.
|
||||
*
|
||||
* @param str - The string to convert.
|
||||
* @returns The kebab case string.
|
||||
*/
|
||||
export function toKebabCase(str: string): string {
|
||||
return str
|
||||
.replace(/([A-Z])/g, '-$1')
|
||||
.toLowerCase();
|
||||
}
|
||||
Reference in New Issue
Block a user