move shim to new package

This commit is contained in:
Nystik
2026-05-20 20:49:28 +02:00
parent a0b44bde58
commit fe11f30c01
66 changed files with 46 additions and 23 deletions

View File

@@ -0,0 +1,19 @@
function notAvailable(name) {
return function () {
throw new Error(`net.${name}() is not available in the web version.`);
};
}
export const createServer = notAvailable("createServer");
export const createConnection = notAvailable("createConnection");
export const connect = notAvailable("connect");
export class Socket {
constructor() {
throw new Error("net.Socket is not available in the web version.");
}
}
export class Server {
constructor() {
throw new Error("net.Server is not available in the web version.");
}
}