UNPKG
@ungap/essential-set
Version:
latest (0.2.2)
0.2.2
0.2.1
0.2.0
0.1.2
0.1.1
0.1.0
An essential Set poorlyfill for legacy browsers.
github.com/ungap/essential-set
ungap/essential-set
@ungap/essential-set
/
min.js
2 lines
•
270 B
JavaScript
View Raw
1
2
/*! (c) Andrea Giammarchi - ISC */
var
self=
this
||{};
try
{self.
Set
=
Set
}
catch
(t){self.
Set
=
function
(
){
var
n=
0
,r=[];
return
{
add
:
function
(
t
){
return
u
(t)||r.
push
(t),
this
},
delete
:
function
(
t
){
var
e=
u
(t);
return
e&&r.
splice
(n,
1
),e},
has
:u};
function
u
(
t
){
return
-
1
<(n=r.
indexOf
(t))}}}