UNPKG
strility
Version:
latest (1.3.1)
1.3.1
1.3.0
1.2.0
1.1.0
1.0.0
Strility is a string manipulation library
github.com/bjarneo/strility
bjarneo/strility
strility
/
src
/
underscore.js
10 lines
(7 loc)
•
226 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
const
isString =
require
(
'./is-string'
);
module
.
exports
=
function
underscore
(
input
) {
if
(!
isString
(input)) {
throw
new
TypeError
(
'Input is not a string!'
); }
return
input.
replace
(
/ |-|[A-Z]/g
,
'_'
); };