(sortPredicates)
| 23932 | }; |
| 23933 | |
| 23934 | function processPredicates(sortPredicates) { |
| 23935 | return sortPredicates.map(function(predicate) { |
| 23936 | var descending = 1, get = identity; |
| 23937 | |
| 23938 | if (isFunction(predicate)) { |
| 23939 | get = predicate; |
| 23940 | } else if (isString(predicate)) { |
| 23941 | if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) { |
| 23942 | descending = predicate.charAt(0) === '-' ? -1 : 1; |
| 23943 | predicate = predicate.substring(1); |
| 23944 | } |
| 23945 | if (predicate !== '') { |
| 23946 | get = $parse(predicate); |
| 23947 | if (get.constant) { |
| 23948 | var key = get(); |
| 23949 | get = function(value) { return value[key]; }; |
| 23950 | } |
| 23951 | } |
| 23952 | } |
| 23953 | return {get: get, descending: descending}; |
| 23954 | }); |
| 23955 | } |
| 23956 | |
| 23957 | function isPrimitive(value) { |
| 23958 | switch (typeof value) { |
no test coverage detected