(db, fun, keys, values, rereduce)
| 8187 | } |
| 8188 | |
| 8189 | function tryReduce(db, fun, keys, values, rereduce) { |
| 8190 | // same as above, but returning the result or an error. there are two separate |
| 8191 | // functions to avoid extra memory allocations since the tryCode() case is used |
| 8192 | // for custom map functions (common) vs this function, which is only used for |
| 8193 | // custom reduce functions (rare) |
| 8194 | try { |
| 8195 | return {output : fun(keys, values, rereduce)}; |
| 8196 | } catch (e) { |
| 8197 | emitError(db, e, {fun, keys, values, rereduce}); |
| 8198 | return {error: e}; |
| 8199 | } |
| 8200 | } |
| 8201 | |
| 8202 | function sortByKeyThenValue(x, y) { |
| 8203 | const keyCompare = collate(x.key, y.key); |
no test coverage detected
searching dependent graphs…