mapValues
Variable遍历对象的每个 value(同时可拿到对应的 key),返回一个 value 被转换后的新对象
Signature
const mapValues: <TValue, TKey extends string | number | symbol, TNewValue>(obj: Record<TKey, TValue>, mapFunc: (value: TValue, key: TKey) => TNewValue) => Record<TKey, TNewValue>Examples
mapValues({ a: 1, b: 2 }, (value) => value * 2) // { a: 2, b: 4 }Source
node_modules/.pnpm/radash@12.1.1/node_modules/radash/dist/index.d.ts:465