Skip to main content
Deno 2 is finally here πŸŽ‰οΈ
Learn more
Module

x/lunchbox/src/utils.ts>rMap

Component Library 🍱 for Deno πŸ¦• Fresh πŸ‹
Latest
function rMap
import { rMap } from "https://deno.land/x/lunchbox@v1.0.2/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 record.

Returns

Record<string, T>

A new cord with each entry mapped to the function.