Comparing version 1.6.5 to 1.7.0
@@ -7,2 +7,3 @@ /// <reference lib="dom" /> | ||
import * as path from "path"; | ||
import { fileURLToPath } from "url"; | ||
let tsNodeAvailable; | ||
@@ -49,3 +50,6 @@ export const defaultPoolSize = cpus().length; | ||
const rawCallerPath = parentCallSite ? parentCallSite.getFileName() : null; | ||
const callerPath = rawCallerPath ? rawCallerPath.replace(/^file:\//, "") : null; | ||
let callerPath = rawCallerPath ? rawCallerPath : null; | ||
if (callerPath && callerPath.startsWith('file:')) { | ||
callerPath = fileURLToPath(callerPath); | ||
} | ||
const rebasedScriptPath = callerPath ? path.join(path.dirname(callerPath), scriptPath) : scriptPath; | ||
@@ -52,0 +56,0 @@ return rebasedScriptPath; |
@@ -32,2 +32,3 @@ "use strict"; | ||
const path = __importStar(require("path")); | ||
const url_1 = require("url"); | ||
let tsNodeAvailable; | ||
@@ -74,3 +75,6 @@ exports.defaultPoolSize = os_1.cpus().length; | ||
const rawCallerPath = parentCallSite ? parentCallSite.getFileName() : null; | ||
const callerPath = rawCallerPath ? rawCallerPath.replace(/^file:\//, "") : null; | ||
let callerPath = rawCallerPath ? rawCallerPath : null; | ||
if (callerPath && callerPath.startsWith('file:')) { | ||
callerPath = url_1.fileURLToPath(callerPath); | ||
} | ||
const rebasedScriptPath = callerPath ? path.join(path.dirname(callerPath), scriptPath) : scriptPath; | ||
@@ -77,0 +81,0 @@ return rebasedScriptPath; |
@@ -46,3 +46,4 @@ /// <reference lib="dom" /> | ||
postMessage(value: any, transferList?: TransferList): void; | ||
terminate(callback?: (error?: Error, exitCode?: number) => void): void; | ||
/** In nodejs 10+ return type is Promise while with tiny-worker and in browser return type is void */ | ||
terminate(callback?: (error?: Error, exitCode?: number) => void): void | Promise<number>; | ||
} | ||
@@ -70,3 +71,3 @@ export interface ThreadsWorkerOptions extends WorkerOptions { | ||
postMessage(value: any, transferList?: TransferList): void; | ||
terminate(): void; | ||
terminate(): void | Promise<number>; | ||
} | ||
@@ -73,0 +74,0 @@ /** Class to spawn workers from a blob or source string. */ |
{ | ||
"name": "threads", | ||
"version": "1.6.5", | ||
"version": "1.7.0", | ||
"description": "Web workers & worker threads as simple as a function call", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
178088
3993