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