@harperfast/rocksdb-js 0.1.13 → 1.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
@@ -1776,23 +1776,23 @@ Object.defineProperty(TransactionLog.prototype, "query", { value({ start, end, e
1776
1776
  size = logBuffer.size ?? (logBuffer.size = transactionLog.getLogFileSize(logBuffer.logId));
1777
1777
  if (position >= size) {
1778
1778
  const nextLogBuffer = getLogMemoryMap(transactionLog, logBuffer.logId + 1);
1779
- dataView = nextLogBuffer.dataView;
1780
- logBuffer = nextLogBuffer;
1781
- if (latestLogId > logBuffer.logId) size = logBuffer.size ?? (logBuffer.size = transactionLog.getLogFileSize(logBuffer.logId));
1782
- else size = latestSize;
1783
- position = TRANSACTION_LOG_FILE_HEADER_SIZE;
1779
+ if (nextLogBuffer) {
1780
+ dataView = nextLogBuffer.dataView;
1781
+ logBuffer = nextLogBuffer;
1782
+ if (latestLogId > logBuffer.logId) size = logBuffer.size ?? (logBuffer.size = transactionLog.getLogFileSize(logBuffer.logId));
1783
+ else size = latestSize;
1784
+ position = TRANSACTION_LOG_FILE_HEADER_SIZE;
1785
+ }
1784
1786
  }
1785
1787
  }
1786
1788
  }
1787
1789
  while (position < size) {
1788
- do
1789
- try {
1790
- timestamp = dataView.getFloat64(position);
1791
- } catch (error) {
1792
- error.message += ` at position ${position} of log ${logBuffer.logId} (size=${size}, log buffer length=${logBuffer.length})`;
1793
- throw error;
1794
- }
1795
- while (timestamp < 1 && ++position < size);
1790
+ try {
1791
+ timestamp = dataView.getFloat64(position);
1792
+ } catch (error) {
1793
+ error.message += ` at position ${position} of log ${logBuffer.logId} (size=${size}, log buffer length=${logBuffer.length})`;
1794
+ throw error;
1795
+ }
1796
1796
  if (!timestamp) return {
1797
1797
  done: true,
1798
1798
  value: void 0
@@ -1883,7 +1883,7 @@ function loadLastPosition(transactionLog, readUncommitted) {
1883
1883
  //#region src/index.ts
1884
1884
  const versions = {
1885
1885
  rocksdb: version,
1886
- "rocksdb-js": "0.1.13"
1886
+ "rocksdb-js": "1.0.0"
1887
1887
  };
1888
1888
 
1889
1889
  //#endregion