obj-key-normalizer
TypeScript icon, indicating that this package has built-in type declarations

1.3.4 • Public • Published

About

This is a typscript project for normalizing object keys. There are several configurable options (WIP) for modifying how the normalizer works. There are several examples in the 'tests' directory of the project.

Example

const source = {
    firstName: 'Joe',
    lastName: 'Hartzell',
    address: {
        'line-1': '123 example rd',
        state: 'PA',
        'zip_code': '12345'
    }
};
const options = {
    deep: true,
    case: 'kebab',
}
const normalizer = new Normalizer(options);
 
const dest = normalizer.Normalize(source);
 
// dest object output
// {
//      result: {
//          'first-name': 'Joe',
//          'last-name': 'Hartzell',
//          'address': {
//              'line-1': '123 example rd',
//              'state': 'PA',
//              'zip-code': '12345'
//          }
//      }
// }

Contributing

If there are changes/bugs that are found. Please submit a pull request. Any PRs that do not pass through the linter will not be accepted. The project must also build without modifications to the tsconfig file.

Readme

Keywords

none

Package Sidebar

Install

npm i obj-key-normalizer

Weekly Downloads

8

Version

1.3.4

License

ISC

Unpacked Size

29.3 kB

Total Files

16

Last publish

Collaborators

  • joe_hartzell