JSPM

flat-camel

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q14432F
  • License ISC

flattener module

Package Exports

  • flat-camel

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (flat-camel) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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

const flattener = require('flat-camel');

const objectToFormat = {
  hello: {
    people: {
      how: {
        are: {
          you: 'good'
        }
      }
    }
  }
};

flattener.toCamelCase(objectToFormat);

// result
{
  helloPeopleHowAreYou: 'good'
};

Array

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
  • make

Run make deps once and then make test to launch the test suite.

License

The MIT License MIT