UNPKG

rambdax

Version:

Extended version of Rambda - a lightweight, faster alternative to Ramda

9 lines (6 loc) 239 B
export function mapKeys(changeKeyFn, obj){ if (arguments.length === 1) return _obj => mapKeys(changeKeyFn, _obj) const toReturn = {} Object.keys(obj).forEach(prop => toReturn[ changeKeyFn(prop) ] = obj[ prop ]) return toReturn }