Skip to content

Map action configuration

Simone Bembi edited this page Jan 30, 2018 · 1 revision

Map action configuration

It represents a set of configuration for the single map action.

e.g.

const mappedDestination = mapper.map<S, D>(signature, source, destination, configuration =>
        configuration
                .shouldRequireExplicitlySetProperties(true)
    );

The configuration object supports Mapper configuration methods and preconditions.


Preconditions

The precondition configuration accepts the method which syntax is:
withPrecondition(precondition: (source: Source, destination: Destination) => boolean).

e.g.

const mappedDestination = mapper.map<S, D>(signature, source, destination, configuration =>
        configuration
                .withPrecondition((src, dest) => src.a === 'a')
    );