Update checked-in dependencies
This commit is contained in:
parent
7fdbca3ba3
commit
357e0ceaa9
360 changed files with 25673 additions and 917 deletions
35
node_modules/is-node-process/README.md
generated
vendored
Normal file
35
node_modules/is-node-process/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
[](https://www.npmjs.com/package/is-node-process)
|
||||
|
||||
# `is-node-process`
|
||||
|
||||
Reliably determines if the code is running in Node.js
|
||||
|
||||
## Motivation
|
||||
|
||||
This library was created to provide a reliable way of determining a Node.js process, taking into account:
|
||||
|
||||
- Browser-like environments (JSDOM);
|
||||
- Electron renderer process;
|
||||
- React Native runtime.
|
||||
|
||||
### Why relying on `window` is a bad idea
|
||||
|
||||
There are environments (i.e. JSDOM) that polyfill the global `window` object and some of its API for the sake of emulating browser-like behaviors, while still remaining a Node.js process.
|
||||
|
||||
### Why relying on `process` is a bad idea
|
||||
|
||||
Electron injects a global `process` object in the browser runtime when run with the `nodeIntegration: true` option.
|
||||
|
||||
## Getting started
|
||||
|
||||
```sh
|
||||
$ npm install is-node-process
|
||||
# or
|
||||
$ yarn add is-node-process
|
||||
```
|
||||
|
||||
```js
|
||||
// any/code.js
|
||||
const { isNodeProcess } = require('is-node-process')
|
||||
isNodeProcess() // true/false
|
||||
```
|
||||
6
node_modules/is-node-process/lib/index.d.ts
generated
vendored
Normal file
6
node_modules/is-node-process/lib/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
* Determines if the current process is a Node.js process.
|
||||
*/
|
||||
declare function isNodeProcess(): boolean;
|
||||
|
||||
export { isNodeProcess };
|
||||
42
node_modules/is-node-process/lib/index.js
generated
vendored
Normal file
42
node_modules/is-node-process/lib/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/index.ts
|
||||
var src_exports = {};
|
||||
__export(src_exports, {
|
||||
isNodeProcess: () => isNodeProcess
|
||||
});
|
||||
module.exports = __toCommonJS(src_exports);
|
||||
function isNodeProcess() {
|
||||
if (typeof navigator !== "undefined" && navigator.product === "ReactNative") {
|
||||
return true;
|
||||
}
|
||||
if (typeof process !== "undefined") {
|
||||
const type = process.type;
|
||||
if (type === "renderer" || type === "worker") {
|
||||
return false;
|
||||
}
|
||||
return !!(process.versions && process.versions.node);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
isNodeProcess
|
||||
});
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/is-node-process/lib/index.js.map
generated
vendored
Normal file
1
node_modules/is-node-process/lib/index.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * Determines if the current process is a Node.js process.\n */\nexport function isNodeProcess(): boolean {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return true\n }\n\n if (typeof process !== 'undefined') {\n // Electron (https://www.electronjs.org/docs/latest/api/process#processtype-readonly)\n const type = (process as any).type\n if (type === 'renderer' || type === 'worker') {\n return false\n }\n\n\n return !!(\n process.versions &&\n process.versions.node\n )\n }\n\n return false\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,SAAS,gBAAyB;AACvC,MAAI,OAAO,cAAc,eAAe,UAAU,YAAY,eAAe;AAC3E,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,YAAY,aAAa;AAElC,UAAM,OAAQ,QAAgB;AAC9B,QAAI,SAAS,cAAc,SAAS,UAAU;AAC5C,aAAO;AAAA,IACT;AAGA,WAAO,CAAC,EACN,QAAQ,YACR,QAAQ,SAAS;AAAA,EAErB;AAEA,SAAO;AACT;","names":[]}
|
||||
18
node_modules/is-node-process/lib/index.mjs
generated
vendored
Normal file
18
node_modules/is-node-process/lib/index.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// src/index.ts
|
||||
function isNodeProcess() {
|
||||
if (typeof navigator !== "undefined" && navigator.product === "ReactNative") {
|
||||
return true;
|
||||
}
|
||||
if (typeof process !== "undefined") {
|
||||
const type = process.type;
|
||||
if (type === "renderer" || type === "worker") {
|
||||
return false;
|
||||
}
|
||||
return !!(process.versions && process.versions.node);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
export {
|
||||
isNodeProcess
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
node_modules/is-node-process/lib/index.mjs.map
generated
vendored
Normal file
1
node_modules/is-node-process/lib/index.mjs.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * Determines if the current process is a Node.js process.\n */\nexport function isNodeProcess(): boolean {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return true\n }\n\n if (typeof process !== 'undefined') {\n // Electron (https://www.electronjs.org/docs/latest/api/process#processtype-readonly)\n const type = (process as any).type\n if (type === 'renderer' || type === 'worker') {\n return false\n }\n\n\n return !!(\n process.versions &&\n process.versions.node\n )\n }\n\n return false\n}\n"],"mappings":";AAGO,SAAS,gBAAyB;AACvC,MAAI,OAAO,cAAc,eAAe,UAAU,YAAY,eAAe;AAC3E,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,YAAY,aAAa;AAElC,UAAM,OAAQ,QAAgB;AAC9B,QAAI,SAAS,cAAc,SAAS,UAAU;AAC5C,aAAO;AAAA,IACT;AAGA,WAAO,CAAC,EACN,QAAQ,YACR,QAAQ,SAAS;AAAA,EAErB;AAEA,SAAO;AACT;","names":[]}
|
||||
43
node_modules/is-node-process/package.json
generated
vendored
Normal file
43
node_modules/is-node-process/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"name": "is-node-process",
|
||||
"description": "Reliably determines if the code is running in Node.js",
|
||||
"version": "1.2.0",
|
||||
"main": "lib/index.js",
|
||||
"module": "lib/index.mjs",
|
||||
"typings": "lib/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./lib/index.d.ts",
|
||||
"require": "./lib/index.js",
|
||||
"default": "./lib/index.mjs"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mswjs/is-node-process"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@ossjs/release": "^0.5.1",
|
||||
"@types/jest": "^27.0.0",
|
||||
"@types/node": "^18.14.0",
|
||||
"electron": "^19.0.6",
|
||||
"jest": "^27.0.6",
|
||||
"playwright": "^1.22.2",
|
||||
"spectron": "^15.0.0",
|
||||
"ts-jest": "^27.0.3",
|
||||
"tsup": "^6.2.3",
|
||||
"typescript": "^4.3.5"
|
||||
},
|
||||
"scripts": {
|
||||
"browser": "open test/browser.html",
|
||||
"electron": "electron test/fixtures/electron.js",
|
||||
"test": "jest --testPathIgnorePatterns electron.test.ts",
|
||||
"test:react-native": "cd test/fixtures/react-native && pnpm test",
|
||||
"build": "tsup",
|
||||
"release": "release publish"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue