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

Function processPredicates

test/angular/1.5/angular.js:22067–22088  ·  view source on GitHub ↗
(sortPredicates)

Source from the content-addressed store, hash-verified

22065 };
22066
22067 function processPredicates(sortPredicates) {
22068 return sortPredicates.map(function(predicate) {
22069 var descending = 1, get = identity;
22070
22071 if (isFunction(predicate)) {
22072 get = predicate;
22073 } else if (isString(predicate)) {
22074 if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) {
22075 descending = predicate.charAt(0) === '-' ? -1 : 1;
22076 predicate = predicate.substring(1);
22077 }
22078 if (predicate !== '') {
22079 get = $parse(predicate);
22080 if (get.constant) {
22081 var key = get();
22082 get = function(value) { return value[key]; };
22083 }
22084 }
22085 }
22086 return {get: get, descending: descending};
22087 });
22088 }
22089
22090 function isPrimitive(value) {
22091 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