Skip to content

Instantly share code, notes, and snippets.

@codeBelt
Last active May 4, 2020 09:00
Show Gist options
  • Save codeBelt/ddd3432af63847274348fcf62482ebaa to your computer and use it in GitHub Desktop.
Save codeBelt/ddd3432af63847274348fcf62482ebaa to your computer and use it in GitHub Desktop.
import StringUtility from "./StringUtility";
import Util from "./Util";
export default class PropertyNormalizerUtility {
static normalize(json) {
const dataOrEmptyObject = Boolean(json) ? json : {};
// Makes all property names camelCase so they are consistent in the application.
// Also recursively goes through child objects.
return Util.clone(dataOrEmptyObject, StringUtility.toCamelCase);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment