- mapObject<
const OriginalObject,
const NewKey extends PropertyKey,
const NewValue,
>(
inputObject: OriginalObject,
mapCallback: (
originalKey: keyof OriginalObject,
originalValue: Values<OriginalObject>,
originalObject: OriginalObject,
) => Promise<undefined | { key: NewKey; value: NewValue }>,
): Promise<Record<NewKey, NewValue>> Type Parameters
- const OriginalObject
- const NewKey extends PropertyKey
- const NewValue
- mapObject<
const OriginalObject,
const NewKey extends PropertyKey,
const NewValue,
>(
inputObject: OriginalObject,
mapCallback: (
originalKey: keyof OriginalObject,
originalValue: Values<OriginalObject>,
originalObject: OriginalObject,
) => undefined | { key: NewKey; value: NewValue },
): Record<NewKey, NewValue> Type Parameters
- const OriginalObject
- const NewKey extends PropertyKey
- const NewValue
- mapObject<
const OriginalObject,
const NewKey extends PropertyKey,
const NewValue,
>(
inputObject: OriginalObject,
mapCallback: (
originalKey: keyof OriginalObject,
originalValue: Values<OriginalObject>,
originalObject: OriginalObject,
) => MaybePromise<undefined | { key: NewKey; value: NewValue }>,
): MaybePromise<Record<NewKey, NewValue>> Type Parameters
- const OriginalObject
- const NewKey extends PropertyKey
- const NewValue
Maps an object. The callback must return a key and value.
Example
Package
@augment-vir/common
See