UNPKG

@marceloclp/monzojs

Version:

Unofficial wrapper for the Monzo API written in TypeScript.

12 lines (11 loc) 461 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Returns a new object with each key-value pair remapped to a newKey-value * pair. * * @param object - the object to be remapped * @param toString - a function to generate a new key for each pair */ const remapObject = (object, toString) => Object.entries(object).reduce((mapped, [key, value]) => ({ ...mapped, [toString(key)]: value }), {}); exports.default = remapObject;