0.0.7 • Published 2 years ago

g-format v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 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

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago