MCPcopy
hub / github.com/angular-ui/ui-grid / processPredicates

Function processPredicates

lib/test/angular/1.8.0/angular.js:23934–23955  ·  view source on GitHub ↗
(sortPredicates)

Source from the content-addressed store, hash-verified

23932 };
23933
23934 function processPredicates(sortPredicates) {
23935 return sortPredicates.map(function(predicate) {
23936 var descending = 1, get = identity;
23937
23938 if (isFunction(predicate)) {
23939 get = predicate;
23940 } else if (isString(predicate)) {
23941 if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) {
23942 descending = predicate.charAt(0) === '-' ? -1 : 1;
23943 predicate = predicate.substring(1);
23944 }
23945 if (predicate !== '') {
23946 get = $parse(predicate);
23947 if (get.constant) {
23948 var key = get();
23949 get = function(value) { return value[key]; };
23950 }
23951 }
23952 }
23953 return {get: get, descending: descending};
23954 });
23955 }
23956
23957 function isPrimitive(value) {
23958 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