committed by
GitHub
parent
20d2b4f98d
commit
e4f3964f67
1
node_modules/is-core-module/.eslintrc
generated
vendored
1
node_modules/is-core-module/.eslintrc
generated
vendored
@ -9,6 +9,7 @@
|
||||
"files": "test/**",
|
||||
"rules": {
|
||||
"global-require": 0,
|
||||
"max-depth": 0,
|
||||
"max-lines-per-function": 0,
|
||||
"no-negated-condition": 0,
|
||||
},
|
||||
|
9
node_modules/is-core-module/CHANGELOG.md
generated
vendored
9
node_modules/is-core-module/CHANGELOG.md
generated
vendored
@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v2.9.0](https://github.com/inspect-js/is-core-module/compare/v2.8.1...v2.9.0) - 2022-04-19
|
||||
|
||||
### Commits
|
||||
|
||||
- [New] add `node:test`, in node 18+ [`f853eca`](https://github.com/inspect-js/is-core-module/commit/f853eca801d0a7d4e1dbb670f1b6d9837d9533c5)
|
||||
- [Tests] use `mock-property` [`03b3644`](https://github.com/inspect-js/is-core-module/commit/03b3644dff4417f4ba5a7d0aa0138f5f6b3e5c46)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`7c0e2d0`](https://github.com/inspect-js/is-core-module/commit/7c0e2d06ed2a89acf53abe2ab34d703ed5b03455)
|
||||
- [meta] simplify "exports" [`d6ed201`](https://github.com/inspect-js/is-core-module/commit/d6ed201eba7fbba0e59814a9050fc49a6e9878c8)
|
||||
|
||||
## [v2.8.1](https://github.com/inspect-js/is-core-module/compare/v2.8.0...v2.8.1) - 2022-01-05
|
||||
|
||||
### Commits
|
||||
|
1
node_modules/is-core-module/core.json
generated
vendored
1
node_modules/is-core-module/core.json
generated
vendored
@ -112,6 +112,7 @@
|
||||
"node:string_decoder": [">= 14.18 && < 15", ">= 16"],
|
||||
"sys": [">= 0.4 && < 0.7", ">= 0.8"],
|
||||
"node:sys": [">= 14.18 && < 15", ">= 16"],
|
||||
"node:test": ">= 18",
|
||||
"timers": true,
|
||||
"node:timers": [">= 14.18 && < 15", ">= 16"],
|
||||
"timers/promises": ">= 15",
|
||||
|
20
node_modules/is-core-module/package.json
generated
vendored
20
node_modules/is-core-module/package.json
generated
vendored
@ -1,16 +1,11 @@
|
||||
{
|
||||
"name": "is-core-module",
|
||||
"version": "2.8.1",
|
||||
"version": "2.9.0",
|
||||
"description": "Is this specifier a node.js core module?",
|
||||
"main": "index.js",
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": [
|
||||
{
|
||||
"default": "./index.js"
|
||||
},
|
||||
"./index.js"
|
||||
],
|
||||
".": "./index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"scripts": {
|
||||
@ -49,14 +44,15 @@
|
||||
"has": "^1.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^20.1.0",
|
||||
"aud": "^1.1.5",
|
||||
"auto-changelog": "^2.3.0",
|
||||
"eslint": "^8.6.0",
|
||||
"@ljharb/eslint-config": "^21.0.0",
|
||||
"aud": "^2.0.0",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"eslint": "=8.8.0",
|
||||
"mock-property": "^1.0.0",
|
||||
"nyc": "^10.3.2",
|
||||
"safe-publish-latest": "^2.0.0",
|
||||
"semver": "^6.3.0",
|
||||
"tape": "^5.4.0"
|
||||
"tape": "^5.5.3"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
|
65
node_modules/is-core-module/test/index.js
generated
vendored
65
node_modules/is-core-module/test/index.js
generated
vendored
@ -3,6 +3,8 @@
|
||||
var test = require('tape');
|
||||
var keys = require('object-keys');
|
||||
var semver = require('semver');
|
||||
var mockProperty = require('mock-property');
|
||||
|
||||
var isCore = require('../');
|
||||
var data = require('../core.json');
|
||||
|
||||
@ -51,16 +53,18 @@ test('core modules', function (t) {
|
||||
function () { require(mod); }, // eslint-disable-line no-loop-func
|
||||
'requiring ' + mod + ' does not throw'
|
||||
);
|
||||
if (supportsNodePrefix) {
|
||||
st.doesNotThrow(
|
||||
function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
|
||||
'requiring node:' + mod + ' does not throw'
|
||||
);
|
||||
} else {
|
||||
st['throws'](
|
||||
function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
|
||||
'requiring node:' + mod + ' throws'
|
||||
);
|
||||
if (mod.slice(0, 5) !== 'node:') {
|
||||
if (supportsNodePrefix) {
|
||||
st.doesNotThrow(
|
||||
function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
|
||||
'requiring node:' + mod + ' does not throw'
|
||||
);
|
||||
} else {
|
||||
st['throws'](
|
||||
function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
|
||||
'requiring node:' + mod + ' throws'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -79,6 +83,10 @@ test('core modules', function (t) {
|
||||
'v8/tools/tickprocessor',
|
||||
'v8/tools/profile'
|
||||
];
|
||||
// see https://github.com/nodejs/node/issues/42785
|
||||
if (semver.satisfies(process.version, '>= 18')) {
|
||||
libs = libs.concat('node:test');
|
||||
}
|
||||
for (var i = 0; i < libs.length; ++i) {
|
||||
var mod = libs[i];
|
||||
if (excludeList.indexOf(mod) === -1) {
|
||||
@ -87,16 +95,18 @@ test('core modules', function (t) {
|
||||
function () { require(mod); }, // eslint-disable-line no-loop-func
|
||||
'requiring ' + mod + ' does not throw'
|
||||
);
|
||||
if (supportsNodePrefix) {
|
||||
st.doesNotThrow(
|
||||
function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
|
||||
'requiring node:' + mod + ' does not throw'
|
||||
);
|
||||
} else {
|
||||
st['throws'](
|
||||
function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
|
||||
'requiring node:' + mod + ' throws'
|
||||
);
|
||||
if (mod.slice(0, 5) !== 'node:') {
|
||||
if (supportsNodePrefix) {
|
||||
st.doesNotThrow(
|
||||
function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
|
||||
'requiring node:' + mod + ' does not throw'
|
||||
);
|
||||
} else {
|
||||
st['throws'](
|
||||
function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
|
||||
'requiring node:' + mod + ' throws'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -105,18 +115,11 @@ test('core modules', function (t) {
|
||||
});
|
||||
|
||||
t.test('Object.prototype pollution', function (st) {
|
||||
/* eslint no-extend-native: 1 */
|
||||
var nonKey = 'not a core module';
|
||||
st.teardown(function () {
|
||||
delete Object.prototype.fs;
|
||||
delete Object.prototype.path;
|
||||
delete Object.prototype.http;
|
||||
delete Object.prototype[nonKey];
|
||||
});
|
||||
Object.prototype.fs = false;
|
||||
Object.prototype.path = '>= 999999999';
|
||||
Object.prototype.http = data.http;
|
||||
Object.prototype[nonKey] = true;
|
||||
st.teardown(mockProperty(Object.prototype, 'fs', { value: false }));
|
||||
st.teardown(mockProperty(Object.prototype, 'path', { value: '>= 999999999' }));
|
||||
st.teardown(mockProperty(Object.prototype, 'http', { value: data.http }));
|
||||
st.teardown(mockProperty(Object.prototype, nonKey, { value: true }));
|
||||
|
||||
st.equal(isCore('fs'), true, 'fs is a core module even if Object.prototype lies');
|
||||
st.equal(isCore('path'), true, 'path is a core module even if Object.prototype lies');
|
||||
|
Reference in New Issue
Block a user