UNPKG

strility

Version:

Strility is a string manipulation library

10 lines (7 loc) 226 B
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, '_'); };