6 lines
176 B
JavaScript
6 lines
176 B
JavaScript
![]() |
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();
|
||
|
};
|