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 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
- fn = realRequire(decodeURIComponent(filename.replace('file://', '')))
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thread-stream",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "description": "A streaming way to send data to a Node.js Worker Thread",
5
5
  "main": "index.js",
6
6
  "dependencies": {
package/test/ts.test.ts CHANGED
@@ -6,12 +6,6 @@ import { file } from './helper.js'
6
6
 
7
7
 
8
8
  test('typescript module', function (t) {
9
- if (process.platform === 'win32') {
10
- // TODO: Implement .ts files loading support for Windows
11
- t.plan(0)
12
- return
13
- }
14
-
15
9
  t.plan(5)
16
10
 
17
11
  const dest = file()