source: frontend/node_modules/memfs/lib/process.js

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.
3Object.defineProperty(exports, "__esModule", { value: true });
4exports.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 */
15var 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};
26function 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}
41exports.createProcess = createProcess;
42exports.default = createProcess();
Note: See TracBrowser for help on using the repository browser.