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