thread-stream 0.15.1 → 0.15.2
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/lib/worker.js +3 -3
- package/package.json +1 -1
- package/test/ts.test.ts +0 -6
package/lib/worker.js
CHANGED
|
@@ -19,16 +19,16 @@ const data = Buffer.from(dataBuf)
|
|
|
19
19
|
async function start () {
|
|
20
20
|
let fn
|
|
21
21
|
try {
|
|
22
|
-
// TODO: fix loading .ts files in Windows. See: ../test/ts.test.ts
|
|
23
22
|
if (filename.endsWith('.ts') || filename.endsWith('.cts')) {
|
|
24
23
|
// TODO: add support for the TSM modules loader ( https://github.com/lukeed/tsm ).
|
|
25
|
-
if (process[Symbol.for('ts-node.register.instance')]) {
|
|
24
|
+
if (!process[Symbol.for('ts-node.register.instance')]) {
|
|
26
25
|
realRequire('ts-node/register')
|
|
27
26
|
} else if (process.env.TS_NODE_DEV) {
|
|
28
27
|
realRequire('ts-node-dev')
|
|
29
28
|
}
|
|
30
29
|
// TODO: Support ES imports once tsc, tap & ts-node provide better compatibility guarantees.
|
|
31
|
-
|
|
30
|
+
// Remove extra forwardslash on Windows
|
|
31
|
+
fn = realRequire(decodeURIComponent(filename.replace(process.platform === 'win32' ? 'file:///' : 'file://', '')))
|
|
32
32
|
} else {
|
|
33
33
|
fn = (await realImport(filename))
|
|
34
34
|
}
|
package/package.json
CHANGED
package/test/ts.test.ts
CHANGED