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

Function processPredicates

test/angular/1.7/angular.js:23869–23890  ·  view source on GitHub ↗
(sortPredicates)

Source from the content-addressed store, hash-verified

23867 };
23868
23869 function processPredicates(sortPredicates) {
23870 return sortPredicates.map(function(predicate) {
23871 var descending = 1, get = identity;
23872
23873 if (isFunction(predicate)) {
23874 get = predicate;
23875 } else if (isString(predicate)) {
23876 if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) {
23877 descending = predicate.charAt(0) === '-' ? -1 : 1;
23878 predicate = predicate.substring(1);
23879 }
23880 if (predicate !== '') {
23881 get = $parse(predicate);
23882 if (get.constant) {
23883 var key = get();
23884 get = function(value) { return value[key]; };
23885 }
23886 }
23887 }
23888 return {get: get, descending: descending};
23889 });
23890 }
23891
23892 function isPrimitive(value) {
23893 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