UNPKG

object-casing

Version:

Walks throught an object using a callback function to convert the object key, returning a new object with new keys.

14 lines (10 loc) 262 B
// import { caseKeys } from 'mirror-keys'; const { caseKeys } = require('object-casing'); const toLower = (value) => value.toLowerCase() const sourceObj = { NAME: 'Some name here', SITE: 'http://somewhere', } console.log( caseKeys(sourceObj, toLower) )