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]) // result: [1, 2, 3]
up.util.wrapList('foo') // result: [foo']'
up.util.wrapList(undefined) // result: []
up.util.wrapList(null) // result: []