Blame view
node_modules/underscore.string/underscored.js
176 Bytes
f7563de62
|
1 2 3 4 5 |
var trim = require('./trim'); module.exports = function underscored(str) { return trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase(); }; |