@harperfast/rocksdb-js 1.5.0 → 2.0.0

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/dist/index.mjs CHANGED
@@ -574,8 +574,6 @@ const VALUE_BUFFER = createFixedBuffer(64 * 1024);
574
574
  const ITERATOR_STATE_BUFFER = Buffer.allocUnsafeSlow(8);
575
575
  const ITERATOR_STATE = new Uint32Array(ITERATOR_STATE_BUFFER.buffer, ITERATOR_STATE_BUFFER.byteOffset, 2);
576
576
  const MAX_KEY_SIZE = 1024 * 1024;
577
- const RESET_BUFFER_MODE = 1024;
578
- const REUSE_BUFFER_MODE = 512;
579
577
  const SAVE_BUFFER_SIZE = 8192;
580
578
  /**
581
579
  * A store wraps the `NativeDatabase` binding and database settings so that a
@@ -865,7 +863,7 @@ var Store = class {
865
863
  encodeValue(value) {
866
864
  if (value && value["binary-data"]) return value["binary-data"];
867
865
  if (typeof this.encoder?.encode === "function") {
868
- if (this.encoder.copyBuffers) return this.encoder.encode(value, REUSE_BUFFER_MODE | RESET_BUFFER_MODE);
866
+ if (this.encoder.copyBuffers) return this.encoder.encode(value, 1536);
869
867
  const valueBuffer = this.encoder.encode(value);
870
868
  if (typeof valueBuffer === "string") return Buffer.from(valueBuffer);
871
869
  return valueBuffer;
@@ -1894,7 +1892,6 @@ var RocksDatabase = class RocksDatabase extends DBI {
1894
1892
  //#region src/parse-transaction-log.ts
1895
1893
  const { TRANSACTION_LOG_TOKEN, TRANSACTION_LOG_ENTRY_HEADER_SIZE: TRANSACTION_LOG_ENTRY_HEADER_SIZE$1 } = constants;
1896
1894
  const MIN_VALID_TIMESTAMP = Date.UTC(2026, 0, 27);
1897
- const VALID_FLAGS_MASK = 1;
1898
1895
  /**
1899
1896
  * Loads an entire transaction log file into memory.
1900
1897
  * @param path - The path to the transaction log file.
@@ -1948,7 +1945,7 @@ function parseTransactionLog(path, options = {}) {
1948
1945
  const data = read(length);
1949
1946
  const entryAnomalies = [];
1950
1947
  if (!Number.isFinite(timestamp) || timestamp < MIN_VALID_TIMESTAMP) entryAnomalies.push(`timestamp ${timestamp} predates 2026-01-27 (possible corruption)`);
1951
- if ((flags & ~VALID_FLAGS_MASK) !== 0) entryAnomalies.push(`flags 0x${flags.toString(16).padStart(2, "0")} contains undefined bits (expected 0x00 or 0x01)`);
1948
+ if ((flags & -2) !== 0) entryAnomalies.push(`flags 0x${flags.toString(16).padStart(2, "0")} contains undefined bits (expected 0x00 or 0x01)`);
1952
1949
  const entry = {
1953
1950
  timestamp,
1954
1951
  length,
@@ -2165,7 +2162,7 @@ function loadLastPosition(transactionLog, readUncommitted) {
2165
2162
  //#region src/index.ts
2166
2163
  const versions = {
2167
2164
  rocksdb: version,
2168
- "rocksdb-js": "1.5.0"
2165
+ "rocksdb-js": "2.0.0"
2169
2166
  };
2170
2167
 
2171
2168
  //#endregion