UNPKG
@wizxpert/table-configurator
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
Configurable table toolkit for Vue 3 + PrimeVue
wizxpert.net
wizxpert-labs/table-configurator
@wizxpert/table-configurator
/
src
/
utils
/
string.ts
9 lines
(7 loc)
•
298 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
export
const
cssSafe
= (
s
:
string
) =>
String
(s).
replace
(
/[^a-zA-Z0-9_-]/g
,
'_'
)
export
const
humanizeKey = (
s
:
string
|
null
|
undefined
):
string
=>
String
(s ??
''
) .
replace
(
/[_-]+/g
,
' '
) .
trim
() .
replace
(
/\s+/g
,
' '
) .
replace
(
/\b\w/g
,
(
m
) =>
m.
toUpperCase
())