UNPKG
@a11d/equals
Version:
latest (0.2.3)
0.2.3
0.2.2
0.2.1
0.2.0
0.1.2
0.1.1
0.1.0
0.0.3
A value equality utility library.
github.com/a11delavar/lit
a11delavar/lit
@a11d/equals
/
dist
/
Set.equals.js
14 lines
(13 loc)
•
306 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import
{ equals }
from
'./symbol.js'
;
Set
.
prototype
[equals] =
function
(
other
) {
if
(
this
=== other) {
return
true
; }
if
(!(other
instanceof
Set
)) {
return
false
; }
if
(
this
.
size
!== other.
size
) {
return
false
; }
return
[...
this
][equals]([...other]); };