deno.land / x / rambda@v9.1.1 / source / mapKeys.js

نووسراو ببینە
1
2
3
4
5
6
7
8
9
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}
rambda

Version Info

Tagged at
2 months ago