Member configuration
mapFrom
Sets function that takes in source object and returns destination value.
createMap(SrcToDst, {
bar: opt => opt.mapFrom(src => src.foo)
});mapFromUsing
Similarly to mapFrom takes in mapping function and MappingPair which configuration will be used to map corresponding member.
createMap(SrcToDst, {
bar: opt => opt.mapFromUsing(src => src.foo, FooToBar)
});addTransform
Transforms value before mapping to destination.
createMap(SrcToDst, {
bar: opt => {
opt.mapFrom(src => src.foo);
opt.addTransform(dest => dest + ', it was mapped!');
}
});condition
Called before destination value will be assigned.
preCondition
Called before resolving destination value and stops mapping on false.
nullSubstitute
When source member value resolves to null or undefined alternate value will be used.
ignore
Skips this member during mapping.
auto
Explicitly marks member for auto mapping. Can be called only on members present on both source and destination.
Last updated
Was this helpful?