common-stuff
    Preparing search index...

    Function ensureArray

    • Returns original value if it is array or wraps it to array.

      Type Parameters

      • T

      Parameters

      • value: T | T[]

      Returns T[]

      ensureArray('hello')
      // ['hello']
      ensureArray(['hello'])
      // ['hello']
    • Returns original value if it is array or wraps it to array.

      Type Parameters

      • T

      Parameters

      • value: T | readonly T[]

      Returns readonly T[]

      ensureArray('hello')
      // ['hello']
      ensureArray(['hello'])
      // ['hello']