- Preparing search index...
- The search index is not available
@giraugh/tools
- mapKeys<TMapped, TObj>(obj, mapFn): {
[k in string | number | symbol as TMapped]: TObj[k]
}
-
Type Parameters
-
TMapped extends PropertyKey
-
TObj extends Record<PropertyKey, any>
Parameters
-
obj: TObj
-
mapFn: ((t) => TMapped)
-
- (t): TMapped
-
Returns TMapped
Returns {
[k in string | number | symbol as TMapped]: TObj[k]
}
Map the keys of an object using a mapping function
Returns
obj
with its keys mapped usingmapFn
Example