|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | "use strict";
|
|---|
| 2 | // Here we mock the global `process` variable in case we are not in Node's environment.
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", { value: true });
|
|---|
| 4 | exports.createProcess = void 0;
|
|---|
| 5 | /**
|
|---|
| 6 | * Looks to return a `process` object, if one is available.
|
|---|
| 7 | *
|
|---|
| 8 | * The global `process` is returned if defined;
|
|---|
| 9 | * otherwise `require('process')` is attempted.
|
|---|
| 10 | *
|
|---|
| 11 | * If that fails, `undefined` is returned.
|
|---|
| 12 | *
|
|---|
| 13 | * @return {IProcess | undefined}
|
|---|
| 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.cwd)
|
|---|
| 29 | p.cwd = function () { return '/'; };
|
|---|
| 30 | if (!p.nextTick)
|
|---|
| 31 | p.nextTick = require('./setImmediate').default;
|
|---|
| 32 | if (!p.emitWarning)
|
|---|
| 33 | p.emitWarning = function (message, type) {
|
|---|
| 34 | // tslint:disable-next-line:no-console
|
|---|
| 35 | console.warn("".concat(type).concat(type ? ': ' : '').concat(message));
|
|---|
| 36 | };
|
|---|
| 37 | if (!p.env)
|
|---|
| 38 | p.env = {};
|
|---|
| 39 | return p;
|
|---|
| 40 | }
|
|---|
| 41 | exports.createProcess = createProcess;
|
|---|
| 42 | exports.default = createProcess();
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.