method ObjectMapper.prototype.map
ObjectMapper.prototype.map(
input: TInput,
context: OptionalArgIfUndefined<TContext>,
): 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

TOutput
ObjectMapper.prototype.map(
input: TInput | null,
context: OptionalArgIfUndefined<TContext>,
): 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

TOutput | null
ObjectMapper.prototype.map(
input: TInput | undefined,
context: OptionalArgIfUndefined<TContext>,
): 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

TOutput | undefined
ObjectMapper.prototype.map(
input:
TInput
| null
| undefined
,
context: OptionalArgIfUndefined<TContext>,
):
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

TOutput
| null
| undefined