stewie1570 / JSONCasing

A small JavaScript object that can do a deep Camel to Pascal or Pascal to Camel conversion on JavaScript objects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

json-casing

Build Coverage Status npm version Package Size

Here are a few lines of code taken from a unit test so you can see how to use this very simple JavaScript.

import { JSONCasing } from 'json-casing';

var camelObj = { prop1: "prop 1", obj1: { deepProp1: "dp1", deepProp2: "dp2" } };
var pascalObj = { Prop1: "prop 1", Obj1: { DeepProp1: "dp1", DeepProp2: "dp2" } };

var result = JSONCasing.toCamel(pascalObj);

expect(JSON.stringify(result)).toBe(JSON.stringify(camelObj));

About

A small JavaScript object that can do a deep Camel to Pascal or Pascal to Camel conversion on JavaScript objects.

License:MIT License


Languages

Language:TypeScript 96.6%Language:JavaScript 3.4%