Deep compare with a function
const compare = ;const cmp = ;; // returns true
more examples can be found in test.js
Curryable
lhsrhsrhslhsrhs
const cmp = ;; // false; // true; // false
Arguments
;
Compare Functions
This set of functions will be run to compare each object or value in the passed items, if any of the functions return true the corresponding items will be considered equivalent, there is an implicit test (a,b)=>a===b
which exists unless using noDefault
; // same as compare []; // same as [(a,b)=>a<b]const cmp = ;const cmpt = ;; // false; // true; // false; // false; // true
Modifiers
Modifiers call a modified version of the function
noDefault
Call without implicit test (a,b)=>a===b
const cmp = compare;; // false; // trueconst cmp2 = ;cmp2; // falsecmp2; // true
failPath
Instead of false, it returns the key path to the point where the compare failed. If it succeeds, return true;
const val1 = a: b: c: 2 d: 3 e: f: 4 ;const val2 = a: b: c: 3 d: 3 e: f: 4 ;; // ['a', 'b', 'c']val1; // ['a', 'b', 'c']
Content
Return data about the function
tests
Returns array of tests currently curried in
const cmp = ;cmp; // []const cmpt = ;cmpt; // [(a, b) => (typeof a === typeof b)]
lhs
Returns lhs value currently curried in, otherwise undefined
; // 5