camelCase object flattener
Flattens objects, arrays by converting it's keys into a camelCase format.
npm install flat-camel
const flattener = require('flat-camel');
const objectToFormat = {
hello: {
people: {
how: {
are: {
you: 'good'
}
}
}
}
};
flattener.toCamelCase(objectToFormat);
// result
{
helloPeopleHowAreYou: 'good'
};
const flattener = require('flat-camel');
const arrayToFormat = [{
hello: {
people: {
how: {
are: {
you: ['good']
}
}
}
}
}, 'hello', 1, true];
flattener.toCamelCase(arrayToFormat);
// result
[{
helloPeopleHowAreYou: ['good']
}, 'hello', 1, true];
Requirements:
- npm
- make
Run make deps
once and then make test
to launch the test suite.
The MIT License MIT