@peerbit/indexer-sqlite3 1.1.1 → 1.1.2

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.
@@ -360,9 +360,7 @@ const installAsyncProxy = function () {
360
360
  dirHandle: hDir,
361
361
  fileHandle: hFile,
362
362
  sabView: state.sabFileBufView,
363
- readOnly: create
364
- ? false
365
- : state.sq3Codes.SQLITE_OPEN_READONLY & flags,
363
+ readOnly: !create && !!(state.sq3Codes.SQLITE_OPEN_READONLY & flags),
366
364
  deleteOnClose: !!(state.sq3Codes.SQLITE_OPEN_DELETEONCLOSE & flags),
367
365
  });
368
366
  fh.releaseImplicitLocks =
@@ -430,7 +428,7 @@ const installAsyncProxy = function () {
430
428
  xUnlock: async function (fid, lockType) {
431
429
  let rc = 0;
432
430
  const fh = __openFiles[fid];
433
- if (state.sq3Codes.SQLITE_LOCK_NONE === lockType && fh.syncHandle) {
431
+ if (fh.syncHandle && state.sq3Codes.SQLITE_LOCK_NONE === lockType) {
434
432
  try {
435
433
  await closeSyncHandle(fh);
436
434
  } catch (e) {