|
|
6 years ago | |
|---|---|---|
| .. | ||
| example | 6 years ago | |
| test | 6 years ago | |
| .jshintrc | 6 years ago | |
| .travis.yml | 6 years ago | |
| LICENSE | 6 years ago | |
| index.js | 6 years ago | |
| package.json | 6 years ago | |
| readme.markdown | 6 years ago | |
recursively transform key strings to dash-case
var dasherize = require('dasherize');
var obj = {
feeFieFoe: 'fum',
beepBoop: [
{ 'abcXyz': 'mno' },
{ 'fooBar': 'baz' }
]
};
var res = dasherize(obj);
console.log(JSON.stringify(res, null, 2));
output:
{
"fee-fie-foe": "fum",
"beep-boop": [
{
"abc-xyz": "mno"
},
{
"foo-bar": "baz"
}
]
}
var dasherize = require('dasherize')
Convert the key strings in obj to dash-case recursively.
Convert the string to dash-case.
With npm do:
npm install dasherize
To use in the browser, use browserify.
derives directly from camelize
MIT