method ObjectMapper.prototype.toFunction
ObjectMapper.prototype.toFunction(): ObjectMapperFunction<TInput, TOutput, TContext>

Wrap this instance in a function, with a schema property.

Examples

Example 1

interface Input {
  in: string;
}

interface Output {
  out: string;
}

const mapObject = (ObjectMapper.create<Input, Output>()({
  out: "in",
})).toFunction();

const output = mapObject({
  in: 'Hello world!'
});

Return Type

ObjectMapperFunction<TInput, TOutput, TContext>

Usage

import { ObjectMapper } from ".";