ECMAScript 6
const compare = require('set-comparision') // Equivalent to `template(template.OBJECT_EQUAL)`, see below
const template = require('set-comparision/x')
const compare = template(myEqualFunction)
-
A
andB
are instances of aSet
-like class -
a
andb
are elements ofA
andB
above
Equivalent to compare.equal(A, B)
Returns true
if every elements of A
are found in B
and vice versa
Returns true
if A
is a subset of B
Returns true
if A
is a superset of B
- with
Func
is eitherEqual
,Subset
orSuperset
Returns negative boolean of compare.func(A, B)
, e.g. compare.notEqual(A, B)
is !compare.equal(A, B)
Create a new set of set-comparision functions based on myEqualFunction
as element equality function
myEqualFunction
takes 2 parameters, which are a
and b
, and returns a boolean which true
for equal and false
otherwise
Equivalent to template(myEqualFunction)
with template = require('set-comparision/x')
Equivalent to compare.xCompareSet(myEqualFunction)
compare.STRICT_EQUAL = (a, b) => a === b
compare.OBJECT_EQUAL = (a, b) => Object.is(a, b)
MIT