Object
mapKeys

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

The source object should be a Plain Object.

Syntax

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

Examples

const obj = { a: 1, b: 2 };
 
mapKeys(obj, (v, k) => k + v); 
//=> { a1: 1, b2: 2 }

Try