(sortPredicates)
| 23146 | }; |
| 23147 | |
| 23148 | function processPredicates(sortPredicates) { |
| 23149 | return sortPredicates.map(function(predicate) { |
| 23150 | var descending = 1, get = identity; |
| 23151 | |
| 23152 | if (isFunction(predicate)) { |
| 23153 | get = predicate; |
| 23154 | } else if (isString(predicate)) { |
| 23155 | if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) { |
| 23156 | descending = predicate.charAt(0) === '-' ? -1 : 1; |
| 23157 | predicate = predicate.substring(1); |
| 23158 | } |
| 23159 | if (predicate !== '') { |
| 23160 | get = $parse(predicate); |
| 23161 | if (get.constant) { |
| 23162 | var key = get(); |
| 23163 | get = function(value) { return value[key]; }; |
| 23164 | } |
| 23165 | } |
| 23166 | } |
| 23167 | return {get: get, descending: descending}; |
| 23168 | }); |
| 23169 | } |
| 23170 | |
| 23171 | function isPrimitive(value) { |
| 23172 | switch (typeof value) { |
no test coverage detected