1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", { value: true });
|
4 | exports.createProcess = void 0;
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | var maybeReturnProcess = function () {
|
16 | if (typeof process !== 'undefined') {
|
17 | return process;
|
18 | }
|
19 | try {
|
20 | return require('process');
|
21 | }
|
22 | catch (_a) {
|
23 | return undefined;
|
24 | }
|
25 | };
|
26 | function createProcess() {
|
27 | var p = maybeReturnProcess() || {};
|
28 | if (!p.getuid)
|
29 | p.getuid = function () { return 0; };
|
30 | if (!p.getgid)
|
31 | p.getgid = function () { return 0; };
|
32 | if (!p.cwd)
|
33 | p.cwd = function () { return '/'; };
|
34 | if (!p.nextTick)
|
35 | p.nextTick = require('./setImmediate').default;
|
36 | if (!p.emitWarning)
|
37 | p.emitWarning = function (message, type) {
|
38 |
|
39 | console.warn("" + type + (type ? ': ' : '') + message);
|
40 | };
|
41 | if (!p.env)
|
42 | p.env = {};
|
43 | return p;
|
44 | }
|
45 | exports.createProcess = createProcess;
|
46 | exports.default = createProcess();
|