(sortPredicates)
| 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) { |
no test coverage detected