(sortPredicates)
| 22702 | }; |
| 22703 | |
| 22704 | function processPredicates(sortPredicates) { |
| 22705 | return sortPredicates.map(function(predicate) { |
| 22706 | var descending = 1, get = identity; |
| 22707 | |
| 22708 | if (isFunction(predicate)) { |
| 22709 | get = predicate; |
| 22710 | } else if (isString(predicate)) { |
| 22711 | if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) { |
| 22712 | descending = predicate.charAt(0) === '-' ? -1 : 1; |
| 22713 | predicate = predicate.substring(1); |
| 22714 | } |
| 22715 | if (predicate !== '') { |
| 22716 | get = $parse(predicate); |
| 22717 | if (get.constant) { |
| 22718 | var key = get(); |
| 22719 | get = function(value) { return value[key]; }; |
| 22720 | } |
| 22721 | } |
| 22722 | } |
| 22723 | return {get: get, descending: descending}; |
| 22724 | }); |
| 22725 | } |
| 22726 | |
| 22727 | function isPrimitive(value) { |
| 22728 | switch (typeof value) { |
no test coverage detected