UNPKG

2.02 kBJavaScriptView Raw
1"use strict";
2/*
3 * This file is only a stub to make './implementation' resolve to the right module.
4 */
5var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6 if (k2 === undefined) k2 = k;
7 Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
8}) : (function(o, m, k, k2) {
9 if (k2 === undefined) k2 = k;
10 o[k2] = m[k];
11}));
12var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
13 Object.defineProperty(o, "default", { enumerable: true, value: v });
14}) : function(o, v) {
15 o["default"] = v;
16});
17var __importStar = (this && this.__importStar) || function (mod) {
18 if (mod && mod.__esModule) return mod;
19 var result = {};
20 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
21 __setModuleDefault(result, mod);
22 return result;
23};
24Object.defineProperty(exports, "__esModule", { value: true });
25exports.isWorkerRuntime = exports.getWorkerImplementation = exports.defaultPoolSize = void 0;
26// We alias `src/master/implementation` to `src/master/implementation.browser` for web
27// browsers already in the package.json, so if get here, it's safe to pass-through the
28// node implementation
29const BrowserImplementation = __importStar(require("./implementation.browser"));
30const NodeImplementation = __importStar(require("./implementation.node"));
31const runningInNode = typeof process !== 'undefined' && process.arch !== 'browser' && 'pid' in process;
32const implementation = runningInNode ? NodeImplementation : BrowserImplementation;
33/** Default size of pools. Depending on the platform the value might vary from device to device. */
34exports.defaultPoolSize = implementation.defaultPoolSize;
35exports.getWorkerImplementation = implementation.getWorkerImplementation;
36/** Returns `true` if this code is currently running in a worker. */
37exports.isWorkerRuntime = implementation.isWorkerRuntime;