summaryrefslogtreecommitdiff
path: root/src/utils.js
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-11-16 15:48:12 -0300
committerEuAndreh <eu@euandre.org>2023-11-16 15:51:57 -0300
commitb2b5ba67c25705ddabb7f59baf725604eaf67c04 (patch)
tree96ffbd2b9455965a814cc55ec47b50fbbd213b68 /src/utils.js
parentMakefile, mkdeps.sh: Enforce JS->native dependency (diff)
downloadpapod-b2b5ba67c25705ddabb7f59baf725604eaf67c04.tar.gz
papod-b2b5ba67c25705ddabb7f59baf725604eaf67c04.tar.xz
Add WIP non-async functions to napi-sqlite.c
Diffstat (limited to 'src/utils.js')
-rw-r--r--src/utils.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils.js b/src/utils.js
index 2c3ea72..e1725ef 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -38,7 +38,20 @@ const keys = (ks, obj) =>
{},
);
+const difference = (a, b) => {
+ const diff = new Set(a);
+ for (const el of b) {
+ diff.delete(el);
+ }
+ return diff;
+};
+
+const log = o => console.error(JSON.stringify(o));
+
+
module.exports = {
eq,
keys,
+ difference,
+ log,
};