Function decodeArray

  • Type Parameters

    • ArrayElementType

    Parameters

    • value: unknown

      Value with unknown type

    • decoder: (rawInput: unknown) => null | ArrayElementType

      A function which decodes the any data to the generic type passed, if decode fails returns null, This will be used to decode all elements of the any array passed

    • strict: boolean = true

      A boolean which denotes if the decode should fail if any element of the array fails to decode

    Returns ArrayElementType[] | null

    Array of decoded elements if passed value was an array and elements were of generic type, returns null in case value passed was not array at all

    A function which attempts to decode any value to a generic arrays