@xylabs/threads 3.4.2 → 3.5.1
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/dist/master/implementation.node.js +2 -2
- package/dist/worker/index.js +2 -2
- package/dist-esm/master/implementation.node.js +1 -1
- package/dist-esm/worker/index.js +1 -1
- package/package.json +4 -4
- package/src/master/implementation.node.ts +1 -1
- package/src/worker/index.ts +1 -1
- package/types/is-observable.d.ts +1 -1
|
@@ -17,7 +17,7 @@ const node_events_1 = require("node:events");
|
|
|
17
17
|
const node_os_1 = require("node:os");
|
|
18
18
|
const node_path_1 = __importDefault(require("node:path"));
|
|
19
19
|
const node_url_1 = require("node:url");
|
|
20
|
-
const
|
|
20
|
+
const callsites_3_1_0_1 = __importDefault(require("callsites-3-1-0"));
|
|
21
21
|
let tsNodeAvailable;
|
|
22
22
|
exports.defaultPoolSize = (0, node_os_1.cpus)().length;
|
|
23
23
|
function detectTsNode() {
|
|
@@ -51,7 +51,7 @@ function createTsNodeModule(scriptPath) {
|
|
|
51
51
|
return content;
|
|
52
52
|
}
|
|
53
53
|
function rebaseScriptPath(scriptPath, ignoreRegex) {
|
|
54
|
-
const parentCallSite = (0,
|
|
54
|
+
const parentCallSite = (0, callsites_3_1_0_1.default)().find((callsite) => {
|
|
55
55
|
const filename = callsite.getFileName();
|
|
56
56
|
return Boolean(filename && !filename.match(ignoreRegex) && !/[/\\]master[/\\]implementation/.test(filename) && !/^internal\/process/.test(filename));
|
|
57
57
|
});
|
package/dist/worker/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.expose = exports.isWorkerRuntime = exports.Transfer = exports.registerSerializer = void 0;
|
|
7
7
|
/* eslint-disable @typescript-eslint/no-floating-promises */
|
|
8
8
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
9
|
-
const
|
|
9
|
+
const is_observable_2_1_0_1 = __importDefault(require("is-observable-2-1-0"));
|
|
10
10
|
const common_1 = require("../common");
|
|
11
11
|
const transferable_1 = require("../transferable");
|
|
12
12
|
const messages_1 = require("../types/messages");
|
|
@@ -25,7 +25,7 @@ const isMasterJobRunMessage = (thing) => thing && thing.type === messages_1.Mast
|
|
|
25
25
|
* There are issues with `is-observable` not recognizing zen-observable's instances.
|
|
26
26
|
* We are using `observable-fns`, but it's based on zen-observable, too.
|
|
27
27
|
*/
|
|
28
|
-
const isObservable = (thing) => (0,
|
|
28
|
+
const isObservable = (thing) => (0, is_observable_2_1_0_1.default)(thing) || isZenObservable(thing);
|
|
29
29
|
function isZenObservable(thing) {
|
|
30
30
|
return thing && typeof thing === 'object' && typeof thing.subscribe === 'function';
|
|
31
31
|
}
|
|
@@ -11,7 +11,7 @@ import { EventEmitter } from 'node:events';
|
|
|
11
11
|
import { cpus } from 'node:os';
|
|
12
12
|
import path from 'node:path';
|
|
13
13
|
import { fileURLToPath } from 'node:url';
|
|
14
|
-
import getCallsites from 'callsites';
|
|
14
|
+
import getCallsites from 'callsites-3-1-0';
|
|
15
15
|
let tsNodeAvailable;
|
|
16
16
|
export const defaultPoolSize = cpus().length;
|
|
17
17
|
function detectTsNode() {
|
package/dist-esm/worker/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-floating-promises */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
import isSomeObservable from 'is-observable';
|
|
3
|
+
import isSomeObservable from 'is-observable-2-1-0';
|
|
4
4
|
import { deserialize, serialize } from '../common';
|
|
5
5
|
import { isTransferDescriptor } from '../transferable';
|
|
6
6
|
import { MasterMessageType, WorkerMessageType, } from '../types/messages';
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/threads",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"description": "Web workers & worker threads as simple as a function call",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist-esm/index.js",
|
|
8
|
-
"
|
|
8
|
+
"scripts": {
|
|
9
9
|
"package-compile": "yarn build",
|
|
10
10
|
"clean": "rimraf dist/ dist-esm/",
|
|
11
11
|
"dev": "npm run clean && tsc -p tsconfig.json --watch",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
],
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@babel/types": "^7.24.6",
|
|
70
|
-
"callsites": "
|
|
70
|
+
"callsites-3-1-0": "npm:callsites@3.1.0",
|
|
71
71
|
"debug": "^4.3.4",
|
|
72
|
-
"is-observable": "
|
|
72
|
+
"is-observable-2-1-0": "npm:is-observable@2.1.0",
|
|
73
73
|
"observable-fns": "^0.6.1"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
@@ -13,7 +13,7 @@ import { cpus } from 'node:os'
|
|
|
13
13
|
import path from 'node:path'
|
|
14
14
|
import { fileURLToPath } from 'node:url'
|
|
15
15
|
|
|
16
|
-
import getCallsites, { CallSite } from 'callsites'
|
|
16
|
+
import getCallsites, { CallSite } from 'callsites-3-1-0'
|
|
17
17
|
|
|
18
18
|
import { ImplementationExport, ThreadsWorkerOptions, WorkerImplementation } from '../types/master'
|
|
19
19
|
|
package/src/worker/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-floating-promises */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
import isSomeObservable from 'is-observable'
|
|
3
|
+
import isSomeObservable from 'is-observable-2-1-0'
|
|
4
4
|
import { Observable, Subscription } from 'observable-fns'
|
|
5
5
|
|
|
6
6
|
import { deserialize, serialize } from '../common'
|
package/types/is-observable.d.ts
CHANGED