@ganziliang/kb 0.1.3 → 0.1.4
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/entry.d.ts +1 -0
- package/dist/entry.js +12 -1
- package/package.json +1 -1
package/dist/entry.d.ts
CHANGED
package/dist/entry.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// node:sqlite emits its experimental warning while the module is loading.
|
|
3
|
+
const emitWarning = process.emitWarning.bind(process);
|
|
4
|
+
process.emitWarning = ((warning, ...args) => {
|
|
5
|
+
const message = warning instanceof Error ? warning.message : warning;
|
|
6
|
+
const options = args[0] && typeof args[0] === "object" ? args[0] : undefined;
|
|
7
|
+
if (/SQLite/i.test(message) && options?.type === "ExperimentalWarning")
|
|
8
|
+
return;
|
|
9
|
+
return emitWarning(warning, ...args);
|
|
10
|
+
});
|
|
11
|
+
// Install a custom handler so Node's default warning printer does not print SQLite's warning.
|
|
12
|
+
process.removeAllListeners("warning");
|
|
2
13
|
process.on("warning", (warning) => {
|
|
3
14
|
if (warning.name === "ExperimentalWarning" && /SQLite/i.test(warning.message))
|
|
4
15
|
return;
|