MCPcopy Create free account
hub / github.com/microsoft/SandDance / comparator

Function comparator

docs/app/js/sanddance-app.js:106775–106775  ·  view source on GitHub ↗
(fields, orders)

Source from the content-addressed store, hash-verified

106773}
106774const ascending = (u, v)=>(u < v || u == null) && v != null ? -1 : (u > v || v == null) && u != null ? 1 : (v = v instanceof Date ? +v : v, u = u instanceof Date ? +u : u) !== u && v === v ? -1 : v !== v && u === u ? 1 : 0;
106775const comparator = (fields, orders)=>fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);
106776const compare1 = (field3, order)=>function(a, b) {
106777 return ascending(field3(a), field3(b)) * order;
106778 };

Callers

nothing calls this directly

Calls 2

compare1Function · 0.70
compareNFunction · 0.70

Tested by

no test coverage detected