jty
    Preparing search index...

    Function isArrLen

    • Checks if the provided value is an array AND its length is in a boundary (inclusive). If min and max are the same, it tests for exact length.

      Parameters

      • x: unknown

        possibly an array

      • minLen: number = 0

        minimum possible length (inclusive)

      • OptionalmaxLen: number

        maximum possible length (inclusive)

      Returns x is unknown[]

      if minLen or maxLen are defined but are not numbers. Delegates to inRangeInt().

      isArrLen([1, 2, 3], 2, 4) => true
      isArrLen([1, 2, 3], 5, 10) => false
      isArrLen([1, 2, 3], 3, 3) => true
      isArrLen([1, 2, 3], 3) => true // The length is at least 3
      isArrLen([1, 2, 3], undefined, 3) => true // The length is at most 3
      isArrLen([1, 2, 3], 1, 2) => false
      isArrLen(null, 1, 4) => false