Object
mapValues

Creates an object with the same keys and values generated by running each own enumerable string keyed property of object through the callback.

The source object should be a Plain Object.

Syntax

import { mapValues } from "@opentf/std";
 
mapValues(obj: object, fn: (value: any, key: string) => any)

Examples

const obj = { a: 1, b: 2 };
 
mapValues(obj, (v) => v * 2); 
//=> { a: 2, b: 4 }

Try