/** * Transforms the values of the map using the specified function. * * @tsplus static ImmutableMap.Aspects map * @tsplus pipeable ImmutableMap map */ export function map(f: (value: V) => B) { return (self: ImmutableMap): ImmutableMap => { const map = new Map() for (const [key, value] of self.internalMap) { map.set(key, f(value)) } return new ImmutableMap(map) } }