@cero-base/core 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cero-base/core",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "cero p2p primitives — identity, storage, network, database, blobs, rpc, pairing.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -381,6 +381,8 @@ export class Database extends ReadyResource {
381
381
  }
382
382
 
383
383
  const all = await this.view.find(col, {}).toArray()
384
+ // collections carry an auto-increment `index`; return them in that order
385
+ all.sort((a, b) => (a.index ?? 0) - (b.index ?? 0))
384
386
  const total = all.length
385
387
  const data = paginate(all, query)
386
388
  return { data, total, size: data.length }