Skip to main content

Function: asArray()

asArray<T>(item): T[]

Returns an array with the item if it is a object/primitive, otherwise, if it is an array, returns the array itself.

Type Parameters

T

Parameters

item: T | T[]

array or single object/primitive

Returns

T[]

an array with the object/primitive as the single element or the original array

Defined in

packages/core/src/utilities/asArray.ts:7