-
Notifications
You must be signed in to change notification settings - Fork 3
Map action configuration
Simone Bembi edited this page Jan 30, 2018
·
1 revision
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.
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')
);