Skip to main content
Module

x/lunchbox/src/utils.ts>dMap

Component Library 🍱 for Deno πŸ¦• Fresh πŸ‹
Go to Latest
function dMap
import { dMap } from "https://deno.land/x/lunchbox@v0.1.13/src/utils.ts";

This function emulates the behavior of Array.prototype.map() in Records. It calls a function passing each entry of the record as an argument.

Parameters

record: Record<string, T>

The record to be mapped.

callback: (entry: T, key?: string) => T

The function that will map the entries of the dictionary.

Returns

Record<string, T>

A new dictionary with each entry mapped to the function.