UNPKG
@arnaudnyc/mout
Version:
latest (1.2.4)
1.2.4
1.2.3
1.2.2-secfix
Modular Utilities
moutjs.com
arnaudnyc/mout
@arnaudnyc/mout
/
string
/
unhyphenate.js
11 lines
(9 loc)
•
285 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
var
toString =
require
(
'../lang/toString'
);
/** * Replaces hyphens with spaces. (only hyphens between word chars) */
function
unhyphenate
(
str
){ str =
toString
(str);
return
str.
replace
(
/(\w)(-)(\w)/g
,
'$1 $3'
); }
module
.
exports
= unhyphenate;