MCPcopy Create free account
hub / github.com/angular-ui/ui-grid / getComparisonObject

Function getComparisonObject

lib/test/angular/1.7.0/angular.js:23123–23134  ·  view source on GitHub ↗
(value, index)

Source from the content-addressed store, hash-verified

23121 return array;
23122
23123 function getComparisonObject(value, index) {
23124 // NOTE: We are adding an extra `tieBreaker` value based on the element's index.
23125 // This will be used to keep the sort stable when none of the input predicates can
23126 // distinguish between two elements.
23127 return {
23128 value: value,
23129 tieBreaker: {value: index, type: 'number', index: index},
23130 predicateValues: predicates.map(function(predicate) {
23131 return getPredicateValue(predicate.get(value), index);
23132 })
23133 };
23134 }
23135
23136 function doComparison(v1, v2) {
23137 for (var i = 0, ii = predicates.length; i < ii; i++) {

Callers

nothing calls this directly

Calls 1

getPredicateValueFunction · 0.70

Tested by

no test coverage detected