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

Function processPredicates

test/angular/1.6/angular.js:23031–23052  ·  view source on GitHub ↗
(sortPredicates)

Source from the content-addressed store, hash-verified

23029 };
23030
23031 function processPredicates(sortPredicates) {
23032 return sortPredicates.map(function(predicate) {
23033 var descending = 1, get = identity;
23034
23035 if (isFunction(predicate)) {
23036 get = predicate;
23037 } else if (isString(predicate)) {
23038 if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) {
23039 descending = predicate.charAt(0) === '-' ? -1 : 1;
23040 predicate = predicate.substring(1);
23041 }
23042 if (predicate !== '') {
23043 get = $parse(predicate);
23044 if (get.constant) {
23045 var key = get();
23046 get = function(value) { return value[key]; };
23047 }
23048 }
23049 }
23050 return {get: get, descending: descending};
23051 });
23052 }
23053
23054 function isPrimitive(value) {
23055 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