From b2b5ba67c25705ddabb7f59baf725604eaf67c04 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 16 Nov 2023 15:48:12 -0300 Subject: Add WIP non-async functions to napi-sqlite.c --- src/utils.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/utils.js') 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, }; -- cgit v1.2.3