-
-
Notifications
You must be signed in to change notification settings - Fork 68
[Replacement]: as-array #515
Copy link
Copy link
Closed
Description
Package to replace
as-array
Suggested replacemen
function asArray(data) {
if (data == null) return []
if (Array.isArray(data)) return data
if (typeof data !== 'string' && data[Symbol.iterator]) return Array.from(data)
return [data]
}Manifest type
micro-utility (tiny utility replaceable with native code or removal)
Rationale
Should not be its own package
Availability
all modern browsers and runtimes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels