method AsyncObjectMapper.prototype.map
AsyncObjectMapper.prototype.map(
input: TInput,
context: OptionalArgIfUndefined<TContext>,
): Promise<TOutput>

Maps an input object to an output object.

It does so by iterating each property in the object schema, and invoking the property's mapping function, passing the input and context.

Parameters

input: TInput
context: OptionalArgIfUndefined<TContext>

Return Type

Promise<TOutput>
AsyncObjectMapper.prototype.map(
input: TInput | null,
context: OptionalArgIfUndefined<TContext>,
): Promise<TOutput | null>

Maps an input object to an output object.

It does so by iterating each property in the object schema, and invoking the property's mapping function, passing the input and context.

If input is null, it will be returned as-is.

Parameters

input: TInput | null
context: OptionalArgIfUndefined<TContext>

Return Type

Promise<TOutput | null>
AsyncObjectMapper.prototype.map(
input: TInput | undefined,
context: OptionalArgIfUndefined<TContext>,
): Promise<TOutput | undefined>

Maps an input object to an output object.

It does so by iterating each property in the object schema, and invoking the property's mapping function, passing the input and context.

If input is undefined, it will be returned as-is.

Parameters

input: TInput | undefined
context: OptionalArgIfUndefined<TContext>

Return Type

Promise<TOutput | undefined>
AsyncObjectMapper.prototype.map(
input:
TInput
| null
| undefined
,
context: OptionalArgIfUndefined<TContext>,
): Promise<
TOutput
| null
| undefined
>

Maps an input object to an output object.

It does so by iterating each property in the object schema, and invoking the property's mapping function, passing the input and context.

If input is null or undefined, it will be returned as-is.

Parameters

input:
TInput
| null
| undefined
context: OptionalArgIfUndefined<TContext>

Return Type

Promise<
TOutput
| null
| undefined
>