MCPcopy Create free account
hub / github.com/bclinkinbeard/angular / compare

Function compare

test/fixtures/foo.js:15596–15613  ·  view source on GitHub ↗
(v1, v2)

Source from the content-addressed store, hash-verified

15594 : comp;
15595 }
15596 function compare(v1, v2){
15597 var t1 = typeof v1;
15598 var t2 = typeof v2;
15599 if (t1 == t2) {
15600 if (isDate(v1) && isDate(v2)) {
15601 v1 = v1.valueOf();
15602 v2 = v2.valueOf();
15603 }
15604 if (t1 == "string") {
15605 v1 = v1.toLowerCase();
15606 v2 = v2.toLowerCase();
15607 }
15608 if (v1 === v2) return 0;
15609 return v1 < v2 ? -1 : 1;
15610 } else {
15611 return t1 < t2 ? -1 : 1;
15612 }
15613 }
15614 };
15615}
15616

Callers 2

nodeLinkFnFunction · 0.85
orderByFilterFunction · 0.85

Calls 1

isDateFunction · 0.85

Tested by

no test coverage detected