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
/
utils
/
strings.js
7 lines
(5 loc)
•
203 B
JavaScript
View Raw
1
2
3
4
5
6
7
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
()) }