@8hobbies/utils
    Preparing search index...

    Function isArrayOf

    • Type guard for an array of a given type name.

      Type Parameters

      • TypeOfName extends
            | "string"
            | "number"
            | "bigint"
            | "boolean"
            | "symbol"
            | "undefined"
            | "object"
            | "function"

        The type of the element of the array.

      Parameters

      • arg: unknown

        Expression that is to be determined whether it is an array or not.

      • typeName: TypeOfName

        Name of the type of elements.

      Returns arg is FromTypeOfName<TypeOfName>[]

      Whether arg is an array of elements of type specified by typeName.

    • Type guard for an array of a given type T determined by a given type guard.

      Type Parameters

      • T

        The type of the element of the array.

      Parameters

      • arg: unknown

        Expression that is to be determined whether it is an array or not.

      • pred: TypeGuardOf<T>

        The type guard for element T.

      Returns arg is T[]

      Whether arg is an array of elements of type T.