mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 22:03:45 +00:00
Suppress punycode deprecation warning from dependencies
This commit is contained in:
parent
97e00fc45d
commit
ea01a758e0
1 changed files with 15 additions and 0 deletions
|
|
@ -1,5 +1,20 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
// Suppress punycode deprecation warning from dependencies
|
||||
// This warning comes from old dependencies still using the deprecated punycode module
|
||||
const originalEmit = process.emit;
|
||||
// @ts-expect-error - Monkey-patch emit to filter warnings
|
||||
process.emit = (event, ...args) => {
|
||||
if (event === "warning") {
|
||||
const warning = args[0] as any;
|
||||
if (warning?.name === "DeprecationWarning" && warning?.code === "DEP0040") {
|
||||
return false; // Suppress punycode deprecation
|
||||
}
|
||||
}
|
||||
// @ts-expect-error - Call original with event and args
|
||||
return originalEmit.apply(process, [event, ...args]);
|
||||
};
|
||||
|
||||
import { main } from "./main.js";
|
||||
|
||||
main(process.argv.slice(2)).catch((err) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue