@socketsecurity/cli-with-sentry 1.0.63 → 1.0.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +180 -174
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +18 -11
- package/dist/constants.js.map +1 -1
- package/dist/instrument-with-sentry.js +4 -9
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/shadow-npm-inject.js +8 -11
- package/dist/shadow-npm-inject.js.map +1 -1
- package/dist/types/commands/config/cmd-config-auto.d.mts.map +1 -1
- package/dist/types/commands/config/cmd-config-get.d.mts.map +1 -1
- package/dist/types/commands/config/cmd-config-set.d.mts.map +1 -1
- package/dist/types/commands/config/cmd-config-unset.d.mts.map +1 -1
- package/dist/types/commands/config/discover-config-value.d.mts.map +1 -1
- package/dist/types/commands/config/output-config-list.d.mts.map +1 -1
- package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts +1 -1
- package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts.map +1 -1
- package/dist/types/commands/manifest/output-requirements.d.mts +1 -1
- package/dist/types/commands/manifest/output-requirements.d.mts.map +1 -1
- package/dist/types/commands/organization/output-security-policy.d.mts.map +1 -1
- package/dist/types/constants.d.mts.map +1 -1
- package/dist/types/shadow/npm/arborist-helpers.d.mts +1 -1
- package/dist/types/shadow/npm/arborist-helpers.d.mts.map +1 -1
- package/dist/types/utils/alerts-map.d.mts +1 -1
- package/dist/types/utils/alerts-map.d.mts.map +1 -1
- package/dist/types/utils/config.d.mts +4 -2
- package/dist/types/utils/config.d.mts.map +1 -1
- package/dist/types/utils/fs.d.mts +3 -1
- package/dist/types/utils/fs.d.mts.map +1 -1
- package/dist/types/utils/glob.d.mts.map +1 -1
- package/dist/types/utils/socket-package-alert.d.mts.map +1 -1
- package/dist/utils.js +59 -46
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +9 -10
- package/external/@socketsecurity/registry/extensions.json +2 -2
- package/external/@socketsecurity/registry/external/@socketregistry/yocto-spinner.js +20 -11
- package/external/@socketsecurity/registry/external/picomatch.js +1 -0
- package/external/@socketsecurity/registry/lib/constants/env.js +6 -2
- package/external/@socketsecurity/registry/lib/constants/ipc-promise.js +4 -2
- package/external/@socketsecurity/registry/lib/constants/maintained-node-versions.js +3 -1
- package/external/@socketsecurity/registry/lib/constants/node-harden-flags.js +3 -1
- package/external/@socketsecurity/registry/lib/constants/node-no-warnings-flags.js +3 -1
- package/external/@socketsecurity/registry/lib/constants/package-extensions.js +3 -1
- package/external/@socketsecurity/registry/lib/fs.js +3 -1
- package/external/@socketsecurity/registry/lib/logger.js +3 -2
- package/external/@socketsecurity/registry/lib/objects.js +40 -29
- package/external/@socketsecurity/registry/lib/packages.js +14 -11
- package/external/@socketsecurity/registry/lib/spawn.js +2 -2
- package/external/@socketsecurity/registry/lib/spinner.js +12 -18
- package/external/@socketsecurity/registry/manifest.json +17 -17
- package/package.json +10 -10
package/dist/vendor.js
CHANGED
|
@@ -51,7 +51,6 @@ var require$$0$r = require('node:http2');
|
|
|
51
51
|
var require$$1$d = require('node:v8');
|
|
52
52
|
var require$$2$7 = require$$6$3;
|
|
53
53
|
|
|
54
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
55
54
|
function camelCase$1(str) {
|
|
56
55
|
const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
|
|
57
56
|
if (!isCamelCase) {
|
|
@@ -35519,7 +35518,7 @@ var isInteractiveExports = /*@__PURE__*/ requireIsInteractive();
|
|
|
35519
35518
|
var dist$e = {};
|
|
35520
35519
|
|
|
35521
35520
|
var name$2 = "@socketsecurity/sdk";
|
|
35522
|
-
var version$5 = "1.4.
|
|
35521
|
+
var version$5 = "1.4.57";
|
|
35523
35522
|
var license = "MIT";
|
|
35524
35523
|
var description = "SDK for the Socket API client";
|
|
35525
35524
|
var author = {
|
|
@@ -35602,11 +35601,11 @@ var scripts = {
|
|
|
35602
35601
|
"update:deps": "npx --yes npm-check-updates"
|
|
35603
35602
|
};
|
|
35604
35603
|
var dependencies = {
|
|
35605
|
-
"@socketsecurity/registry": "1.0.
|
|
35604
|
+
"@socketsecurity/registry": "1.0.239"
|
|
35606
35605
|
};
|
|
35607
35606
|
var devDependencies = {
|
|
35608
|
-
"@biomejs/biome": "2.1.
|
|
35609
|
-
"@dotenvx/dotenvx": "1.
|
|
35607
|
+
"@biomejs/biome": "2.1.2",
|
|
35608
|
+
"@dotenvx/dotenvx": "1.48.0",
|
|
35610
35609
|
"@eslint/compat": "1.3.1",
|
|
35611
35610
|
"@eslint/js": "9.31.0",
|
|
35612
35611
|
"@types/node": "24.0.14",
|
|
@@ -35616,7 +35615,7 @@ var devDependencies = {
|
|
|
35616
35615
|
eslint: "9.31.0",
|
|
35617
35616
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
35618
35617
|
"eslint-plugin-import-x": "4.16.1",
|
|
35619
|
-
"eslint-plugin-jsdoc": "51.4.
|
|
35618
|
+
"eslint-plugin-jsdoc": "51.4.1",
|
|
35620
35619
|
"eslint-plugin-n": "17.21.0",
|
|
35621
35620
|
"eslint-plugin-sort-destructure-keys": "2.0.0",
|
|
35622
35621
|
"eslint-plugin-unicorn": "56.0.1",
|
|
@@ -35628,7 +35627,7 @@ var devDependencies = {
|
|
|
35628
35627
|
nock: "14.0.5",
|
|
35629
35628
|
"npm-run-all2": "8.0.4",
|
|
35630
35629
|
"openapi-typescript": "6.7.6",
|
|
35631
|
-
oxlint: "1.
|
|
35630
|
+
oxlint: "1.7.0",
|
|
35632
35631
|
"type-coverage": "2.29.7",
|
|
35633
35632
|
typescript: "~5.8.3",
|
|
35634
35633
|
"typescript-eslint": "8.37.0",
|
|
@@ -41065,7 +41064,7 @@ async function defaultBrowser() {
|
|
|
41065
41064
|
const execFile = require$$1$6.promisify(childProcess.execFile);
|
|
41066
41065
|
|
|
41067
41066
|
// Path to included `xdg-open`.
|
|
41068
|
-
const __dirname$1 = path$2.dirname(require$$0$7.fileURLToPath((
|
|
41067
|
+
const __dirname$1 = path$2.dirname(require$$0$7.fileURLToPath(require('node:url').pathToFileURL(__filename).href));
|
|
41069
41068
|
const localXdgOpenPath = path$2.join(__dirname$1, 'xdg-open');
|
|
41070
41069
|
const {
|
|
41071
41070
|
platform,
|
|
@@ -166554,7 +166553,7 @@ if (nodeVersion) {
|
|
|
166554
166553
|
}
|
|
166555
166554
|
// Creates a yargs-parser instance using Node.js standard libraries:
|
|
166556
166555
|
const env = process ? process.env : {};
|
|
166557
|
-
const require$1 = require$$5$3.createRequire ? require$$5$3.createRequire((
|
|
166556
|
+
const require$1 = require$$5$3.createRequire ? require$$5$3.createRequire(require('node:url').pathToFileURL(__filename).href) : undefined;
|
|
166558
166557
|
const parser = new YargsParser({
|
|
166559
166558
|
cwd: process.cwd,
|
|
166560
166559
|
env: () => {
|
|
@@ -168581,5 +168580,5 @@ exports.terminalLinkExports = terminalLinkExports;
|
|
|
168581
168580
|
exports.updater = updater$1;
|
|
168582
168581
|
exports.yargsParser = yargsParser;
|
|
168583
168582
|
exports.yoctocolorsCjsExports = yoctocolorsCjsExports;
|
|
168584
|
-
//# debugId=
|
|
168583
|
+
//# debugId=17127725-c333-4fdd-a9b0-2ef9149d90d8
|
|
168585
168584
|
//# sourceMappingURL=vendor.js.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"pkg:npm/%40socketregistry/packageurl-js@latest",
|
|
5
5
|
{
|
|
6
6
|
"categories": ["levelup"],
|
|
7
|
-
"engines": { "node": ">=18
|
|
7
|
+
"engines": { "node": ">=18" },
|
|
8
8
|
"interop": ["cjs"],
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"name": "@socketregistry/packageurl-js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"pkg:npm/shell-quote@latest",
|
|
17
17
|
{
|
|
18
18
|
"categories": ["tuneup"],
|
|
19
|
-
"engines": { "node": ">=18
|
|
19
|
+
"engines": { "node": ">=18" },
|
|
20
20
|
"interop": ["cjs"],
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"name": "shell-quote",
|
|
@@ -140,7 +140,7 @@ function requireYoctoSpinner() {
|
|
|
140
140
|
function getYoctocolors() {
|
|
141
141
|
if (_yoctocolors === undefined) {
|
|
142
142
|
_yoctocolors = {
|
|
143
|
-
.../*@__PURE__*/ requireYoctocolorsCjs()
|
|
143
|
+
.../*@__PURE__*/ /*@__PURE__*/ requireYoctocolorsCjs()
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
return _yoctocolors
|
|
@@ -195,6 +195,9 @@ function requireYoctoSpinner() {
|
|
|
195
195
|
}
|
|
196
196
|
return _stripVTControlCharacters(string)
|
|
197
197
|
}
|
|
198
|
+
function normalizeText(value) {
|
|
199
|
+
return typeof value === 'string' ? value.trimStart() : ''
|
|
200
|
+
}
|
|
198
201
|
class YoctoSpinner {
|
|
199
202
|
#color
|
|
200
203
|
#currentFrame = -1
|
|
@@ -216,9 +219,11 @@ function requireYoctoSpinner() {
|
|
|
216
219
|
}
|
|
217
220
|
const spinner = opts.spinner ?? getDefaultSpinner()
|
|
218
221
|
const stream = opts.stream ?? getProcess().stderr
|
|
219
|
-
|
|
222
|
+
const { frames } = spinner
|
|
223
|
+
this.#frames =
|
|
224
|
+
(frames?.length ?? 0) < 1 ? [''] : frames.map(f => f.trim())
|
|
220
225
|
this.#interval = spinner.interval
|
|
221
|
-
this.#text = options.text
|
|
226
|
+
this.#text = normalizeText(options.text)
|
|
222
227
|
this.#stream = stream ?? process.stderr
|
|
223
228
|
this.#color = options.color ?? 'cyan'
|
|
224
229
|
this.#isInteractive = !!stream.isTTY && isProcessInteractive()
|
|
@@ -228,7 +233,6 @@ function requireYoctoSpinner() {
|
|
|
228
233
|
if (this.isSpinning) {
|
|
229
234
|
this.stop()
|
|
230
235
|
}
|
|
231
|
-
|
|
232
236
|
// SIGINT: 128 + 2
|
|
233
237
|
// SIGTERM: 128 + 15
|
|
234
238
|
const exitCode =
|
|
@@ -264,7 +268,7 @@ function requireYoctoSpinner() {
|
|
|
264
268
|
const colors = getYoctocolors()
|
|
265
269
|
const applyColor = colors[this.#color] ?? colors.cyan
|
|
266
270
|
const frame = this.#frames[this.#currentFrame]
|
|
267
|
-
let string = `${applyColor(frame)} ${this.#text}`
|
|
271
|
+
let string = `${frame ? `${applyColor(frame)} ` : ''}${this.#text}`
|
|
268
272
|
if (string) {
|
|
269
273
|
if (this.#indention.length) {
|
|
270
274
|
string = `${this.#indention}${string}`
|
|
@@ -273,8 +277,12 @@ function requireYoctoSpinner() {
|
|
|
273
277
|
string += '\n'
|
|
274
278
|
}
|
|
275
279
|
}
|
|
276
|
-
this
|
|
277
|
-
|
|
280
|
+
if (this.#isInteractive) {
|
|
281
|
+
this.clear()
|
|
282
|
+
}
|
|
283
|
+
if (string) {
|
|
284
|
+
this.#write(string)
|
|
285
|
+
}
|
|
278
286
|
if (this.#isInteractive) {
|
|
279
287
|
this.#lines = this.#lineCount(string)
|
|
280
288
|
}
|
|
@@ -313,7 +321,7 @@ function requireYoctoSpinner() {
|
|
|
313
321
|
return this.#text
|
|
314
322
|
}
|
|
315
323
|
set text(value) {
|
|
316
|
-
this.#text = value
|
|
324
|
+
this.#text = normalizeText(value)
|
|
317
325
|
this.#render()
|
|
318
326
|
}
|
|
319
327
|
clear() {
|
|
@@ -321,7 +329,7 @@ function requireYoctoSpinner() {
|
|
|
321
329
|
return this
|
|
322
330
|
}
|
|
323
331
|
this.#stream.cursorTo(0)
|
|
324
|
-
for (let index = 0; index < this.#lines; index
|
|
332
|
+
for (let index = 0; index < this.#lines; index += 1) {
|
|
325
333
|
if (index > 0) {
|
|
326
334
|
this.#stream.moveCursor(0, -1)
|
|
327
335
|
}
|
|
@@ -349,8 +357,9 @@ function requireYoctoSpinner() {
|
|
|
349
357
|
return this
|
|
350
358
|
}
|
|
351
359
|
start(text) {
|
|
352
|
-
|
|
353
|
-
|
|
360
|
+
const normalized = normalizeText(text)
|
|
361
|
+
if (normalized) {
|
|
362
|
+
this.#text = normalized
|
|
354
363
|
}
|
|
355
364
|
if (this.isSpinning) {
|
|
356
365
|
return this
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const { freeze: ObjectFreeze, hasOwn: ObjectHasOwn } = Object
|
|
4
|
+
|
|
3
5
|
const { envAsBoolean, envAsString } = /*@__PURE__*/ require('../env')
|
|
4
6
|
|
|
5
7
|
const { env } = process
|
|
6
8
|
|
|
7
9
|
const DEBUG = envAsString(env.DEBUG)
|
|
8
10
|
|
|
9
|
-
module.exports =
|
|
11
|
+
module.exports = ObjectFreeze({
|
|
10
12
|
__proto__: null,
|
|
11
13
|
// CI is always set to 'true' in a GitHub action.
|
|
12
14
|
// https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables
|
|
13
|
-
CI
|
|
15
|
+
// Libraries like yocto-colors check for CI not by value but my existence,
|
|
16
|
+
// e.g. `'CI' in process.env`.
|
|
17
|
+
CI: ObjectHasOwn(env, 'CI'),
|
|
14
18
|
// Flag set to enable debug logging.
|
|
15
19
|
DEBUG,
|
|
16
20
|
// Variable to set the debug log level
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const { assign: ObjectAssign, freeze: ObjectFreeze } = Object
|
|
4
|
+
|
|
3
5
|
module.exports = new Promise(
|
|
4
6
|
// The Promise executor is immediately executed.
|
|
5
7
|
resolve => {
|
|
@@ -25,8 +27,8 @@ module.exports = new Promise(
|
|
|
25
27
|
...rawData
|
|
26
28
|
}
|
|
27
29
|
const target = /*@__PURE__*/ require('./ipc-target')
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
ObjectAssign(target, source)
|
|
31
|
+
ObjectFreeze(target)
|
|
30
32
|
// The handler of a Proxy is mutable after proxy instantiation.
|
|
31
33
|
// We delete the traps to defer to native behavior.
|
|
32
34
|
const handler = /*@__PURE__*/ require('./ipc-handler')
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const { freeze: ObjectFreeze } = Object
|
|
4
|
+
|
|
3
5
|
// Under the hood browserlist uses the node-releases package which is out of date:
|
|
4
6
|
// https://github.com/chicoxyzzy/node-releases/issues/37
|
|
5
7
|
//
|
|
@@ -35,7 +37,7 @@ const previous = semver.maxSatisfying(
|
|
|
35
37
|
)
|
|
36
38
|
const last = semver.lt(manualLast, queryLast) ? manualLast : queryLast
|
|
37
39
|
|
|
38
|
-
module.exports =
|
|
40
|
+
module.exports = ObjectFreeze(
|
|
39
41
|
Object.assign([last, previous, current, next], {
|
|
40
42
|
last,
|
|
41
43
|
previous,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const { freeze: ObjectFreeze } = Object
|
|
4
|
+
|
|
3
5
|
const SUPPORTS_NODE_DISABLE_WARNING_FLAG = /*@__PURE__*/ require('./supports-node-disable-warning-flag')
|
|
4
6
|
|
|
5
|
-
module.exports =
|
|
7
|
+
module.exports = ObjectFreeze(
|
|
6
8
|
SUPPORTS_NODE_DISABLE_WARNING_FLAG
|
|
7
9
|
? ['--disable-warning', 'ExperimentalWarning']
|
|
8
10
|
: ['--no-warnings']
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const { freeze: ObjectFreeze } = Object
|
|
4
|
+
|
|
3
5
|
const yarnPkgExtensions = /*@__PURE__*/ require('../../external/@yarnpkg/extensions')
|
|
4
6
|
|
|
5
|
-
module.exports =
|
|
7
|
+
module.exports = ObjectFreeze(
|
|
6
8
|
[
|
|
7
9
|
yarnPkgExtensions.packageExtensions,
|
|
8
10
|
[
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const { freeze: ObjectFreeze } = Object
|
|
4
|
+
|
|
3
5
|
const { getGlobMatcher } = /*@__PURE__*/ require('./globs')
|
|
4
6
|
const { naturalCompare } = /*@__PURE__*/ require('./sorts')
|
|
5
7
|
const { stripBom } = /*@__PURE__*/ require('./strings')
|
|
6
8
|
|
|
7
|
-
const defaultRemoveOptions =
|
|
9
|
+
const defaultRemoveOptions = ObjectFreeze({
|
|
8
10
|
__proto__: null,
|
|
9
11
|
force: true,
|
|
10
12
|
maxRetries: 3,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const globalConsole = console
|
|
4
|
+
const { assign: ObjectAssign, freeze: ObjectFreeze } = Object
|
|
4
5
|
const { apply: ReflectApply, construct: ReflectConstruct } = Reflect
|
|
5
6
|
|
|
6
7
|
const { applyLinePrefix, isBlankString } = /*@__PURE__*/ require('./strings')
|
|
@@ -33,13 +34,13 @@ const LOG_SYMBOLS = /*@__PURE__*/ (() => {
|
|
|
33
34
|
const supported =
|
|
34
35
|
/*@__PURE__*/ require('../external/@socketregistry/is-unicode-supported')()
|
|
35
36
|
const colors = getYoctocolors()
|
|
36
|
-
|
|
37
|
+
ObjectAssign(target, {
|
|
37
38
|
fail: colors.red(supported ? '✖' : '×'),
|
|
38
39
|
info: colors.blue(supported ? 'ℹ' : 'i'),
|
|
39
40
|
success: colors.green(supported ? '✔' : '√'),
|
|
40
41
|
warn: colors.yellow(supported ? '⚠' : '‼')
|
|
41
42
|
})
|
|
42
|
-
|
|
43
|
+
ObjectFreeze(target)
|
|
43
44
|
// The handler of a Proxy is mutable after proxy instantiation.
|
|
44
45
|
// We delete the traps to defer to native behavior.
|
|
45
46
|
for (const trapName in handler) {
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const { isArray: ArrayIsArray } = Array
|
|
4
|
+
const {
|
|
5
|
+
defineProperties: ObjectDefineProperties,
|
|
6
|
+
freeze: ObjectFreeze,
|
|
7
|
+
fromEntries: ObjectFromEntries,
|
|
8
|
+
getOwnPropertyDescriptors: ObjectGetOwnPropertyDescriptors,
|
|
9
|
+
getOwnPropertyNames: ObjectGetOwnPropertyNames,
|
|
10
|
+
hasOwn: ObjectHasOwn,
|
|
11
|
+
setPrototypeOf: ObjectSetPrototypeOf
|
|
12
|
+
} = Object
|
|
3
13
|
const { __defineGetter__ } = Object.prototype
|
|
14
|
+
const { ownKeys: ReflectOwnKeys } = Reflect
|
|
4
15
|
|
|
5
16
|
/*@__NO_SIDE_EFFECTS__*/
|
|
6
17
|
function createLazyGetter(name, getter, stats) {
|
|
@@ -22,39 +33,39 @@ function createLazyGetter(name, getter, stats) {
|
|
|
22
33
|
/*@__NO_SIDE_EFFECTS__*/
|
|
23
34
|
function createConstantsObject(props, options_) {
|
|
24
35
|
const options = { __proto__: null, ...options_ }
|
|
25
|
-
const attributes =
|
|
36
|
+
const attributes = ObjectFreeze({
|
|
26
37
|
__proto__: null,
|
|
27
38
|
getters: options.getters
|
|
28
|
-
?
|
|
29
|
-
|
|
39
|
+
? ObjectFreeze(
|
|
40
|
+
ObjectSetPrototypeOf(toSortedObject(options.getters), null)
|
|
30
41
|
)
|
|
31
42
|
: undefined,
|
|
32
43
|
internals: options.internals
|
|
33
|
-
?
|
|
34
|
-
|
|
44
|
+
? ObjectFreeze(
|
|
45
|
+
ObjectSetPrototypeOf(toSortedObject(options.internals), null)
|
|
35
46
|
)
|
|
36
47
|
: undefined,
|
|
37
48
|
mixin: options.mixin
|
|
38
|
-
?
|
|
39
|
-
|
|
49
|
+
? ObjectFreeze(
|
|
50
|
+
ObjectDefineProperties(
|
|
40
51
|
{ __proto__: null },
|
|
41
|
-
|
|
52
|
+
ObjectGetOwnPropertyDescriptors(options.mixin)
|
|
42
53
|
)
|
|
43
54
|
)
|
|
44
55
|
: undefined,
|
|
45
56
|
props: props
|
|
46
|
-
?
|
|
57
|
+
? ObjectFreeze(ObjectSetPrototypeOf(toSortedObject(props), null))
|
|
47
58
|
: undefined
|
|
48
59
|
})
|
|
49
60
|
const kInternalsSymbol = /*@__PURE__*/ require('./constants/k-internals-symbol')
|
|
50
|
-
const lazyGetterStats =
|
|
61
|
+
const lazyGetterStats = ObjectFreeze({
|
|
51
62
|
__proto__: null,
|
|
52
63
|
initialized: new Set()
|
|
53
64
|
})
|
|
54
65
|
const object = defineLazyGetters(
|
|
55
66
|
{
|
|
56
67
|
__proto__: null,
|
|
57
|
-
[kInternalsSymbol]:
|
|
68
|
+
[kInternalsSymbol]: ObjectFreeze({
|
|
58
69
|
__proto__: null,
|
|
59
70
|
get attributes() {
|
|
60
71
|
return attributes
|
|
@@ -71,16 +82,16 @@ function createConstantsObject(props, options_) {
|
|
|
71
82
|
lazyGetterStats
|
|
72
83
|
)
|
|
73
84
|
if (attributes.mixin) {
|
|
74
|
-
|
|
85
|
+
ObjectDefineProperties(
|
|
75
86
|
object,
|
|
76
87
|
toSortedObjectFromEntries(
|
|
77
|
-
objectEntries(
|
|
78
|
-
|
|
79
|
-
)
|
|
88
|
+
objectEntries(ObjectGetOwnPropertyDescriptors(attributes.mixin)).filter(
|
|
89
|
+
p => !ObjectHasOwn(object, p[0])
|
|
90
|
+
)
|
|
80
91
|
)
|
|
81
92
|
)
|
|
82
93
|
}
|
|
83
|
-
return
|
|
94
|
+
return ObjectFreeze(object)
|
|
84
95
|
}
|
|
85
96
|
|
|
86
97
|
/*@__NO_SIDE_EFFECTS__*/
|
|
@@ -97,7 +108,7 @@ function defineLazyGetter(object, propKey, getter, stats) {
|
|
|
97
108
|
/*@__NO_SIDE_EFFECTS__*/
|
|
98
109
|
function defineLazyGetters(object, getterDefObj, stats) {
|
|
99
110
|
if (getterDefObj !== null && typeof getterDefObj === 'object') {
|
|
100
|
-
const keys =
|
|
111
|
+
const keys = ReflectOwnKeys(getterDefObj)
|
|
101
112
|
for (let i = 0, { length } = keys; i < length; i += 1) {
|
|
102
113
|
const key = keys[i]
|
|
103
114
|
defineLazyGetter(
|
|
@@ -115,7 +126,7 @@ function getOwnPropertyValues(obj) {
|
|
|
115
126
|
if (obj === null || obj === undefined) {
|
|
116
127
|
return []
|
|
117
128
|
}
|
|
118
|
-
const keys =
|
|
129
|
+
const keys = ObjectGetOwnPropertyNames(obj)
|
|
119
130
|
const { length } = keys
|
|
120
131
|
const values = Array(length)
|
|
121
132
|
for (let i = 0; i < length; i += 1) {
|
|
@@ -130,7 +141,7 @@ function hasKeys(obj) {
|
|
|
130
141
|
return false
|
|
131
142
|
}
|
|
132
143
|
for (const key in obj) {
|
|
133
|
-
if (
|
|
144
|
+
if (ObjectHasOwn(obj, key)) {
|
|
134
145
|
return true
|
|
135
146
|
}
|
|
136
147
|
}
|
|
@@ -142,7 +153,7 @@ function hasOwn(obj, propKey) {
|
|
|
142
153
|
if (obj === null || obj === undefined) {
|
|
143
154
|
return false
|
|
144
155
|
}
|
|
145
|
-
return
|
|
156
|
+
return ObjectHasOwn(obj, propKey)
|
|
146
157
|
}
|
|
147
158
|
|
|
148
159
|
/*@__NO_SIDE_EFFECTS__*/
|
|
@@ -152,7 +163,7 @@ function isObject(value) {
|
|
|
152
163
|
|
|
153
164
|
/*@__NO_SIDE_EFFECTS__*/
|
|
154
165
|
function isObjectObject(value) {
|
|
155
|
-
return value !== null && typeof value === 'object' && !
|
|
166
|
+
return value !== null && typeof value === 'object' && !ArrayIsArray(value)
|
|
156
167
|
}
|
|
157
168
|
|
|
158
169
|
/*@__NO_SIDE_EFFECTS__*/
|
|
@@ -160,7 +171,7 @@ function objectEntries(obj) {
|
|
|
160
171
|
if (obj === null || obj === undefined) {
|
|
161
172
|
return []
|
|
162
173
|
}
|
|
163
|
-
const keys =
|
|
174
|
+
const keys = ReflectOwnKeys(obj)
|
|
164
175
|
const { length } = keys
|
|
165
176
|
const entries = Array(length)
|
|
166
177
|
for (let i = 0; i < length; i += 1) {
|
|
@@ -184,8 +195,8 @@ function merge(target, source) {
|
|
|
184
195
|
throw new Error('Detected infinite loop in object crawl of merge')
|
|
185
196
|
}
|
|
186
197
|
const { 0: currentTarget, 1: currentSource } = queue[pos++]
|
|
187
|
-
const isSourceArray =
|
|
188
|
-
if (
|
|
198
|
+
const isSourceArray = ArrayIsArray(currentSource)
|
|
199
|
+
if (ArrayIsArray(currentTarget)) {
|
|
189
200
|
if (isSourceArray) {
|
|
190
201
|
const seen = new Set(currentTarget)
|
|
191
202
|
for (let i = 0, { length } = currentSource; i < length; i += 1) {
|
|
@@ -201,13 +212,13 @@ function merge(target, source) {
|
|
|
201
212
|
if (isSourceArray) {
|
|
202
213
|
continue
|
|
203
214
|
}
|
|
204
|
-
const keys =
|
|
215
|
+
const keys = ReflectOwnKeys(currentSource)
|
|
205
216
|
for (let i = 0, { length } = keys; i < length; i += 1) {
|
|
206
217
|
const key = keys[i]
|
|
207
218
|
const srcVal = currentSource[key]
|
|
208
219
|
const targetVal = currentTarget[key]
|
|
209
|
-
if (
|
|
210
|
-
if (
|
|
220
|
+
if (ArrayIsArray(srcVal)) {
|
|
221
|
+
if (ArrayIsArray(targetVal)) {
|
|
211
222
|
const seen = new Set(targetVal)
|
|
212
223
|
for (let i = 0, { length } = srcVal; i < length; i += 1) {
|
|
213
224
|
const item = srcVal[i]
|
|
@@ -220,7 +231,7 @@ function merge(target, source) {
|
|
|
220
231
|
currentTarget[key] = srcVal
|
|
221
232
|
}
|
|
222
233
|
} else if (isObject(srcVal)) {
|
|
223
|
-
if (isObject(targetVal) && !
|
|
234
|
+
if (isObject(targetVal) && !ArrayIsArray(targetVal)) {
|
|
224
235
|
queue[queueLength++] = [targetVal, srcVal]
|
|
225
236
|
} else {
|
|
226
237
|
currentTarget[key] = srcVal
|
|
@@ -255,7 +266,7 @@ function toSortedObjectFromEntries(entries) {
|
|
|
255
266
|
}
|
|
256
267
|
}
|
|
257
268
|
const { localeCompare } = /*@__PURE__*/ require('./sorts')
|
|
258
|
-
return
|
|
269
|
+
return ObjectFromEntries([
|
|
259
270
|
// The String constructor is safe to use with symbols.
|
|
260
271
|
...symbolEntries.sort((a, b) => localeCompare(String(a[0]), String(b[0]))),
|
|
261
272
|
...stringEntries.sort((a, b) => localeCompare(a[0], b[0]))
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const { isArray: ArrayIsArray } = Array
|
|
4
|
+
const { hasOwn: ObjectHasOwn } = Object
|
|
5
|
+
|
|
3
6
|
const abortSignal = /*@__PURE__*/ require('./constants/abort-signal')
|
|
4
7
|
const copyLeftLicenses = /*@__PURE__*/ require('./constants/copy-left-licenses')
|
|
5
8
|
const LOOP_SENTINEL = /*@__PURE__*/ require('./constants/loop-sentinel')
|
|
@@ -487,7 +490,7 @@ function collectLicenseWarnings(licenseNodes) {
|
|
|
487
490
|
|
|
488
491
|
/*@__NO_SIDE_EFFECTS__*/
|
|
489
492
|
function createAstNode(rawNode) {
|
|
490
|
-
return
|
|
493
|
+
return ObjectHasOwn(rawNode, 'license')
|
|
491
494
|
? createLicenseNode(rawNode)
|
|
492
495
|
: createBinaryOperationNode(rawNode)
|
|
493
496
|
}
|
|
@@ -591,7 +594,7 @@ function createPackageJson(sockRegPkgName, directory, options) {
|
|
|
591
594
|
)
|
|
592
595
|
}
|
|
593
596
|
: { engines: { node: PACKAGE_DEFAULT_NODE_RANGE } }),
|
|
594
|
-
files:
|
|
597
|
+
files: ArrayIsArray(files) ? files.slice() : ['*.d.ts', '*.js'],
|
|
595
598
|
...(isObjectObject(socket)
|
|
596
599
|
? { socket: { ...socket } }
|
|
597
600
|
: {
|
|
@@ -723,7 +726,7 @@ function findTypesForSubpath(entryExports, subpath) {
|
|
|
723
726
|
)
|
|
724
727
|
}
|
|
725
728
|
const value = queue[pos++]
|
|
726
|
-
if (
|
|
729
|
+
if (ArrayIsArray(value)) {
|
|
727
730
|
for (let i = 0, { length } = value; i < length; i += 1) {
|
|
728
731
|
const item = value[i]
|
|
729
732
|
if (item === subpath) {
|
|
@@ -778,7 +781,7 @@ function getSubpaths(entryExports) {
|
|
|
778
781
|
const value = queue[pos++]
|
|
779
782
|
if (typeof value === 'string') {
|
|
780
783
|
result.push(value)
|
|
781
|
-
} else if (
|
|
784
|
+
} else if (ArrayIsArray(value)) {
|
|
782
785
|
queue.push(...value)
|
|
783
786
|
} else if (isObject(value)) {
|
|
784
787
|
queue.push(...getOwnPropertyValues(value))
|
|
@@ -908,14 +911,14 @@ function normalizePackageJson(pkgJson, options) {
|
|
|
908
911
|
const preserved = [
|
|
909
912
|
['_id', undefined],
|
|
910
913
|
['readme', undefined],
|
|
911
|
-
...(
|
|
912
|
-
...(
|
|
913
|
-
...(
|
|
914
|
-
...(
|
|
915
|
-
...(
|
|
914
|
+
...(ObjectHasOwn(pkgJson, 'bugs') ? [] : [['bugs', undefined]]),
|
|
915
|
+
...(ObjectHasOwn(pkgJson, 'homepage') ? [] : [['homepage', undefined]]),
|
|
916
|
+
...(ObjectHasOwn(pkgJson, 'name') ? [] : [['name', undefined]]),
|
|
917
|
+
...(ObjectHasOwn(pkgJson, 'version') ? [] : [['version', undefined]]),
|
|
918
|
+
...(ArrayIsArray(preserve)
|
|
916
919
|
? preserve.map(k => [
|
|
917
920
|
k,
|
|
918
|
-
|
|
921
|
+
ObjectHasOwn(pkgJson, k) ? pkgJson[k] : undefined
|
|
919
922
|
])
|
|
920
923
|
: [])
|
|
921
924
|
]
|
|
@@ -1074,7 +1077,7 @@ function resolvePackageJsonDirname(filepath) {
|
|
|
1074
1077
|
function resolvePackageJsonEntryExports(entryExports) {
|
|
1075
1078
|
// If conditional exports main sugar
|
|
1076
1079
|
// https://nodejs.org/api/packages.html#exports-sugar
|
|
1077
|
-
if (typeof entryExports === 'string' ||
|
|
1080
|
+
if (typeof entryExports === 'string' || ArrayIsArray(entryExports)) {
|
|
1078
1081
|
return { '.': entryExports }
|
|
1079
1082
|
}
|
|
1080
1083
|
if (isConditionalExports(entryExports)) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const { stripAnsi } = /*@__PURE__*/ require('./strings')
|
|
4
|
-
|
|
5
3
|
const { isArray: ArrayIsArray } = Array
|
|
6
4
|
const { hasOwn: ObjectHasOwn, keys: ObjectKeys } = Object
|
|
7
5
|
|
|
6
|
+
const { stripAnsi } = /*@__PURE__*/ require('./strings')
|
|
7
|
+
|
|
8
8
|
let _child_process
|
|
9
9
|
/*@__NO_SIDE_EFFECTS__*/
|
|
10
10
|
function getChildProcess() {
|