Libraries v5.2.0
    Preparing search index...

    Class MappingRegistry<TRegistered, TAsyncRegistered>

    Type Parameters

    • TRegistered = never
    • TAsyncRegistered = never
    Index
    _mappers: Map<
        ObjectSchemaBuilder<any, any, any, any, any, any, any>,
        Map<
            ObjectSchemaBuilder<any, any, any, any, any, any, any>,
            SchemaToSchemaMapperResult<any, any>,
        >,
    > = ...
    • Gets a mapper function that will map from the fromSchema to the toSchema. Throws an error if no mapper is found for the given schemas pair.

      Type Parameters

      • TFromSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
      • TToSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>

      Parameters

      Returns SchemaToSchemaMapperResult<TFromSchema, TToSchema>

      a function that will take a value of the fromSchema type as an argument and return a promise resolving to a value of the toSchema type

    • Retrieve a registered synchronous mapper inferred from configure(). The pair must be registered and its final steps must all be synchronous. Async mappings remain usable with getMapper(); configuration never executes compute callbacks. Unexpected thenables throw when the returned mapper runs.

      Type Parameters

      • TFromSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
      • TToSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>

      Parameters

      Returns SyncSchemaToSchemaMapperResult<TFromSchema, TToSchema>

      MapperConfigurationError for an asynchronous dependency.

      Error if the schema pair has not been registered.