@socketsecurity/lib 3.5.0 → 4.0.0
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/CHANGELOG.md +7 -0
- package/README.md +8 -8
- package/dist/agent.js +11 -24
- package/dist/bin.d.ts +97 -40
- package/dist/bin.js +129 -134
- package/dist/cacache.d.ts +5 -2
- package/dist/cacache.js +29 -18
- package/dist/cache-with-ttl.js +1 -1
- package/dist/constants/agents.d.ts +0 -4
- package/dist/constants/agents.js +13 -4
- package/dist/constants/node.d.ts +1 -0
- package/dist/constants/node.js +2 -5
- package/dist/constants/packages.js +22 -10
- package/dist/dlx-binary.js +9 -17
- package/dist/dlx-manifest.js +2 -2
- package/dist/dlx-package.js +22 -62
- package/dist/dlx.js +14 -14
- package/dist/fs.js +19 -24
- package/dist/git.d.ts +6 -6
- package/dist/git.js +11 -14
- package/dist/globs.js +16 -29
- package/dist/ipc.d.ts +4 -4
- package/dist/ipc.js +3 -3
- package/dist/logger.d.ts +0 -25
- package/dist/logger.js +0 -26
- package/dist/package-default-node-range.js +13 -3
- package/dist/package-extensions.d.ts +2 -1
- package/dist/package-extensions.js +12 -2
- package/dist/packages/editable.d.ts +0 -3
- package/dist/packages/editable.js +34 -24
- package/dist/packages/isolation.js +32 -32
- package/dist/packages/licenses.js +18 -32
- package/dist/packages/manifest.js +18 -33
- package/dist/packages/normalize.js +19 -43
- package/dist/packages/operations.js +33 -80
- package/dist/packages/provenance.js +14 -4
- package/dist/packages/specs.js +13 -12
- package/dist/packages/validation.js +12 -10
- package/dist/packages.d.ts +1 -1
- package/dist/packages.js +3 -3
- package/dist/paths/dirnames.d.ts +13 -0
- package/dist/paths/dirnames.js +50 -0
- package/dist/paths/exts.d.ts +18 -0
- package/dist/paths/exts.js +68 -0
- package/dist/paths/filenames.d.ts +16 -0
- package/dist/paths/filenames.js +62 -0
- package/dist/paths/globs.d.ts +10 -0
- package/dist/{argv/quote.js → paths/globs.js} +21 -19
- package/dist/{path.d.ts → paths/normalize.d.ts} +41 -0
- package/dist/{path.js → paths/normalize.js} +17 -4
- package/dist/{packages/paths.js → paths/packages.js} +8 -8
- package/dist/{paths.js → paths/socket.js} +29 -65
- package/dist/sea.js +2 -2
- package/dist/shadow.js +3 -3
- package/dist/sorts.js +12 -2
- package/dist/spawn.d.ts +15 -12
- package/dist/spawn.js +42 -30
- package/dist/spinner.d.ts +2 -6
- package/dist/spinner.js +6 -39
- package/dist/stdio/prompts.d.ts +8 -10
- package/dist/stdio/prompts.js +14 -12
- package/dist/streams.d.ts +0 -4
- package/dist/streams.js +3 -12
- package/dist/temporary-executor.js +3 -3
- package/dist/versions.js +31 -28
- package/package.json +28 -20
- package/dist/argv/quote.d.ts +0 -49
- package/dist/constants/paths.d.ts +0 -51
- package/dist/constants/paths.js +0 -152
- /package/dist/{packages/paths.d.ts → paths/packages.d.ts} +0 -0
- /package/dist/{paths.d.ts → paths/socket.d.ts} +0 -0
package/dist/spinner.js
CHANGED
|
@@ -38,6 +38,7 @@ __export(spinner_exports, {
|
|
|
38
38
|
withSpinnerSync: () => withSpinnerSync
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(spinner_exports);
|
|
41
|
+
var import_yoctocolors_cjs = __toESM(require("./external/yoctocolors-cjs"));
|
|
41
42
|
var import_colors = require("./colors");
|
|
42
43
|
var import_ci = require("#env/ci");
|
|
43
44
|
var import_debug = require("./debug");
|
|
@@ -76,8 +77,7 @@ function renderProgressBar(percentage, width = 20) {
|
|
|
76
77
|
const filled = Math.round(percentage / 100 * width);
|
|
77
78
|
const empty = width - filled;
|
|
78
79
|
const bar = "\u2588".repeat(filled) + "\u2591".repeat(empty);
|
|
79
|
-
|
|
80
|
-
return colors.cyan(bar);
|
|
80
|
+
return import_yoctocolors_cjs.default.cyan(bar);
|
|
81
81
|
}
|
|
82
82
|
let _cliSpinners;
|
|
83
83
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -571,40 +571,6 @@ function Spinner(options) {
|
|
|
571
571
|
}
|
|
572
572
|
return this;
|
|
573
573
|
}
|
|
574
|
-
/**
|
|
575
|
-
* Show a reasoning/working message (∴) without stopping the spinner.
|
|
576
|
-
* Outputs to stderr and continues spinning.
|
|
577
|
-
*
|
|
578
|
-
* @param text - Reasoning message to display
|
|
579
|
-
* @param extras - Additional values to log
|
|
580
|
-
* @returns This spinner for chaining
|
|
581
|
-
*/
|
|
582
|
-
reason(text, ...extras) {
|
|
583
|
-
return this.#showStatusAndKeepSpinning("reason", [text, ...extras]);
|
|
584
|
-
}
|
|
585
|
-
/**
|
|
586
|
-
* Show a reasoning/working message (∴) and stop the spinner.
|
|
587
|
-
* Auto-clears the spinner line before displaying the message.
|
|
588
|
-
*
|
|
589
|
-
* Implementation note: Unlike other *AndStop methods (successAndStop, failAndStop, etc.),
|
|
590
|
-
* this method cannot use #apply() with a 'reason' method name because yocto-spinner
|
|
591
|
-
* doesn't have a built-in 'reason' method. Instead, we manually stop the spinner then
|
|
592
|
-
* log the message with the reason symbol. This matches the pattern used by methods
|
|
593
|
-
* like debugAndStop() and maintains consistency with normalizeText() usage and empty
|
|
594
|
-
* string handling (see #apply's stop method handling for the pattern).
|
|
595
|
-
*
|
|
596
|
-
* @param text - Reasoning message to display
|
|
597
|
-
* @param extras - Additional values to log
|
|
598
|
-
* @returns This spinner for chaining
|
|
599
|
-
*/
|
|
600
|
-
reasonAndStop(text, ...extras) {
|
|
601
|
-
this.#apply("stop", []);
|
|
602
|
-
const normalized = normalizeText(text);
|
|
603
|
-
if (normalized) {
|
|
604
|
-
logger.error(`${import_logger.LOG_SYMBOLS.reason} ${normalized}`, ...extras);
|
|
605
|
-
}
|
|
606
|
-
return this;
|
|
607
|
-
}
|
|
608
574
|
/**
|
|
609
575
|
* Show a skip message (↻) without stopping the spinner.
|
|
610
576
|
* Outputs to stderr and continues spinning.
|
|
@@ -620,9 +586,10 @@ function Spinner(options) {
|
|
|
620
586
|
* Show a skip message (↻) and stop the spinner.
|
|
621
587
|
* Auto-clears the spinner line before displaying the message.
|
|
622
588
|
*
|
|
623
|
-
* Implementation note:
|
|
624
|
-
* with a 'skip' method name because yocto-spinner doesn't
|
|
625
|
-
* method. Instead, we manually stop the spinner then log the message
|
|
589
|
+
* Implementation note: Unlike other *AndStop methods (successAndStop, failAndStop, etc.),
|
|
590
|
+
* this method cannot use #apply() with a 'skip' method name because yocto-spinner doesn't
|
|
591
|
+
* have a built-in 'skip' method. Instead, we manually stop the spinner then log the message
|
|
592
|
+
* with the skip symbol.
|
|
626
593
|
*
|
|
627
594
|
* @param text - Skip message to display
|
|
628
595
|
* @param extras - Additional values to log
|
package/dist/stdio/prompts.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import checkboxRaw from '../external/@inquirer/checkbox';
|
|
2
|
+
import confirmRaw from '../external/@inquirer/confirm';
|
|
3
|
+
import inputRaw from '../external/@inquirer/input';
|
|
4
|
+
import passwordRaw from '../external/@inquirer/password';
|
|
1
5
|
import { type ThemeName } from '../themes/themes';
|
|
2
6
|
import type { Theme } from '../themes/types';
|
|
7
|
+
// Modules imported at the top - extract default and Separator
|
|
8
|
+
declare const searchRaw: any;
|
|
9
|
+
declare const selectRaw: any;
|
|
10
|
+
declare const ActualSeparator: any;
|
|
3
11
|
// Type definitions
|
|
4
12
|
/**
|
|
5
13
|
* Choice option for select and search prompts.
|
|
@@ -98,16 +106,6 @@ export declare function createInquirerTheme(theme: Theme | ThemeName | unknown):
|
|
|
98
106
|
*/
|
|
99
107
|
/*@__NO_SIDE_EFFECTS__*/
|
|
100
108
|
export declare function wrapPrompt<T = unknown>(inquirerPrompt: (...args: unknown[]) => Promise<T>): (...args: unknown[]) => Promise<T | undefined>;
|
|
101
|
-
// c8 ignore start - Third-party inquirer library requires and exports not testable in isolation.
|
|
102
|
-
declare const checkboxRaw: any;
|
|
103
|
-
declare const confirmRaw: any;
|
|
104
|
-
declare const inputRaw: any;
|
|
105
|
-
declare const passwordRaw: any;
|
|
106
|
-
// Search and select export additional named exports, so we access .default.
|
|
107
|
-
declare const searchRaw: any;
|
|
108
|
-
declare const selectRaw: any;
|
|
109
|
-
declare const ActualSeparator: any;
|
|
110
|
-
// c8 ignore stop
|
|
111
109
|
/**
|
|
112
110
|
* Prompt to select multiple items from a list of choices.
|
|
113
111
|
* Wrapped with spinner handling and abort signal support.
|
package/dist/stdio/prompts.js
CHANGED
|
@@ -42,12 +42,22 @@ __export(prompts_exports, {
|
|
|
42
42
|
});
|
|
43
43
|
module.exports = __toCommonJS(prompts_exports);
|
|
44
44
|
var import_process = require("#constants/process");
|
|
45
|
+
var import_checkbox = __toESM(require("../external/@inquirer/checkbox"));
|
|
46
|
+
var import_confirm = __toESM(require("../external/@inquirer/confirm"));
|
|
47
|
+
var import_input = __toESM(require("../external/@inquirer/input"));
|
|
48
|
+
var import_password = __toESM(require("../external/@inquirer/password"));
|
|
49
|
+
var searchModule = __toESM(require("../external/@inquirer/search"));
|
|
50
|
+
var selectModuleImport = __toESM(require("../external/@inquirer/select"));
|
|
45
51
|
var import_context = require("../themes/context");
|
|
46
52
|
var import_themes = require("../themes/themes");
|
|
47
53
|
var import_utils = require("../themes/utils");
|
|
48
54
|
var import_yoctocolors_cjs = __toESM(require("../external/yoctocolors-cjs"));
|
|
49
55
|
const abortSignal = (0, import_process.getAbortSignal)();
|
|
50
56
|
const spinner = (0, import_process.getSpinner)();
|
|
57
|
+
const searchRaw = searchModule.default;
|
|
58
|
+
const selectModule = selectModuleImport;
|
|
59
|
+
const selectRaw = selectModule.default;
|
|
60
|
+
const ActualSeparator = selectModule.Separator;
|
|
51
61
|
function applyColor(text, color) {
|
|
52
62
|
if (typeof color === "string") {
|
|
53
63
|
return import_yoctocolors_cjs.default[color](text);
|
|
@@ -141,18 +151,10 @@ function wrapPrompt(inquirerPrompt) {
|
|
|
141
151
|
return typeof result === "string" ? result.trim() : result;
|
|
142
152
|
};
|
|
143
153
|
}
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
const searchRaw = require("../external/@inquirer/search").default;
|
|
149
|
-
const selectModule = require("../external/@inquirer/select");
|
|
150
|
-
const selectRaw = selectModule.default;
|
|
151
|
-
const ActualSeparator = selectModule.Separator;
|
|
152
|
-
const checkbox = /* @__PURE__ */ wrapPrompt(checkboxRaw);
|
|
153
|
-
const confirm = /* @__PURE__ */ wrapPrompt(confirmRaw);
|
|
154
|
-
const input = /* @__PURE__ */ wrapPrompt(inputRaw);
|
|
155
|
-
const password = /* @__PURE__ */ wrapPrompt(passwordRaw);
|
|
154
|
+
const checkbox = /* @__PURE__ */ wrapPrompt(import_checkbox.default);
|
|
155
|
+
const confirm = /* @__PURE__ */ wrapPrompt(import_confirm.default);
|
|
156
|
+
const input = /* @__PURE__ */ wrapPrompt(import_input.default);
|
|
157
|
+
const password = /* @__PURE__ */ wrapPrompt(import_password.default);
|
|
156
158
|
const search = /* @__PURE__ */ wrapPrompt(searchRaw);
|
|
157
159
|
const select = /* @__PURE__ */ wrapPrompt(selectRaw);
|
|
158
160
|
function createSeparator(text) {
|
package/dist/streams.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Stream processing utilities with streaming-iterables integration.
|
|
3
|
-
* Provides async stream handling and transformation functions.
|
|
4
|
-
*/
|
|
5
1
|
import type { IterationOptions } from './promises';
|
|
6
2
|
/**
|
|
7
3
|
* Execute a function for each item in an iterable in parallel.
|
package/dist/streams.js
CHANGED
|
@@ -24,15 +24,8 @@ __export(streams_exports, {
|
|
|
24
24
|
transform: () => transform
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(streams_exports);
|
|
27
|
+
var import_streaming_iterables = require("./external/streaming-iterables");
|
|
27
28
|
var import_promises = require("./promises");
|
|
28
|
-
let _streamingIterables;
|
|
29
|
-
// @__NO_SIDE_EFFECTS__
|
|
30
|
-
function getStreamingIterables() {
|
|
31
|
-
if (_streamingIterables === void 0) {
|
|
32
|
-
_streamingIterables = require("./external/streaming-iterables.js");
|
|
33
|
-
}
|
|
34
|
-
return _streamingIterables;
|
|
35
|
-
}
|
|
36
29
|
// @__NO_SIDE_EFFECTS__
|
|
37
30
|
async function parallelEach(iterable, func, options) {
|
|
38
31
|
for await (const _ of /* @__PURE__ */ parallelMap(iterable, func, options)) {
|
|
@@ -40,9 +33,8 @@ async function parallelEach(iterable, func, options) {
|
|
|
40
33
|
}
|
|
41
34
|
// @__NO_SIDE_EFFECTS__
|
|
42
35
|
function parallelMap(iterable, func, options) {
|
|
43
|
-
const streamingIterables = /* @__PURE__ */ getStreamingIterables();
|
|
44
36
|
const opts = (0, import_promises.normalizeIterationOptions)(options);
|
|
45
|
-
const result =
|
|
37
|
+
const result = (0, import_streaming_iterables.parallelMap)(
|
|
46
38
|
opts.concurrency,
|
|
47
39
|
async (item) => {
|
|
48
40
|
const result2 = await (0, import_promises.pRetry)((...args) => func(args[0]), {
|
|
@@ -57,9 +49,8 @@ function parallelMap(iterable, func, options) {
|
|
|
57
49
|
}
|
|
58
50
|
// @__NO_SIDE_EFFECTS__
|
|
59
51
|
function transform(iterable, func, options) {
|
|
60
|
-
const streamingIterables = /* @__PURE__ */ getStreamingIterables();
|
|
61
52
|
const opts = (0, import_promises.normalizeIterationOptions)(options);
|
|
62
|
-
const result =
|
|
53
|
+
const result = (0, import_streaming_iterables.transform)(
|
|
63
54
|
opts.concurrency,
|
|
64
55
|
async (item) => {
|
|
65
56
|
const result2 = await (0, import_promises.pRetry)((...args) => func(args[0]), {
|
|
@@ -23,15 +23,15 @@ __export(temporary_executor_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(temporary_executor_exports);
|
|
25
25
|
var import_platform = require("#constants/platform");
|
|
26
|
-
var
|
|
26
|
+
var import_normalize = require("./paths/normalize");
|
|
27
27
|
function isRunningInTemporaryExecutor(cwd = process.cwd()) {
|
|
28
28
|
const userAgent = process.env["npm_config_user_agent"];
|
|
29
29
|
if (userAgent?.includes("exec") || userAgent?.includes("npx") || userAgent?.includes("dlx")) {
|
|
30
30
|
return true;
|
|
31
31
|
}
|
|
32
|
-
const normalizedCwd = (0,
|
|
32
|
+
const normalizedCwd = (0, import_normalize.normalizePath)(cwd);
|
|
33
33
|
const npmCache = process.env["npm_config_cache"];
|
|
34
|
-
if (npmCache && normalizedCwd.includes((0,
|
|
34
|
+
if (npmCache && normalizedCwd.includes((0, import_normalize.normalizePath)(npmCache))) {
|
|
35
35
|
return true;
|
|
36
36
|
}
|
|
37
37
|
const tempPatterns = [
|
package/dist/versions.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
18
|
}
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
19
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
30
|
var versions_exports = {};
|
|
21
31
|
__export(versions_exports, {
|
|
@@ -41,69 +51,62 @@ __export(versions_exports, {
|
|
|
41
51
|
versionDiff: () => versionDiff
|
|
42
52
|
});
|
|
43
53
|
module.exports = __toCommonJS(versions_exports);
|
|
44
|
-
|
|
45
|
-
// @__NO_SIDE_EFFECTS__
|
|
46
|
-
function getSemver() {
|
|
47
|
-
if (_semver === void 0) {
|
|
48
|
-
_semver = require("./external/semver.js");
|
|
49
|
-
}
|
|
50
|
-
return _semver;
|
|
51
|
-
}
|
|
54
|
+
var semver = __toESM(require("./external/semver.js"));
|
|
52
55
|
function coerceVersion(version) {
|
|
53
|
-
const coerced =
|
|
56
|
+
const coerced = semver.coerce(version);
|
|
54
57
|
return coerced?.version;
|
|
55
58
|
}
|
|
56
59
|
function compareVersions(v1, v2) {
|
|
57
60
|
try {
|
|
58
|
-
return
|
|
61
|
+
return semver.compare(v1, v2);
|
|
59
62
|
} catch {
|
|
60
63
|
return void 0;
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
function filterVersions(versions, range) {
|
|
64
|
-
return versions.filter((v) =>
|
|
67
|
+
return versions.filter((v) => semver.satisfies(v, range));
|
|
65
68
|
}
|
|
66
69
|
function getMajorVersion(version) {
|
|
67
|
-
const parsed =
|
|
70
|
+
const parsed = semver.parse(version);
|
|
68
71
|
return parsed?.major;
|
|
69
72
|
}
|
|
70
73
|
function getMinorVersion(version) {
|
|
71
|
-
const parsed =
|
|
74
|
+
const parsed = semver.parse(version);
|
|
72
75
|
return parsed?.minor;
|
|
73
76
|
}
|
|
74
77
|
function getPatchVersion(version) {
|
|
75
|
-
const parsed =
|
|
78
|
+
const parsed = semver.parse(version);
|
|
76
79
|
return parsed?.patch;
|
|
77
80
|
}
|
|
78
81
|
function incrementVersion(version, release, identifier) {
|
|
79
|
-
return
|
|
82
|
+
return semver.inc(version, release, identifier) || void 0;
|
|
80
83
|
}
|
|
81
84
|
function isEqual(version1, version2) {
|
|
82
|
-
return
|
|
85
|
+
return semver.eq(version1, version2);
|
|
83
86
|
}
|
|
84
87
|
function isGreaterThan(version1, version2) {
|
|
85
|
-
return
|
|
88
|
+
return semver.gt(version1, version2);
|
|
86
89
|
}
|
|
87
90
|
function isGreaterThanOrEqual(version1, version2) {
|
|
88
|
-
return
|
|
91
|
+
return semver.gte(version1, version2);
|
|
89
92
|
}
|
|
90
93
|
function isLessThan(version1, version2) {
|
|
91
|
-
return
|
|
94
|
+
return semver.lt(version1, version2);
|
|
92
95
|
}
|
|
93
96
|
function isLessThanOrEqual(version1, version2) {
|
|
94
|
-
return
|
|
97
|
+
return semver.lte(version1, version2);
|
|
95
98
|
}
|
|
96
99
|
function isValidVersion(version) {
|
|
97
|
-
return
|
|
100
|
+
return semver.valid(version) !== null;
|
|
98
101
|
}
|
|
99
102
|
function maxVersion(versions) {
|
|
100
|
-
return
|
|
103
|
+
return semver.maxSatisfying(versions, "*") || void 0;
|
|
101
104
|
}
|
|
102
105
|
function minVersion(versions) {
|
|
103
|
-
return
|
|
106
|
+
return semver.minSatisfying(versions, "*") || void 0;
|
|
104
107
|
}
|
|
105
108
|
function parseVersion(version) {
|
|
106
|
-
const parsed =
|
|
109
|
+
const parsed = semver.parse(version);
|
|
107
110
|
if (!parsed) {
|
|
108
111
|
return void 0;
|
|
109
112
|
}
|
|
@@ -116,17 +119,17 @@ function parseVersion(version) {
|
|
|
116
119
|
};
|
|
117
120
|
}
|
|
118
121
|
function satisfiesVersion(version, range) {
|
|
119
|
-
return
|
|
122
|
+
return semver.satisfies(version, range);
|
|
120
123
|
}
|
|
121
124
|
function sortVersions(versions) {
|
|
122
|
-
return
|
|
125
|
+
return semver.sort([...versions]);
|
|
123
126
|
}
|
|
124
127
|
function sortVersionsDesc(versions) {
|
|
125
|
-
return
|
|
128
|
+
return semver.rsort([...versions]);
|
|
126
129
|
}
|
|
127
130
|
function versionDiff(version1, version2) {
|
|
128
131
|
try {
|
|
129
|
-
return
|
|
132
|
+
return semver.diff(version1, version2) || void 0;
|
|
130
133
|
} catch {
|
|
131
134
|
return void 0;
|
|
132
135
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/lib",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"packageManager": "pnpm@10.22.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Core utilities and infrastructure for Socket.dev security tools",
|
|
@@ -111,10 +111,6 @@
|
|
|
111
111
|
"types": "./dist/argv/parse.d.ts",
|
|
112
112
|
"default": "./dist/argv/parse.js"
|
|
113
113
|
},
|
|
114
|
-
"./argv/quote": {
|
|
115
|
-
"types": "./dist/argv/quote.d.ts",
|
|
116
|
-
"default": "./dist/argv/quote.js"
|
|
117
|
-
},
|
|
118
114
|
"./arrays": {
|
|
119
115
|
"types": "./dist/arrays.d.ts",
|
|
120
116
|
"default": "./dist/arrays.js"
|
|
@@ -163,10 +159,6 @@
|
|
|
163
159
|
"types": "./dist/constants/packages.d.ts",
|
|
164
160
|
"default": "./dist/constants/packages.js"
|
|
165
161
|
},
|
|
166
|
-
"./constants/paths": {
|
|
167
|
-
"types": "./dist/constants/paths.d.ts",
|
|
168
|
-
"default": "./dist/constants/paths.js"
|
|
169
|
-
},
|
|
170
162
|
"./constants/platform": {
|
|
171
163
|
"types": "./dist/constants/platform.d.ts",
|
|
172
164
|
"default": "./dist/constants/platform.js"
|
|
@@ -439,10 +431,6 @@
|
|
|
439
431
|
"types": "./dist/packages/operations.d.ts",
|
|
440
432
|
"default": "./dist/packages/operations.js"
|
|
441
433
|
},
|
|
442
|
-
"./packages/paths": {
|
|
443
|
-
"types": "./dist/packages/paths.d.ts",
|
|
444
|
-
"default": "./dist/packages/paths.js"
|
|
445
|
-
},
|
|
446
434
|
"./packages/provenance": {
|
|
447
435
|
"types": "./dist/packages/provenance.d.ts",
|
|
448
436
|
"default": "./dist/packages/provenance.js"
|
|
@@ -455,18 +443,38 @@
|
|
|
455
443
|
"types": "./dist/packages/validation.d.ts",
|
|
456
444
|
"default": "./dist/packages/validation.js"
|
|
457
445
|
},
|
|
458
|
-
"./
|
|
459
|
-
"types": "./dist/
|
|
460
|
-
"default": "./dist/
|
|
446
|
+
"./paths/dirnames": {
|
|
447
|
+
"types": "./dist/paths/dirnames.d.ts",
|
|
448
|
+
"default": "./dist/paths/dirnames.js"
|
|
449
|
+
},
|
|
450
|
+
"./paths/exts": {
|
|
451
|
+
"types": "./dist/paths/exts.d.ts",
|
|
452
|
+
"default": "./dist/paths/exts.js"
|
|
461
453
|
},
|
|
462
|
-
"./paths": {
|
|
463
|
-
"types": "./dist/paths.d.ts",
|
|
464
|
-
"default": "./dist/paths.js"
|
|
454
|
+
"./paths/filenames": {
|
|
455
|
+
"types": "./dist/paths/filenames.d.ts",
|
|
456
|
+
"default": "./dist/paths/filenames.js"
|
|
457
|
+
},
|
|
458
|
+
"./paths/globs": {
|
|
459
|
+
"types": "./dist/paths/globs.d.ts",
|
|
460
|
+
"default": "./dist/paths/globs.js"
|
|
461
|
+
},
|
|
462
|
+
"./paths/normalize": {
|
|
463
|
+
"types": "./dist/paths/normalize.d.ts",
|
|
464
|
+
"default": "./dist/paths/normalize.js"
|
|
465
|
+
},
|
|
466
|
+
"./paths/packages": {
|
|
467
|
+
"types": "./dist/paths/packages.d.ts",
|
|
468
|
+
"default": "./dist/paths/packages.js"
|
|
465
469
|
},
|
|
466
470
|
"./paths/rewire": {
|
|
467
471
|
"types": "./dist/paths/rewire.d.ts",
|
|
468
472
|
"default": "./dist/paths/rewire.js"
|
|
469
473
|
},
|
|
474
|
+
"./paths/socket": {
|
|
475
|
+
"types": "./dist/paths/socket.d.ts",
|
|
476
|
+
"default": "./dist/paths/socket.js"
|
|
477
|
+
},
|
|
470
478
|
"./performance": {
|
|
471
479
|
"types": "./dist/performance.d.ts",
|
|
472
480
|
"default": "./dist/performance.js"
|
|
@@ -691,7 +699,7 @@
|
|
|
691
699
|
"@socketregistry/is-unicode-supported": "1.0.5",
|
|
692
700
|
"@socketregistry/packageurl-js": "1.3.5",
|
|
693
701
|
"@socketregistry/yocto-spinner": "1.0.25",
|
|
694
|
-
"@socketsecurity/lib-stable": "npm:@socketsecurity/lib@3.
|
|
702
|
+
"@socketsecurity/lib-stable": "npm:@socketsecurity/lib@3.5.0",
|
|
695
703
|
"@types/node": "24.9.2",
|
|
696
704
|
"@typescript/native-preview": "7.0.0-dev.20250920.1",
|
|
697
705
|
"@vitest/coverage-v8": "4.0.3",
|
package/dist/argv/quote.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Argument quoting utilities for shell execution with spawn()
|
|
3
|
-
*
|
|
4
|
-
* These functions handle quoting of command-line arguments when using
|
|
5
|
-
* child_process.spawn() with shell: true.
|
|
6
|
-
*
|
|
7
|
-
* IMPORTANT: Only needed when shell: true. With shell: false, arguments
|
|
8
|
-
* are passed directly to the OS kernel as an array (no quoting needed).
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Quote an argument for POSIX shell execution (bash, sh, zsh).
|
|
12
|
-
*
|
|
13
|
-
* Uses single quotes (POSIX standard) which prevent all expansions except
|
|
14
|
-
* single quotes themselves. Internal single quotes are escaped using '\''
|
|
15
|
-
*
|
|
16
|
-
* @param arg - Argument to quote
|
|
17
|
-
* @returns Quoted argument safe for POSIX shells when using shell: true
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```ts
|
|
21
|
-
* import { posixQuote } from '@socketsecurity/lib/argv/quote'
|
|
22
|
-
*
|
|
23
|
-
* // With shell: true on Unix
|
|
24
|
-
* const path = '/path/with spaces/file.txt'
|
|
25
|
-
* spawn('sh', ['-c', 'cat', posixQuote(path)], { shell: true })
|
|
26
|
-
* // sh receives: sh -c cat '/path/with spaces/file.txt'
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare function posixQuote(arg: string): string;
|
|
30
|
-
/**
|
|
31
|
-
* Quote an argument for Windows cmd.exe shell execution.
|
|
32
|
-
*
|
|
33
|
-
* Uses double quotes (cmd.exe standard) and escapes internal quotes by doubling.
|
|
34
|
-
* Handles all cmd.exe special characters: space, &, |, <, >, ^, %, (, ), !, "
|
|
35
|
-
*
|
|
36
|
-
* @param arg - Argument to quote
|
|
37
|
-
* @returns Quoted argument safe for cmd.exe when using shell: true
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```ts
|
|
41
|
-
* import { win32Quote } from '@socketsecurity/lib/argv/quote'
|
|
42
|
-
*
|
|
43
|
-
* // With shell: true on Windows
|
|
44
|
-
* const path = 'C:\\Program Files\\app.exe'
|
|
45
|
-
* spawn('cmd', ['/c', 'app', win32Quote(path)], { shell: true })
|
|
46
|
-
* // cmd.exe receives: cmd /c app "C:\Program Files\app.exe"
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
export declare function win32Quote(arg: string): string;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File paths, directory names, extensions, and glob patterns.
|
|
3
|
-
*/
|
|
4
|
-
// File names.
|
|
5
|
-
export declare const PACKAGE_JSON = "package.json";
|
|
6
|
-
export declare const TSCONFIG_JSON = "tsconfig.json";
|
|
7
|
-
export declare const LICENSE = "LICENSE";
|
|
8
|
-
export declare const LICENSE_MD = "LICENSE.md";
|
|
9
|
-
export declare const LICENSE_ORIGINAL = "LICENSE.original";
|
|
10
|
-
export declare const README_MD = "README.md";
|
|
11
|
-
export declare const CHANGELOG_MD = "CHANGELOG.md";
|
|
12
|
-
export declare const MANIFEST_JSON = "manifest.json";
|
|
13
|
-
export declare const EXTENSIONS_JSON = "extensions.json";
|
|
14
|
-
export declare const ESLINT_CONFIG_JS = "eslint.config.js";
|
|
15
|
-
export declare const GITIGNORE = ".gitignore";
|
|
16
|
-
export declare const DOT_PACKAGE_LOCK_JSON = ".package-lock.json";
|
|
17
|
-
// Directory names.
|
|
18
|
-
export declare const NODE_MODULES = "node_modules";
|
|
19
|
-
export declare const DOT_GIT_DIR = ".git";
|
|
20
|
-
export declare const DOT_GITHUB = ".github";
|
|
21
|
-
export declare const DOT_SOCKET_DIR = ".socket";
|
|
22
|
-
export declare const CACHE_DIR = "cache";
|
|
23
|
-
export declare const CACHE_TTL_DIR = "ttl";
|
|
24
|
-
// Path patterns.
|
|
25
|
-
export declare const NODE_MODULES_GLOB_RECURSIVE = "**/node_modules";
|
|
26
|
-
export declare const SLASH_NODE_MODULES_SLASH = "/node_modules/";
|
|
27
|
-
// File extensions.
|
|
28
|
-
export declare const EXT_CJS = ".cjs";
|
|
29
|
-
export declare const EXT_CMD = ".cmd";
|
|
30
|
-
export declare const EXT_CTS = ".cts";
|
|
31
|
-
export declare const EXT_DTS = ".d.ts";
|
|
32
|
-
export declare const EXT_JS = ".js";
|
|
33
|
-
export declare const EXT_JSON = ".json";
|
|
34
|
-
export declare const EXT_LOCK = ".lock";
|
|
35
|
-
export declare const EXT_LOCKB = ".lockb";
|
|
36
|
-
export declare const EXT_MD = ".md";
|
|
37
|
-
export declare const EXT_MJS = ".mjs";
|
|
38
|
-
export declare const EXT_MTS = ".mts";
|
|
39
|
-
export declare const EXT_PS1 = ".ps1";
|
|
40
|
-
export declare const EXT_YAML = ".yaml";
|
|
41
|
-
export declare const EXT_YML = ".yml";
|
|
42
|
-
// Glob patterns.
|
|
43
|
-
export declare const LICENSE_GLOB = "LICEN[CS]E{[.-]*,}";
|
|
44
|
-
export declare const LICENSE_GLOB_RECURSIVE = "**/LICEN[CS]E{[.-]*,}";
|
|
45
|
-
export declare const LICENSE_ORIGINAL_GLOB = "*.original{.*,}";
|
|
46
|
-
export declare const LICENSE_ORIGINAL_GLOB_RECURSIVE = "**/*.original{.*,}";
|
|
47
|
-
export declare const README_GLOB = "README{.*,}";
|
|
48
|
-
export declare const README_GLOB_RECURSIVE = "**/README{.*,}";
|
|
49
|
-
// Miscellaneous path constants.
|
|
50
|
-
export declare const EXTENSIONS = "extensions";
|
|
51
|
-
export declare const ROLLUP_EXTERNAL_SUFFIX = "__rollup_external";
|