This feature is experimental. Please share your experiences so we know what to keep or change.
Returns the given value if it is array-like, otherwise returns an array with the given value as its only element.
Returns an empty array if called with null
or undefined
.
up.util.wrapList([1, 2, 3]) // => [1, 2, 3]
up.util.wrapList('foo') // => ['foo']
up.util.wrapList(undefined) // => []
up.util.wrapList(null) // => []