Configuration
import { MapperConfiguration } from '@dynamic-mapper/mapper';
const FooToBar = new MappingPair<Foo, Bar>();
const config = new MapperConfiguration(cfg => {
cfg.createMap(FooToBar);
});Automatic mapping
interface Source {
dateFrom: string;
dateTo: string;
}
interface Destination {
dateFrom: string;
dateTo: string;
}
const SourceToDestination = new MappingPair<Source, Destination>();
const config = new MapperConfiguration(cfg => {
// automaticly map all source members to destination members without
// an explicit member configuration
cfg.createAutoMap(SourceToDestination, {});
});Strict mapping
Default mapping
Last updated
Was this helpful?