UNPKG

@web3r/flowerkit

Version:

A collection of more than 60 often used utility JS functions that simplify frontend development.

16 lines 609 B
/** * Gets a Map from object * @param obj{Object=} - source object * @param getFiltered{Function=} - filter function for each pair of key and value * @return {Map} * @example * // How to convert an object to ES6 Map and pass only number values? * const sourceObj = { * hello: "world", * goodbye: 1 * }; * const targetMap = getMapFromObj(sourceObj, (key, value, index) => typeof value === "number"); * console.log(targetMap); // => Map<"goodbye", 1> */ export function getMapFromObj(obj?: any | undefined, getFiltered?: Function | undefined): Map<any, any>; //# sourceMappingURL=index.d.ts.map