source ObjectSchemaBuilder
target ObjectSchemaBuilder
union of target property key names not yet mapped
Creates a new instance of the Mapper class.
source ObjectSchemaBuilder
target ObjectSchemaBuilder
union of target property key names not yet mapped
object schema to map from
object schema to map to
Optionalregistry: MappingRegistry<any, any>
optional MappingRegistry to auto-register the mapper
Readonly Internal[Tracks final per-property computations without executing them.
Readonly[Phantom property for structural type-checking of TUnmapped.
Selects a target property to configure. The selector callback
receives a tree of all target properties. Navigate by
property name: (t) => t.cityName.
Auto-mappable properties (same name and compatible type, or ObjectSchemaBuilder with a registered mapping) are also available for explicit override.
Returns the configured async mapping function.
Compile-time safety: This method is only callable without arguments when all target properties have been mapped or explicitly ignored. If any property is unmapped, TypeScript will require a string argument describing the unmapped properties, producing a clear compile-time error.
Runtime safety: Even if TypeScript checks are bypassed (e.g.
via as any), a MapperConfigurationError is thrown at runtime
listing the unmapped properties.
Compile a synchronous function when the complete mapping has no async steps. Eligibility is inferred through compute(), from(), nested mappings and overrides. Callbacks are never probed during configuration. A disguised Promise/thenable throws at invocation; known async functions/dependencies throw at compilation.
A fluent builder for configuring how each target property is populated from a source schema. Uses PropertyDescriptors as pointers to properties (similar to expressions in C# .NET).
The
TUnmappedtype parameter tracks which target properties have not yet been mapped or ignored.getMapper()is only callable (without arguments) whenTUnmappedisnever— i.e. all properties have been accounted for. If any property is missing, TypeScript will produce a compile-time type error (a type-assignability mismatch that includes the unmapped property names in its type parameters).