0.0.7 • Published 3 years ago

g-format v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

format object keys

currently implemented:

  • convert underscore key to camelCase key
  • convert camelCase key to undercore key

Usage

Case 1

Convert data from orm to JavaScript naming convention

const { getCamelCase, getUndersocre } = require('g-format');

let person_from_orm = {
  'id': 1,
  'my_name': 'siria',
  'my_real_name': 'dog',
};
let person = getCamelCase(person_from_orm);

Case 2

Convert date from JavaScript naming convention to ORM

let personOfJS = {
  'id': 1,
  'myName': 'siria',
  'myRealName': 'dog',
}
let personOfORM = getUndersocre(personOfJs);
someORM.insert('people', personOfORM);
0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago