mirror of
https://github.com/sartography/cr-connect-bpmn.git
synced 2025-01-24 23:59:19 +00:00
Adds utility to convert string to snake case
This commit is contained in:
parent
04f44155ab
commit
915a5a45e7
6
src/app/_util/snake-case.ts
Normal file
6
src/app/_util/snake-case.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export const toSnakeCase = (str: string) => {
|
||||
return !str ? '' : String(str)
|
||||
.replace(/^\W+|\W+$/gi, '')
|
||||
.replace(/\W+/gi, '_')
|
||||
.toLowerCase();
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user