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

Function processPredicates

lib/test/angular/1.6.7/angular.js:22704–22725  ·  view source on GitHub ↗
(sortPredicates)

Source from the content-addressed store, hash-verified

22702 };
22703
22704 function processPredicates(sortPredicates) {
22705 return sortPredicates.map(function(predicate) {
22706 var descending = 1, get = identity;
22707
22708 if (isFunction(predicate)) {
22709 get = predicate;
22710 } else if (isString(predicate)) {
22711 if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) {
22712 descending = predicate.charAt(0) === '-' ? -1 : 1;
22713 predicate = predicate.substring(1);
22714 }
22715 if (predicate !== '') {
22716 get = $parse(predicate);
22717 if (get.constant) {
22718 var key = get();
22719 get = function(value) { return value[key]; };
22720 }
22721 }
22722 }
22723 return {get: get, descending: descending};
22724 });
22725 }
22726
22727 function isPrimitive(value) {
22728 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