@socketsecurity/lib 5.11.1 → 5.11.2
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 +10 -0
- package/dist/agent.js +12 -1
- package/dist/archives.js +7 -6
- package/dist/argv/flags.d.ts +0 -7
- package/dist/argv/flags.js +12 -1
- package/dist/argv/parse.js +4 -3
- package/dist/bin.js +2 -1
- package/dist/constants/node.js +14 -3
- package/dist/cover/code.js +13 -2
- package/dist/cover/type.js +12 -1
- package/dist/dlx/binary.js +16 -5
- package/dist/env/package-manager.js +12 -1
- package/dist/env/rewire.js +14 -3
- package/dist/fs.d.ts +0 -4
- package/dist/fs.js +13 -2
- package/dist/git.js +12 -1
- package/dist/github.js +13 -2
- package/dist/http-request.d.ts +29 -0
- package/dist/http-request.js +20 -2
- package/dist/ipc.js +16 -5
- package/dist/json/edit.js +14 -3
- package/dist/logger.js +5 -4
- package/dist/performance.js +13 -2
- package/dist/releases/github.js +4 -3
- package/dist/sea.js +12 -1
- package/dist/shadow.js +14 -3
- package/dist/spawn.js +5 -4
- package/dist/spinner.d.ts +0 -4
- package/dist/spinner.js +2 -1
- package/dist/stdio/clear.d.ts +0 -21
- package/dist/stdio/clear.js +20 -9
- package/dist/stdio/mask.js +27 -16
- package/dist/stdio/progress.js +2 -1
- package/dist/stdio/stderr.d.ts +0 -13
- package/dist/stdio/stderr.js +12 -1
- package/dist/stdio/stdout.js +17 -6
- package/dist/suppress-warnings.d.ts +0 -9
- package/dist/suppress-warnings.js +17 -6
- package/dist/temporary-executor.js +14 -3
- package/package.json +2 -2
package/dist/stdio/clear.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 clear_exports = {};
|
|
21
31
|
__export(clear_exports, {
|
|
@@ -30,7 +40,8 @@ __export(clear_exports, {
|
|
|
30
40
|
showCursor: () => showCursor
|
|
31
41
|
});
|
|
32
42
|
module.exports = __toCommonJS(clear_exports);
|
|
33
|
-
|
|
43
|
+
var import_node_process = __toESM(require("node:process"));
|
|
44
|
+
function clearLine(stream = import_node_process.default.stdout) {
|
|
34
45
|
if (stream.isTTY) {
|
|
35
46
|
stream.cursorTo(0);
|
|
36
47
|
stream.clearLine(0);
|
|
@@ -38,36 +49,36 @@ function clearLine(stream = process.stdout) {
|
|
|
38
49
|
stream.write("\r\x1B[K");
|
|
39
50
|
}
|
|
40
51
|
}
|
|
41
|
-
function clearLines(count, stream =
|
|
52
|
+
function clearLines(count, stream = import_node_process.default.stdout) {
|
|
42
53
|
for (let i = 0; i < count; i++) {
|
|
43
54
|
stream.write("\x1B[1A\x1B[2K");
|
|
44
55
|
}
|
|
45
56
|
}
|
|
46
|
-
function clearScreen(stream =
|
|
57
|
+
function clearScreen(stream = import_node_process.default.stdout) {
|
|
47
58
|
if (stream.isTTY) {
|
|
48
59
|
stream.write("\x1Bc");
|
|
49
60
|
}
|
|
50
61
|
}
|
|
51
|
-
function clearVisible(stream =
|
|
62
|
+
function clearVisible(stream = import_node_process.default.stdout) {
|
|
52
63
|
clearScreen(stream);
|
|
53
64
|
}
|
|
54
|
-
function cursorToStart(stream =
|
|
65
|
+
function cursorToStart(stream = import_node_process.default.stdout) {
|
|
55
66
|
if (stream.isTTY) {
|
|
56
67
|
stream.cursorTo(0);
|
|
57
68
|
} else {
|
|
58
69
|
stream.write("\r");
|
|
59
70
|
}
|
|
60
71
|
}
|
|
61
|
-
function hideCursor(stream =
|
|
72
|
+
function hideCursor(stream = import_node_process.default.stdout) {
|
|
62
73
|
stream.write("\x1B[?25l");
|
|
63
74
|
}
|
|
64
|
-
function showCursor(stream =
|
|
75
|
+
function showCursor(stream = import_node_process.default.stdout) {
|
|
65
76
|
stream.write("\x1B[?25h");
|
|
66
77
|
}
|
|
67
|
-
function saveCursor(stream =
|
|
78
|
+
function saveCursor(stream = import_node_process.default.stdout) {
|
|
68
79
|
stream.write("\x1B7");
|
|
69
80
|
}
|
|
70
|
-
function restoreCursor(stream =
|
|
81
|
+
function restoreCursor(stream = import_node_process.default.stdout) {
|
|
71
82
|
stream.write("\x1B8");
|
|
72
83
|
}
|
|
73
84
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/stdio/mask.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 mask_exports = {};
|
|
21
31
|
__export(mask_exports, {
|
|
@@ -25,6 +35,7 @@ __export(mask_exports, {
|
|
|
25
35
|
runWithMask: () => runWithMask
|
|
26
36
|
});
|
|
27
37
|
module.exports = __toCommonJS(mask_exports);
|
|
38
|
+
var import_node_process = __toESM(require("node:process"));
|
|
28
39
|
var import_spinner = require("../spinner.js");
|
|
29
40
|
var import_clear = require("./clear.js");
|
|
30
41
|
var import_stdout = require("./stdout.js");
|
|
@@ -76,7 +87,7 @@ function createKeyboardHandler(mask, child, options = {}) {
|
|
|
76
87
|
if (mask.outputBuffer.length > 0) {
|
|
77
88
|
const lineCount = mask.outputBuffer.join("").split("\n").length + 1;
|
|
78
89
|
for (let i = 0; i < lineCount; i += 1) {
|
|
79
|
-
|
|
90
|
+
import_node_process.default.stdout.write("\x1B[1A\x1B[2K");
|
|
80
91
|
}
|
|
81
92
|
}
|
|
82
93
|
(0, import_clear.clearLine)();
|
|
@@ -88,8 +99,8 @@ function createKeyboardHandler(mask, child, options = {}) {
|
|
|
88
99
|
}
|
|
89
100
|
} else if (key?.ctrl && key.name === "c") {
|
|
90
101
|
child.kill("SIGTERM");
|
|
91
|
-
if (
|
|
92
|
-
|
|
102
|
+
if (import_node_process.default.stdin.isTTY) {
|
|
103
|
+
import_node_process.default.stdin.setRawMode(false);
|
|
93
104
|
}
|
|
94
105
|
throw new Error("Process cancelled by user");
|
|
95
106
|
}
|
|
@@ -99,20 +110,20 @@ function attachOutputMask(child, options = {}) {
|
|
|
99
110
|
return new Promise((resolve, reject) => {
|
|
100
111
|
const { message = "Running\u2026" } = options;
|
|
101
112
|
const mask = createOutputMask(options);
|
|
102
|
-
if (mask.isSpinning &&
|
|
113
|
+
if (mask.isSpinning && import_node_process.default.stdout.isTTY) {
|
|
103
114
|
spinner.start(
|
|
104
115
|
`${message} (ctrl+o ${options.toggleText || "to see full output"})`
|
|
105
116
|
);
|
|
106
117
|
}
|
|
107
|
-
if (
|
|
108
|
-
(/* @__PURE__ */ getReadline()).emitKeypressEvents(
|
|
109
|
-
|
|
118
|
+
if (import_node_process.default.stdin.isTTY) {
|
|
119
|
+
(/* @__PURE__ */ getReadline()).emitKeypressEvents(import_node_process.default.stdin);
|
|
120
|
+
import_node_process.default.stdin.setRawMode(true);
|
|
110
121
|
const keypressHandler = createKeyboardHandler(mask, child, options);
|
|
111
|
-
|
|
122
|
+
import_node_process.default.stdin.on("keypress", keypressHandler);
|
|
112
123
|
child.on("exit", () => {
|
|
113
|
-
if (
|
|
114
|
-
|
|
115
|
-
|
|
124
|
+
if (import_node_process.default.stdin.isTTY) {
|
|
125
|
+
import_node_process.default.stdin.setRawMode(false);
|
|
126
|
+
import_node_process.default.stdin.removeListener("keypress", keypressHandler);
|
|
116
127
|
}
|
|
117
128
|
});
|
|
118
129
|
}
|
|
@@ -143,7 +154,7 @@ function attachOutputMask(child, options = {}) {
|
|
|
143
154
|
return void 0;
|
|
144
155
|
}
|
|
145
156
|
if (mask.verbose) {
|
|
146
|
-
|
|
157
|
+
import_node_process.default.stderr.write(text);
|
|
147
158
|
} else {
|
|
148
159
|
mask.outputBuffer.push(text);
|
|
149
160
|
}
|
|
@@ -151,8 +162,8 @@ function attachOutputMask(child, options = {}) {
|
|
|
151
162
|
});
|
|
152
163
|
}
|
|
153
164
|
child.on("exit", (code) => {
|
|
154
|
-
if (
|
|
155
|
-
|
|
165
|
+
if (import_node_process.default.stdin.isTTY) {
|
|
166
|
+
import_node_process.default.stdin.setRawMode(false);
|
|
156
167
|
}
|
|
157
168
|
let finalCode = code || 0;
|
|
158
169
|
if (options.overrideExitCode) {
|
|
@@ -181,8 +192,8 @@ function attachOutputMask(child, options = {}) {
|
|
|
181
192
|
resolve(finalCode);
|
|
182
193
|
});
|
|
183
194
|
child.on("error", (error) => {
|
|
184
|
-
if (
|
|
185
|
-
|
|
195
|
+
if (import_node_process.default.stdin.isTTY) {
|
|
196
|
+
import_node_process.default.stdin.setRawMode(false);
|
|
186
197
|
}
|
|
187
198
|
if (mask.isSpinning) {
|
|
188
199
|
spinner.failAndStop(`${message} error`);
|
package/dist/stdio/progress.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(progress_exports, {
|
|
|
33
33
|
createProgressIndicator: () => createProgressIndicator
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(progress_exports);
|
|
36
|
+
var import_node_process = __toESM(require("node:process"));
|
|
36
37
|
var import_yoctocolors_cjs = __toESM(require("../external/yoctocolors-cjs"));
|
|
37
38
|
var import_strings = require("../strings");
|
|
38
39
|
class ProgressBar {
|
|
@@ -62,7 +63,7 @@ class ProgressBar {
|
|
|
62
63
|
constructor(total, options) {
|
|
63
64
|
this.total = total;
|
|
64
65
|
this.startTime = Date.now();
|
|
65
|
-
this.stream = options?.stream ||
|
|
66
|
+
this.stream = options?.stream || import_node_process.default.stderr;
|
|
66
67
|
this.options = {
|
|
67
68
|
width: 40,
|
|
68
69
|
format: ":bar :percent :current/:total",
|
package/dist/stdio/stderr.d.ts
CHANGED
|
@@ -4,19 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// Get the actual stderr stream
|
|
6
6
|
declare const stderr: NodeJS.WriteStream;
|
|
7
|
-
/**
|
|
8
|
-
* Write a line to stderr with trailing newline.
|
|
9
|
-
* Used for error messages, warnings, and diagnostic output.
|
|
10
|
-
*
|
|
11
|
-
* @param text - Text to write
|
|
12
|
-
* @default text ''
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* writeErrorLine('Error: File not found')
|
|
17
|
-
* writeErrorLine() // Write empty line
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
7
|
export declare function writeErrorLine(text?: string): void;
|
|
21
8
|
/**
|
|
22
9
|
* Write text to stderr without adding a newline.
|
package/dist/stdio/stderr.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 stderr_exports = {};
|
|
21
31
|
__export(stderr_exports, {
|
|
@@ -32,7 +42,8 @@ __export(stderr_exports, {
|
|
|
32
42
|
writeWarning: () => writeWarning
|
|
33
43
|
});
|
|
34
44
|
module.exports = __toCommonJS(stderr_exports);
|
|
35
|
-
|
|
45
|
+
var import_node_process = __toESM(require("node:process"));
|
|
46
|
+
const stderr = import_node_process.default.stderr;
|
|
36
47
|
function writeErrorLine(text = "") {
|
|
37
48
|
stderr.write(`${text}
|
|
38
49
|
`);
|
package/dist/stdio/stdout.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 stdout_exports = {};
|
|
21
31
|
__export(stdout_exports, {
|
|
@@ -33,8 +43,9 @@ __export(stdout_exports, {
|
|
|
33
43
|
writeLine: () => writeLine
|
|
34
44
|
});
|
|
35
45
|
module.exports = __toCommonJS(stdout_exports);
|
|
46
|
+
var import_node_process = __toESM(require("node:process"));
|
|
36
47
|
var import_tty = require("tty");
|
|
37
|
-
const stdout =
|
|
48
|
+
const stdout = import_node_process.default.stdout;
|
|
38
49
|
function writeLine(text = "") {
|
|
39
50
|
stdout.write(`${text}
|
|
40
51
|
`);
|
|
@@ -78,14 +89,14 @@ function showCursor() {
|
|
|
78
89
|
}
|
|
79
90
|
}
|
|
80
91
|
function ensureCursorOnExit() {
|
|
81
|
-
|
|
82
|
-
|
|
92
|
+
import_node_process.default.on("exit", showCursor);
|
|
93
|
+
import_node_process.default.on("SIGINT", () => {
|
|
83
94
|
showCursor();
|
|
84
|
-
|
|
95
|
+
import_node_process.default.exit(130);
|
|
85
96
|
});
|
|
86
|
-
|
|
97
|
+
import_node_process.default.on("SIGTERM", () => {
|
|
87
98
|
showCursor();
|
|
88
|
-
|
|
99
|
+
import_node_process.default.exit(143);
|
|
89
100
|
});
|
|
90
101
|
}
|
|
91
102
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Suppress MaxListenersExceededWarning messages.
|
|
3
|
-
* This is useful in tests or scripts where multiple listeners are expected.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* import { suppressMaxListenersWarning } from '@socketsecurity/lib/suppress-warnings'
|
|
7
|
-
*
|
|
8
|
-
* suppressMaxListenersWarning()
|
|
9
|
-
*/
|
|
10
1
|
export declare function suppressMaxListenersWarning(): void;
|
|
11
2
|
/**
|
|
12
3
|
* Suppress all process warnings of a specific type.
|
|
@@ -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 suppress_warnings_exports = {};
|
|
21
31
|
__export(suppress_warnings_exports, {
|
|
@@ -26,13 +36,14 @@ __export(suppress_warnings_exports, {
|
|
|
26
36
|
withSuppressedWarnings: () => withSuppressedWarnings
|
|
27
37
|
});
|
|
28
38
|
module.exports = __toCommonJS(suppress_warnings_exports);
|
|
39
|
+
var import_node_process = __toESM(require("node:process"));
|
|
29
40
|
const { apply: ReflectApply } = Reflect;
|
|
30
41
|
let originalEmitWarning;
|
|
31
42
|
const suppressedWarnings = /* @__PURE__ */ new Set();
|
|
32
43
|
function setupSuppression() {
|
|
33
44
|
if (!originalEmitWarning) {
|
|
34
|
-
originalEmitWarning =
|
|
35
|
-
|
|
45
|
+
originalEmitWarning = import_node_process.default.emitWarning;
|
|
46
|
+
import_node_process.default.emitWarning = (warning, ...args) => {
|
|
36
47
|
if (typeof warning === "string") {
|
|
37
48
|
for (const suppressedType of suppressedWarnings) {
|
|
38
49
|
if (warning.includes(suppressedType)) {
|
|
@@ -47,7 +58,7 @@ function setupSuppression() {
|
|
|
47
58
|
}
|
|
48
59
|
return ReflectApply(
|
|
49
60
|
originalEmitWarning,
|
|
50
|
-
|
|
61
|
+
import_node_process.default,
|
|
51
62
|
[warning, ...args]
|
|
52
63
|
);
|
|
53
64
|
};
|
|
@@ -76,14 +87,14 @@ function setMaxEventTargetListeners(target, maxListeners = 10) {
|
|
|
76
87
|
}
|
|
77
88
|
function restoreWarnings() {
|
|
78
89
|
if (originalEmitWarning) {
|
|
79
|
-
|
|
90
|
+
import_node_process.default.emitWarning = originalEmitWarning;
|
|
80
91
|
originalEmitWarning = void 0;
|
|
81
92
|
suppressedWarnings.clear();
|
|
82
93
|
}
|
|
83
94
|
}
|
|
84
95
|
async function withSuppressedWarnings(warningType, callback) {
|
|
85
96
|
const wasAlreadySuppressed = suppressedWarnings.has(warningType);
|
|
86
|
-
const original =
|
|
97
|
+
const original = import_node_process.default.emitWarning;
|
|
87
98
|
suppressWarningType(warningType);
|
|
88
99
|
try {
|
|
89
100
|
return await callback();
|
|
@@ -91,7 +102,7 @@ async function withSuppressedWarnings(warningType, callback) {
|
|
|
91
102
|
if (!wasAlreadySuppressed) {
|
|
92
103
|
suppressedWarnings.delete(warningType);
|
|
93
104
|
}
|
|
94
|
-
|
|
105
|
+
import_node_process.default.emitWarning = original;
|
|
95
106
|
}
|
|
96
107
|
}
|
|
97
108
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -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,21 +18,30 @@ 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 temporary_executor_exports = {};
|
|
21
31
|
__export(temporary_executor_exports, {
|
|
22
32
|
isRunningInTemporaryExecutor: () => isRunningInTemporaryExecutor
|
|
23
33
|
});
|
|
24
34
|
module.exports = __toCommonJS(temporary_executor_exports);
|
|
35
|
+
var import_node_process = __toESM(require("node:process"));
|
|
25
36
|
var import_platform = require("./constants/platform");
|
|
26
37
|
var import_normalize = require("./paths/normalize");
|
|
27
|
-
function isRunningInTemporaryExecutor(cwd =
|
|
28
|
-
const userAgent =
|
|
38
|
+
function isRunningInTemporaryExecutor(cwd = import_node_process.default.cwd()) {
|
|
39
|
+
const userAgent = import_node_process.default.env["npm_config_user_agent"];
|
|
29
40
|
if (userAgent?.includes("exec") || userAgent?.includes("npx") || userAgent?.includes("dlx")) {
|
|
30
41
|
return true;
|
|
31
42
|
}
|
|
32
43
|
const normalizedCwd = (0, import_normalize.normalizePath)(cwd);
|
|
33
|
-
const npmCache =
|
|
44
|
+
const npmCache = import_node_process.default.env["npm_config_cache"];
|
|
34
45
|
if (npmCache && normalizedCwd.includes((0, import_normalize.normalizePath)(npmCache))) {
|
|
35
46
|
return true;
|
|
36
47
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/lib",
|
|
3
|
-
"version": "5.11.
|
|
3
|
+
"version": "5.11.2",
|
|
4
4
|
"packageManager": "pnpm@10.33.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Core utilities and infrastructure for Socket.dev security tools",
|
|
@@ -734,7 +734,7 @@
|
|
|
734
734
|
"@socketregistry/is-unicode-supported": "1.0.5",
|
|
735
735
|
"@socketregistry/packageurl-js": "1.3.5",
|
|
736
736
|
"@socketregistry/yocto-spinner": "1.0.25",
|
|
737
|
-
"@socketsecurity/lib-stable": "npm:@socketsecurity/lib@5.11.
|
|
737
|
+
"@socketsecurity/lib-stable": "npm:@socketsecurity/lib@5.11.1",
|
|
738
738
|
"@types/node": "24.9.2",
|
|
739
739
|
"@typescript/native-preview": "7.0.0-dev.20250920.1",
|
|
740
740
|
"@vitest/coverage-v8": "4.0.3",
|