map
Map for any iterable, promised iterable, or item that can be converted into an iterable.
Usage
await map(item,func,what="values")
The 'item' could be a generator, async generator, Set, etc.
How It Works
- awaits
item
so that if it is a Promise, it resolves - tries to use
- native
map
on `item -
for await(value of await item)
directly on theitem
-
for await()
on the result of calling the method with thewhat
name on item or ifwhat
is a function its return value when passeditem
-
for await()
on the result of using nativeforEach
, if available on item, to collect values fromitem
- native
Release History (Reverse Chronological Order)
2023-01-04 v1.0.0 Added unit tests, 95.83% test coverage
2023-01-01 v0.0.1 Initial public release