jty
    Preparing search index...

    Function isArr

    • Checks if the provided value is an array, optionally checking if its length is within a given range.

      Parameters

      • x: unknown

        The value to check.

      • minLen: number = 0

        minimum possible length (inclusive)

      • OptionalmaxLen: number

        maximum possible length (inclusive)

      Returns x is unknown[]

      true if x is an array and its length is within the specified range, false otherwise.

      isObj

      // Basic validation
      isArr([]) // => true
      isArr([1, 2, 3]) // => true
      isArr({}) // => false
      // With length validation
      isArr([1, 2], 2) // => true
      isArr([1, 2], 3) // => false
      isArr([1, 2], 1, 2) // => true