https://github.com/dial-once/node-flat-camel
Flattens objects/arrays and transforms them into camelCase style
https://github.com/dial-once/node-flat-camel
Last synced: about 2 months ago
JSON representation
Flattens objects/arrays and transforms them into camelCase style
- Host: GitHub
- URL: https://github.com/dial-once/node-flat-camel
- Owner: dial-once
- License: mit
- Created: 2017-08-14T09:47:00.000Z (almost 8 years ago)
- Default Branch: develop
- Last Pushed: 2018-11-30T08:43:04.000Z (over 6 years ago)
- Last Synced: 2025-03-21T16:59:10.180Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 45.9 KB
- Stars: 2
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# node-flat-camel
[](http://sonar.dialonce.net/dashboard?id=node-flat-camel)
[](http://sonar.dialonce.net/dashboard?id=node-flat-camel)
[](http://sonar.dialonce.net/dashboard?id=node-flat-camel)
[](http://proxy.dialonce.net/sonar/api/badges/measure?key=node-flat-camel&metric=coverage)
[](http://sonar.dialonce.net/dashboard?id=node-flat-camel)
[](http://sonar.dialonce.net/dashboard?id=node-flat-camel)camelCase object flattener
Flattens objects, arrays by converting it's keys into a camelCase format.
## Installation
```
npm install flat-camel
```## How it works:
#### Object
```js
const flattener = require('flat-camel');const objectToFormat = {
hello: {
people: {
how: {
are: {
you: 'good'
}
}
}
}
};flattener.toCamelCase(objectToFormat);
// result
{
helloPeopleHowAreYou: 'good'
};
```#### Array
```js
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];
```## Tests
Requirements:
- npm
- makeRun `make deps` once and then `make test` to launch the test suite.
## License
The MIT License [MIT](LICENSE.md)