Field Normalizer – A tiny js lib for object field’s normalization

A tiny lib for object field’s normalization Build Status

About

This is a tiny lib (~6kb size) compatible with Node.js v12+, useful to format the name of all keys in a object, you can transform all keys to lowerCase, upperCase, camelCase, pascalCase, constantCase and snakeCase.

How to install

npm install --save field-normalizer

How to use

const FNZ = require('field-normalizer');

 

const exampleObj = {

  fullName: 'John Connor',

  contactEmail: 'john.connor@sky.net',

  phoneNumber: '+05533334444',

};

 

FNZ.toLowerCase(exampleObj);

 

FNZ.toUpperCase(exampleObj);

 

FNZ.toCamelCase(exampleObj);

 

FNZ.toPascalCase(exampleObj);

 

FNZ.toConstantCase(exampleObj);

 

FNZ.toSnakeCase(exampleObj);

Author

Caio Ribeiro Pereira caio.ribeiro.pereira@gmail.com

Twitter: https://twitter.com/crp_underground

About me: https://crpwebdev.github.io

License

The MIT License (MIT)

Copyright (c) 2020 caio.ribeiro.pereira@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Author: admin

Leave a Reply

Your email address will not be published.