UNPKG
@pmwcs/base
Version:
latest (1.1.0)
next (1.0.0-2)
1.1.0
1.0.2
1.0.1
1.0.0
1.0.0-2
1.0.0-1
PMWCS base module
github.com/pmwcs/pmwcs
pmwcs/pmwcs
@pmwcs/base
/
next
/
utils
/
strings.js
4 lines
•
198 B
JavaScript
View Raw
1
2
3
4
export
const
toCamel
= str => str.
replace
(
/(-[a-z])/g
, $1 => $1.
toUpperCase
().
replace
(
'-'
,
''
));
export
const
toDashCase
= str => {
return
str.
replace
(
/([A-Z])/g
, $1 =>
'-'
+ $1.
toLowerCase
()); };