UNPKG
@ungap/item
Version:
latest (0.2.0)
0.2.0
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
A cross platform Promise.any polyfill
github.com/ungap/item
ungap/item
@ungap/item
/
cjs
/
index.js
8 lines
(7 loc)
•
217 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
(
function
(
item
) {
Array
.
prototype
.
item
= item;
String
.
prototype
.
item
= item;
Object
.
getPrototypeOf
(
Uint8Array
).
prototype
.
item
= item; }(
function
item
(
n
) {
return
n <
0
?
this
[
this
.
length
+ n] :
this
[n]; }));