Function ucSchema

  • Obtains a schema of the given data model.

    Type Parameters

    • T

      Implied data type.

    • TSchema extends UcSchema<T>

      Schema type.

    Parameters

    • model: UcModel<T, TSchema>

      Data model to obtain a schema of.

    • Optional extension: Extension<T, TSchema>

      Schema extension.

      Optional

    Returns TSchema

    Either the model itself if it is a schema instance already, or schema instance describing the given data type otherwise.

  • Creates a schema of the given data type.

    Type Parameters

    • T

      Implied data type.

    Parameters

    Returns Omit<UcSchema<T>, "type"> & {
        type: UcDataType<T>;
    }

    Schema instance.

Generated using TypeDoc