UNPKG

rambda

Version:

Lightweight and faster alternative to Ramda with included TS definitions

11 lines (9 loc) 176 B
export function mapPropObject(fn, prop) { return obj => { if (!Array.isArray(obj[prop])) return obj return { ...obj, [prop]: obj[prop].map(fn) } } }