Type Alias StringSubtypeArray<T>

StringSubtypeArray: T[] & {
    checked: (value: string) => T | undefined;
    checkedArray: (...values: string[]) => T[];
    exclude: <ExcludeT extends T>(
        ...excludeArgs: ExcludeT[],
    ) => StringSubtypeArray<Exclude<T, ExcludeT>>;
    has: (value: string) => boolean;
}

Type Parameters

  • T extends string

Type declaration

  • checked: (value: string) => T | undefined

    If the specified value belongs to the array returns the value as the desired type

  • checkedArray: (...values: string[]) => T[]

    Filters the specified values, returning only those in this array, in O(1) time per value

  • exclude: <ExcludeT extends T>(
        ...excludeArgs: ExcludeT[],
    ) => StringSubtypeArray<Exclude<T, ExcludeT>>

    Creates a new enhanced array type without the specified options

  • has: (value: string) => boolean

    Checks if the specified value belongs to the array in O(1) time