ts-fortress
    Preparing search index...

    Type Alias Type<A>

    Type: Readonly<
        {
            assertIs: (a: unknown) => asserts a is A;
            cast: (a: unknown) => A;
            defaultValue: A;
            fill: (a: unknown) => A;
            is: (a: unknown) => a is A;
            typeName: string;
            validate: (a: unknown) => Result<A, readonly ValidationError[]>;
        },
    >
    • typeName : Name for this type
    • is : Type guard function
    • assertIs : Type assertion function
    • cast : Cast function (returns the original value, no transformation)
    • fill : Default value filling function
    • validate : A base function to be used in is and assertIs. validate returns Result.Ok if the value is of Type A, otherwise returns Result.Err with structured validation error information.

    Type Parameters

    • A