import { AnyMap } from "../types"; /** * Creates a new `map` populated with every key in the original `map` where the * value behind each `k` in `keys` is the return value of `fn(map[k])` * * ```tsx * const out = modifyInMap({ a: 1, b: 2 }, "b", n => n + 1); * console.log(out); // { a: 1, b: 3 } * ``` * * The original `map` is not modified. * * An error is thrown if any key in `keys` does not exist in the map. * * @param map - The map to copy and modify. * @param keys - The keys to modify within the map. * @returns A new map with modified values. */ export default function modifyInMap(map: M, keys: K | K[], fn: (item: T) => T): M;