1 | var toString = require('../lang/toString');
|
2 | var slugify = require('./slugify');
|
3 | var unCamelCase = require('./unCamelCase');
|
4 | /**
|
5 | * Replaces spaces with underscores, split camelCase text, remove non-word chars, remove accents and convert to lower case.
|
6 | */
|
7 | function underscore(str){
|
8 | str = toString(str);
|
9 | str = unCamelCase(str);
|
10 | return slugify(str, "_");
|
11 | }
|
12 | module.exports = underscore;
|
13 |
|