casing
Recursively transform object key strings to and from camelCase and snake_case.
- Supports objects, arrays and a combination of both in any depth.
- Was originally intended for use with BookShelf and Knex.
Installation
$ npm install casing
Usage
'use strict';var casing = ; var wasCamel = objId: 123 myName: 'Slim Shady';console;// => { obj_id: 123, my_name: 'Slim Shady' } var was_snake = obj_id: 456 my_name: 'fiddycent';console;// => { objId: 456, myName: 'fiddycent' }
TypeScript
This package includes a definition file for TypeScript.
; ;snakeizewasCamel; ;camelizewas_snake;
License
MIT