UNPKG

@_all_docs/cache

Version:

Fetch, cache, & map/reduce :origin/{_all_docs,:packument}` documents for a set of lexographically sorted pivots by range or partition

18 lines (15 loc) 304 B
function fromPivots(pivots) { return pivots.map((startKey, i) => { const endKey = pivots[i + 1]; const id = `${startKey}__${endKey}`; return endKey && { startKey, endKey, id, filename: `${id}.json` }; }).filter(Boolean); } module.exports = { fromPivots };