@@ -58,10 +58,6 @@ function transpile(x, name, folder) {
58
58
x += '\n;window.addEventListener("unload", () => Deno.exit(process.exitCode))'
59
59
}
60
60
61
- const stream = x . includes ( 'import(\'node:stream\')' )
62
- ? 'import { Readable, Writable } from \'' + std + 'node/stream.ts\'\n'
63
- : ''
64
-
65
61
const buffer = x . includes ( 'Buffer' )
66
62
? 'import { Buffer } from \'' + std + 'node/buffer.ts\'\n'
67
63
: ''
@@ -78,7 +74,7 @@ function transpile(x, name, folder) {
78
74
? 'import { HmacSha256 } from \'' + std + 'hash/sha256.ts\'\n'
79
75
: ''
80
76
81
- return hmac + buffer + process + stream + timers + x
77
+ return hmac + buffer + process + timers + x
82
78
. replace (
83
79
'crypto.createHmac(\'sha256\', key).update(x).digest()' ,
84
80
'Buffer.from(new HmacSha256(key).update(x).digest())'
@@ -88,7 +84,8 @@ function transpile(x, name, folder) {
88
84
'(query.writable.push({ chunk }), callback())'
89
85
)
90
86
. replace ( / .s e t K e e p A l i v e \( [ ^ ) ] + \) / g, '' )
91
- . replace ( / i m p o r t n e t f r o m ' n e t ' / , 'import { net } from \'../polyfills.js\'' )
92
- . replace ( / i m p o r t t l s f r o m ' t l s ' / , 'import { tls } from \'../polyfills.js\'' )
87
+ . replace ( 'node:stream' , std + 'node/stream.ts' )
88
+ . replace ( 'import net from \'net\'' , 'import { net } from \'../polyfills.js\'' )
89
+ . replace ( 'import tls from \'tls\'' , 'import { tls } from \'../polyfills.js\'' )
93
90
. replace ( / f r o m ' ( [ a - z _ ] + ) ' / g, ' from \'' + std + 'node/$1.ts\'' )
94
91
}
0 commit comments