MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / processPredicates

Function processPredicates

lib/test/angular/1.7.0/angular.js:23148–23169  ·  view source on GitHub ↗
(sortPredicates)

Source from the content-addressed store, hash-verified

23146 };
23147
23148 function processPredicates(sortPredicates) {
23149 return sortPredicates.map(function(predicate) {
23150 var descending = 1, get = identity;
23151
23152 if (isFunction(predicate)) {
23153 get = predicate;
23154 } else if (isString(predicate)) {
23155 if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) {
23156 descending = predicate.charAt(0) === '-' ? -1 : 1;
23157 predicate = predicate.substring(1);
23158 }
23159 if (predicate !== '') {
23160 get = $parse(predicate);
23161 if (get.constant) {
23162 var key = get();
23163 get = function(value) { return value[key]; };
23164 }
23165 }
23166 }
23167 return {get: get, descending: descending};
23168 });
23169 }
23170
23171 function isPrimitive(value) {
23172 switch (typeof value) {

Callers 1

orderByFilterFunction · 0.70

Calls 3

isFunctionFunction · 0.70
isStringFunction · 0.70
$parseFunction · 0.70

Tested by

no test coverage detected