Interface MappingValue<T, O>

Rules for mapping a value inside a given object to the destiny value

Template

Destiny object type

Type Parameters

  • T extends object

    Source object type

  • O extends object

Hierarchy

  • MappingValue

Properties

defaultValue: unknown

Fallback value. If the src path is invalid and no transform function is passed, the return value will be the default

dstPath: O extends object ? { [ K in string | number | symbol]-?: K extends string | number ? `${K}` | Join<K, O[K] extends object ? ({ [K in keyof O[K]]-?: K extends string | number ? `${K}` | Join<K, O[K][K] extends object ? { [K in keyof O[K][K]]-?: K extends string | number ? `${K}` | Join<...> : never; }[keyof O[K][K]] : ""> : never; })[keyof any[any]] : ""> : never }[keyof O] : ""

Object path to be saved in the destiny object

srcPath?: T extends object ? { [ K in string | number | symbol]-?: K extends string | number ? `${K}` | Join<K, T[K] extends object ? ({ [K in keyof T[K]]-?: K extends string | number ? `${K}` | Join<K, T[K][K] extends object ? { [K in keyof T[K][K]]-?: K extends string | number ? `${K}` | Join<...> : never; }[keyof T[K][K]] : ""> : never; })[keyof any[any]] : ""> : never }[keyof T] : ""

Object path from the source object to be accessed

Methods

  • Optional function to transform one or multiple values from source object to the destiny object

    Parameters

    • getter: Getter<T, any, unknown>

      Curried function to access safely any value from the source object

    Returns any

Generated using TypeDoc