actual/patches/absurd-sql+0.0.53.patch
2022-04-28 22:44:38 -04:00

58 lines
1.8 KiB
Diff

diff --git a/node_modules/absurd-sql/dist/index.js b/node_modules/absurd-sql/dist/index.js
index 77779cb..4064532 100644
--- a/node_modules/absurd-sql/dist/index.js
+++ b/node_modules/absurd-sql/dist/index.js
@@ -101,6 +101,8 @@ class SQLiteFS$1 {
return stream.node.contents.read(buffer, offset, length, position);
},
+
+
write: (stream, buffer, offset, length, position) => {
// console.log('write', offset, length, position);
return stream.node.contents.write(buffer, offset, length, position);
@@ -142,12 +144,18 @@ class SQLiteFS$1 {
lock(path, lockType) {
let { node } = this.FS.lookupPath(path);
- return node.contents.lock(lockType);
+ if(node && node.contents) {
+ return node.contents.lock(lockType);
+ }
+ return true;
}
unlock(path, lockType) {
let { node } = this.FS.lookupPath(path);
- return node.contents.unlock(lockType);
+ if(node && node.contents) {
+ return node.contents.unlock(lockType);
+ }
+ return true;
}
createNode(parent, name, mode, dev) {
diff --git a/node_modules/absurd-sql/src/sqlite-fs.js b/node_modules/absurd-sql/src/sqlite-fs.js
index f91d2a9..8353cca 100644
--- a/node_modules/absurd-sql/src/sqlite-fs.js
+++ b/node_modules/absurd-sql/src/sqlite-fs.js
@@ -142,12 +142,16 @@ export default class SQLiteFS {
lock(path, lockType) {
let { node } = this.FS.lookupPath(path);
- return node.contents.lock(lockType);
+ if(node && node.contents) {
+ return node.contents.lock(lockType);
+ }
}
unlock(path, lockType) {
let { node } = this.FS.lookupPath(path);
- return node.contents.unlock(lockType);
+ if(node && node.contents) {
+ return node.contents.unlock(lockType);
+ }
}
createNode(parent, name, mode, dev) {