From dbe02c0b7394c188d59243414eb9698f5be02704 Mon Sep 17 00:00:00 2001 From: izure Date: Fri, 26 Apr 2024 06:46:57 +0900 Subject: [PATCH] fix: Fix error where root chunk was duplicated and inserted --- .github/workflows/node.js.yml | 2 +- package.json | 2 +- src/document/TissueRollDocument.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index fbc4b1a..de874ff 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [16.x, 18.x] + node-version: [16.x, 18.x, 20.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: diff --git a/package.json b/package.json index b911cd0..2e1efc1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tissue-roll", - "version": "4.0.0", + "version": "4.0.1", "description": "Very simple read/write database with a no-sql.", "main": "dist/cjs/index.cjs", "module": "dist/esm/index.mjs", diff --git a/src/document/TissueRollDocument.ts b/src/document/TissueRollDocument.ts index 9ee23e0..ff430a2 100644 --- a/src/document/TissueRollDocument.ts +++ b/src/document/TissueRollDocument.ts @@ -168,7 +168,7 @@ export class TissueRollDocument> { } const db = TissueRoll.Open(file, payloadSize) - const record = db.getRecords(1).pop()! + const record = db.getRecords(1)[0] const docRoot = TissueRollDocument.Verify(file, record.payload) return new TissueRollDocument(db, record.header.id, docRoot, 0)