@socketsecurity/lib 5.18.1 → 5.19.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 +49 -0
- package/README.md +6 -5
- package/dist/abort.d.ts +3 -0
- package/dist/abort.js +1 -0
- package/dist/agent.d.ts +66 -49
- package/dist/agent.js +51 -50
- package/dist/ansi.d.ts +2 -5
- package/dist/ansi.js +3 -2
- package/dist/archives.d.ts +25 -21
- package/dist/archives.js +35 -34
- package/dist/argv/flags.d.ts +100 -91
- package/dist/argv/flags.js +88 -87
- package/dist/argv/parse.d.ts +30 -40
- package/dist/argv/parse.js +33 -32
- package/dist/arrays.d.ts +4 -8
- package/dist/arrays.js +1 -0
- package/dist/bin.d.ts +7 -5
- package/dist/bin.js +52 -29
- package/dist/cacache.d.ts +13 -12
- package/dist/cacache.js +9 -8
- package/dist/cache-with-ttl.d.ts +53 -35
- package/dist/cache-with-ttl.js +1 -0
- package/dist/colors.d.ts +5 -5
- package/dist/colors.js +1 -0
- package/dist/constants/agents.d.ts +5 -9
- package/dist/constants/agents.js +3 -2
- package/dist/constants/core.d.ts +5 -10
- package/dist/constants/core.js +2 -1
- package/dist/constants/encoding.d.ts +3 -3
- package/dist/constants/encoding.js +1 -0
- package/dist/constants/github.d.ts +3 -3
- package/dist/constants/github.js +1 -0
- package/dist/constants/licenses.d.ts +9 -2
- package/dist/constants/licenses.js +1 -0
- package/dist/constants/lifecycle-script-names.js +1 -0
- package/dist/constants/maintained-node-versions.d.ts +3 -0
- package/dist/constants/maintained-node-versions.js +1 -0
- package/dist/constants/node.d.ts +125 -16
- package/dist/constants/node.js +74 -73
- package/dist/constants/package-default-node-range.d.ts +3 -1
- package/dist/constants/package-default-node-range.js +2 -1
- package/dist/constants/package-default-socket-categories.d.ts +0 -1
- package/dist/constants/package-default-socket-categories.js +1 -0
- package/dist/constants/packages.d.ts +12 -17
- package/dist/constants/packages.js +31 -16
- package/dist/constants/platform.d.ts +1 -2
- package/dist/constants/platform.js +2 -1
- package/dist/constants/process.d.ts +18 -0
- package/dist/constants/process.js +1 -0
- package/dist/constants/socket.d.ts +4 -10
- package/dist/constants/socket.js +2 -1
- package/dist/constants/testing.d.ts +3 -3
- package/dist/constants/testing.js +1 -0
- package/dist/constants/time.d.ts +3 -4
- package/dist/constants/time.js +1 -0
- package/dist/constants/typescript.d.ts +10 -3
- package/dist/constants/typescript.js +5 -4
- package/dist/cover/code.d.ts +3 -0
- package/dist/cover/code.js +12 -12
- package/dist/cover/formatters.d.ts +12 -9
- package/dist/cover/formatters.js +19 -18
- package/dist/cover/type.d.ts +3 -0
- package/dist/cover/type.js +1 -0
- package/dist/cover/types.js +1 -0
- package/dist/debug.d.ts +32 -47
- package/dist/debug.js +97 -96
- package/dist/dlx/arborist.d.ts +134 -0
- package/dist/dlx/arborist.js +177 -0
- package/dist/dlx/binary.d.ts +25 -9
- package/dist/dlx/binary.js +34 -12
- package/dist/dlx/cache.d.ts +1 -0
- package/dist/dlx/cache.js +2 -1
- package/dist/dlx/detect.d.ts +15 -0
- package/dist/dlx/detect.js +28 -20
- package/dist/dlx/dir.d.ts +1 -11
- package/dist/dlx/dir.js +2 -12
- package/dist/dlx/integrity.d.ts +86 -0
- package/dist/dlx/integrity.js +112 -0
- package/dist/dlx/lockfile.d.ts +115 -0
- package/dist/dlx/lockfile.js +139 -0
- package/dist/dlx/manifest.d.ts +26 -1
- package/dist/dlx/manifest.js +9 -6
- package/dist/dlx/package.d.ts +58 -3
- package/dist/dlx/package.js +101 -74
- package/dist/dlx/packages.d.ts +1 -11
- package/dist/dlx/packages.js +3 -14
- package/dist/dlx/paths.d.ts +1 -0
- package/dist/dlx/paths.js +2 -1
- package/dist/effects/pulse-frames.js +1 -0
- package/dist/effects/text-shimmer.d.ts +13 -2
- package/dist/effects/text-shimmer.js +50 -46
- package/dist/effects/types.js +1 -0
- package/dist/effects/ultra.js +1 -0
- package/dist/env/ci.d.ts +6 -1
- package/dist/env/ci.js +1 -0
- package/dist/env/debug.d.ts +5 -1
- package/dist/env/debug.js +1 -0
- package/dist/env/github.d.ts +19 -23
- package/dist/env/github.js +5 -4
- package/dist/env/helpers.d.ts +21 -9
- package/dist/env/helpers.js +5 -11
- package/dist/env/home.d.ts +17 -4
- package/dist/env/home.js +2 -1
- package/dist/env/locale.d.ts +4 -3
- package/dist/env/locale.js +1 -0
- package/dist/env/node-auth-token.d.ts +5 -1
- package/dist/env/node-auth-token.js +1 -0
- package/dist/env/node-env.d.ts +5 -1
- package/dist/env/node-env.js +1 -0
- package/dist/env/npm.d.ts +4 -5
- package/dist/env/npm.js +1 -0
- package/dist/env/package-manager.d.ts +4 -3
- package/dist/env/package-manager.js +2 -1
- package/dist/env/path.d.ts +5 -1
- package/dist/env/path.js +1 -0
- package/dist/env/pre-commit.d.ts +5 -1
- package/dist/env/pre-commit.js +1 -0
- package/dist/env/rewire.d.ts +10 -0
- package/dist/env/rewire.js +7 -5
- package/dist/env/shell.d.ts +5 -1
- package/dist/env/shell.js +1 -0
- package/dist/env/socket-cli-shadow.d.ts +4 -5
- package/dist/env/socket-cli-shadow.js +1 -0
- package/dist/env/socket-cli.d.ts +4 -14
- package/dist/env/socket-cli.js +1 -0
- package/dist/env/socket.d.ts +6 -18
- package/dist/env/socket.js +4 -3
- package/dist/env/temp-dir.d.ts +4 -3
- package/dist/env/temp-dir.js +1 -0
- package/dist/env/term.d.ts +5 -1
- package/dist/env/term.js +1 -0
- package/dist/env/test.d.ts +4 -3
- package/dist/env/test.js +1 -0
- package/dist/env/windows.d.ts +4 -4
- package/dist/env/windows.js +1 -0
- package/dist/env/xdg.d.ts +4 -3
- package/dist/env/xdg.js +1 -0
- package/dist/env.d.ts +83 -23
- package/dist/env.js +112 -80
- package/dist/errors.js +1 -0
- package/dist/external/@npmcli/package-json.js +9 -3968
- package/dist/external/@socketregistry/packageurl-js.js +2 -2
- package/dist/external/debug.js +162 -328
- package/dist/external/external-pack.js +3 -2835
- package/dist/external/npm-pack.js +13939 -33342
- package/dist/external/zod.js +160 -7558
- package/dist/fs.d.ts +92 -113
- package/dist/fs.js +35 -35
- package/dist/git.d.ts +170 -164
- package/dist/git.js +113 -87
- package/dist/github.d.ts +249 -227
- package/dist/github.js +82 -81
- package/dist/globs.d.ts +31 -17
- package/dist/globs.js +51 -58
- package/dist/http-request.d.ts +99 -99
- package/dist/http-request.js +182 -156
- package/dist/ipc-cli.d.ts +28 -0
- package/dist/{utils/get-ipc.js → ipc-cli.js} +4 -3
- package/dist/ipc.d.ts +9 -299
- package/dist/ipc.js +18 -204
- package/dist/json/edit.d.ts +3 -1
- package/dist/json/edit.js +30 -30
- package/dist/json/format.d.ts +36 -36
- package/dist/json/format.js +22 -21
- package/dist/json/parse.d.ts +4 -2
- package/dist/json/parse.js +1 -0
- package/dist/json/types.js +1 -0
- package/dist/{links/index.d.ts → links.d.ts} +6 -2
- package/dist/{links/index.js → links.js} +5 -4
- package/dist/logger.d.ts +4 -6
- package/dist/logger.js +61 -53
- package/dist/memoization.d.ts +52 -49
- package/dist/memoization.js +55 -33
- package/dist/objects.d.ts +25 -44
- package/dist/objects.js +2 -1
- package/dist/package-extensions.d.ts +6 -0
- package/dist/package-extensions.js +2 -1
- package/dist/packages/edit.d.ts +3 -5
- package/dist/packages/edit.js +4 -3
- package/dist/packages/exports.d.ts +11 -14
- package/dist/packages/exports.js +11 -10
- package/dist/packages/isolation.d.ts +4 -0
- package/dist/packages/isolation.js +20 -19
- package/dist/packages/licenses.d.ts +3 -10
- package/dist/packages/licenses.js +2 -1
- package/dist/packages/manifest.d.ts +3 -3
- package/dist/packages/manifest.js +1 -0
- package/dist/packages/normalize.d.ts +3 -4
- package/dist/packages/normalize.js +1 -0
- package/dist/packages/operations.d.ts +3 -10
- package/dist/packages/operations.js +1 -0
- package/dist/packages/provenance.d.ts +10 -8
- package/dist/packages/provenance.js +55 -54
- package/dist/packages/specs.d.ts +3 -5
- package/dist/packages/specs.js +1 -0
- package/dist/packages/validation.d.ts +3 -3
- package/dist/packages/validation.js +1 -0
- package/dist/packages.d.ts +2 -17
- package/dist/packages.js +2 -1
- package/dist/paths/dirnames.d.ts +0 -2
- package/dist/paths/dirnames.js +1 -0
- package/dist/paths/exts.d.ts +0 -1
- package/dist/paths/exts.js +1 -0
- package/dist/paths/filenames.d.ts +0 -1
- package/dist/paths/filenames.js +1 -0
- package/dist/paths/globs.d.ts +0 -1
- package/dist/paths/globs.js +1 -0
- package/dist/paths/normalize.d.ts +115 -123
- package/dist/paths/normalize.js +128 -127
- package/dist/paths/packages.d.ts +3 -2
- package/dist/paths/packages.js +2 -1
- package/dist/paths/rewire.d.ts +9 -0
- package/dist/paths/rewire.js +5 -3
- package/dist/paths/socket.d.ts +37 -23
- package/dist/paths/socket.js +26 -25
- package/dist/performance.d.ts +87 -84
- package/dist/performance.js +97 -96
- package/dist/process-lock.d.ts +41 -1
- package/dist/process-lock.js +24 -17
- package/dist/promise-queue.d.ts +6 -0
- package/dist/promise-queue.js +1 -0
- package/dist/promises.d.ts +40 -55
- package/dist/promises.js +12 -11
- package/dist/regexps.d.ts +0 -5
- package/dist/regexps.js +1 -0
- package/dist/releases/github.d.ts +59 -63
- package/dist/releases/github.js +95 -100
- package/dist/releases/socket-btm.d.ts +9 -2
- package/dist/releases/socket-btm.js +32 -25
- package/dist/sea.d.ts +5 -0
- package/dist/sea.js +1 -0
- package/dist/shadow.d.ts +4 -0
- package/dist/shadow.js +1 -0
- package/dist/signal-exit.d.ts +7 -7
- package/dist/signal-exit.js +46 -45
- package/dist/sorts.d.ts +5 -7
- package/dist/sorts.js +11 -10
- package/dist/spawn.d.ts +96 -77
- package/dist/spawn.js +39 -38
- package/dist/spinner.d.ts +21 -22
- package/dist/spinner.js +15 -11
- package/dist/ssri.d.ts +31 -36
- package/dist/ssri.js +15 -14
- package/dist/stdio/_stream.d.ts +31 -0
- package/dist/stdio/_stream.js +57 -0
- package/dist/stdio/divider.d.ts +40 -36
- package/dist/stdio/divider.js +10 -9
- package/dist/stdio/footer.d.ts +20 -0
- package/dist/stdio/footer.js +12 -2
- package/dist/stdio/header.d.ts +4 -16
- package/dist/stdio/header.js +1 -9
- package/dist/stdio/stderr.d.ts +51 -39
- package/dist/stdio/stderr.js +19 -22
- package/dist/stdio/stdout.d.ts +54 -52
- package/dist/stdio/stdout.js +35 -33
- package/dist/streams.d.ts +4 -3
- package/dist/streams.js +1 -0
- package/dist/strings.d.ts +31 -85
- package/dist/strings.js +5 -49
- package/dist/suppress-warnings.d.ts +32 -15
- package/dist/suppress-warnings.js +14 -13
- package/dist/tables.d.ts +30 -26
- package/dist/tables.js +24 -23
- package/dist/temporary-executor.d.ts +4 -0
- package/dist/temporary-executor.js +1 -0
- package/dist/themes/context.d.ts +30 -26
- package/dist/themes/context.js +19 -18
- package/dist/themes/index.d.ts +0 -4
- package/dist/themes/index.js +1 -0
- package/dist/themes/themes.d.ts +1 -1
- package/dist/themes/themes.js +1 -0
- package/dist/themes/types.js +1 -0
- package/dist/themes/utils.d.ts +46 -43
- package/dist/themes/utils.js +45 -44
- package/dist/types.d.ts +48 -52
- package/dist/types.js +35 -35
- package/dist/url.d.ts +48 -53
- package/dist/url.js +38 -37
- package/dist/validation/json-parser.d.ts +19 -190
- package/dist/validation/json-parser.js +5 -69
- package/dist/validation/types.d.ts +9 -33
- package/dist/validation/types.js +1 -0
- package/dist/versions.d.ts +1 -0
- package/dist/versions.js +2 -1
- package/dist/words.d.ts +3 -6
- package/dist/words.js +1 -0
- package/dist/zod.js +1 -0
- package/package.json +34 -70
- package/dist/external/@inquirer/checkbox.js +0 -5
- package/dist/external/@inquirer/confirm.js +0 -5
- package/dist/external/@inquirer/input.js +0 -5
- package/dist/external/@inquirer/password.js +0 -5
- package/dist/external/@inquirer/search.js +0 -5
- package/dist/external/@inquirer/select.js +0 -5
- package/dist/functions.d.ts +0 -57
- package/dist/functions.js +0 -70
- package/dist/stdio/clear.d.ts +0 -140
- package/dist/stdio/clear.js +0 -95
- package/dist/stdio/mask.d.ts +0 -151
- package/dist/stdio/mask.js +0 -224
- package/dist/stdio/progress.d.ts +0 -148
- package/dist/stdio/progress.js +0 -212
- package/dist/stdio/prompts.d.ts +0 -195
- package/dist/stdio/prompts.js +0 -176
- package/dist/utils/get-ipc.d.ts +0 -15
package/dist/strings.d.ts
CHANGED
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
* Provides string processing, prefix application, and terminal output utilities.
|
|
4
4
|
*/
|
|
5
5
|
import { ansiRegex, stripAnsi } from './ansi';
|
|
6
|
-
// Import get-east-asian-width from external wrapper.
|
|
7
|
-
// This library implements Unicode Standard Annex #11 (East Asian Width).
|
|
8
|
-
// https://www.unicode.org/reports/tr11/
|
|
9
|
-
// Re-export ANSI utilities for backward compatibility.
|
|
10
6
|
export { ansiRegex, stripAnsi };
|
|
11
|
-
// Type definitions
|
|
12
7
|
declare const BlankStringBrand: unique symbol;
|
|
13
8
|
export type BlankString = string & {
|
|
14
9
|
[BlankStringBrand]: true;
|
|
@@ -17,10 +12,6 @@ declare const EmptyStringBrand: unique symbol;
|
|
|
17
12
|
export type EmptyString = string & {
|
|
18
13
|
[EmptyStringBrand]: true;
|
|
19
14
|
};
|
|
20
|
-
// IMPORTANT: Do not use destructuring here - use direct assignment instead.
|
|
21
|
-
// tsgo has a bug that incorrectly transpiles destructured exports, resulting in
|
|
22
|
-
// `exports.SomeName = void 0;` which causes runtime errors.
|
|
23
|
-
// See: https://github.com/SocketDev/socket-packageurl-js/issues/3
|
|
24
15
|
export declare const fromCharCode: (...codes: number[]) => string;
|
|
25
16
|
export interface ApplyLinePrefixOptions {
|
|
26
17
|
/**
|
|
@@ -52,39 +43,7 @@ export interface ApplyLinePrefixOptions {
|
|
|
52
43
|
* // Returns: 'no prefix'
|
|
53
44
|
* ```
|
|
54
45
|
*/
|
|
55
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
56
46
|
export declare function applyLinePrefix(str: string, options?: ApplyLinePrefixOptions | undefined): string;
|
|
57
|
-
/**
|
|
58
|
-
* Convert a camelCase string to kebab-case.
|
|
59
|
-
*
|
|
60
|
-
* Transforms camelCase strings by converting uppercase letters to lowercase
|
|
61
|
-
* and inserting hyphens before uppercase sequences. Handles consecutive
|
|
62
|
-
* uppercase letters (like "XMLHttpRequest") by treating them as a single word.
|
|
63
|
-
* Returns empty string for empty input.
|
|
64
|
-
*
|
|
65
|
-
* Note: This function only handles camelCase. For mixed formats including
|
|
66
|
-
* snake_case, use `toKebabCase()` instead.
|
|
67
|
-
*
|
|
68
|
-
* @param str - The camelCase string to convert
|
|
69
|
-
* @returns The kebab-case string
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* ```ts
|
|
73
|
-
* camelToKebab('helloWorld')
|
|
74
|
-
* // Returns: 'hello-world'
|
|
75
|
-
*
|
|
76
|
-
* camelToKebab('XMLHttpRequest')
|
|
77
|
-
* // Returns: 'xmlhttprequest'
|
|
78
|
-
*
|
|
79
|
-
* camelToKebab('iOS')
|
|
80
|
-
* // Returns: 'ios'
|
|
81
|
-
*
|
|
82
|
-
* camelToKebab('')
|
|
83
|
-
* // Returns: ''
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
87
|
-
export declare function camelToKebab(str: string): string;
|
|
88
47
|
/**
|
|
89
48
|
* Center text within a given width.
|
|
90
49
|
*
|
|
@@ -118,7 +77,6 @@ export declare function camelToKebab(str: string): string;
|
|
|
118
77
|
* // Returns: 'too long text' (no truncation, returned as-is)
|
|
119
78
|
* ```
|
|
120
79
|
*/
|
|
121
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
122
80
|
export declare function centerText(text: string, width: number): string;
|
|
123
81
|
export interface IndentStringOptions {
|
|
124
82
|
/**
|
|
@@ -150,7 +108,6 @@ export interface IndentStringOptions {
|
|
|
150
108
|
* // Returns: ' single line' (default: 1 space)
|
|
151
109
|
* ```
|
|
152
110
|
*/
|
|
153
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
154
111
|
export declare function indentString(str: string, options?: IndentStringOptions | undefined): string;
|
|
155
112
|
/**
|
|
156
113
|
* Check if a value is a blank string (empty or only whitespace).
|
|
@@ -183,7 +140,6 @@ export declare function indentString(str: string, options?: IndentStringOptions
|
|
|
183
140
|
* // Returns: false
|
|
184
141
|
* ```
|
|
185
142
|
*/
|
|
186
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
187
143
|
export declare function isBlankString(value: unknown): value is BlankString;
|
|
188
144
|
/**
|
|
189
145
|
* Check if a value is a non-empty string.
|
|
@@ -214,7 +170,6 @@ export declare function isBlankString(value: unknown): value is BlankString;
|
|
|
214
170
|
* // Returns: false
|
|
215
171
|
* ```
|
|
216
172
|
*/
|
|
217
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
218
173
|
export declare function isNonEmptyString(value: unknown): value is Exclude<string, EmptyString>;
|
|
219
174
|
/**
|
|
220
175
|
* Repeat a string a specified number of times.
|
|
@@ -241,7 +196,6 @@ export declare function isNonEmptyString(value: unknown): value is Exclude<strin
|
|
|
241
196
|
* // Returns: ''
|
|
242
197
|
* ```
|
|
243
198
|
*/
|
|
244
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
245
199
|
export declare function repeatString(str: string, count: number): string;
|
|
246
200
|
export interface SearchOptions {
|
|
247
201
|
/**
|
|
@@ -283,38 +237,7 @@ export interface SearchOptions {
|
|
|
283
237
|
* // Returns: -1 (starts searching from 'world', no match)
|
|
284
238
|
* ```
|
|
285
239
|
*/
|
|
286
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
287
240
|
export declare function search(str: string, regexp: RegExp, options?: SearchOptions | undefined): number;
|
|
288
|
-
/**
|
|
289
|
-
* Strip the Byte Order Mark (BOM) from the beginning of a string.
|
|
290
|
-
*
|
|
291
|
-
* The BOM (U+FEFF) is a Unicode character that can appear at the start of
|
|
292
|
-
* a text file to indicate byte order and encoding. In UTF-16 (JavaScript's
|
|
293
|
-
* internal string representation), it appears as 0xFEFF. This function
|
|
294
|
-
* removes it if present, leaving the rest of the string unchanged.
|
|
295
|
-
*
|
|
296
|
-
* Most text processing doesn't need to handle the BOM explicitly, but it
|
|
297
|
-
* can cause issues when parsing JSON, CSV, or other structured data formats
|
|
298
|
-
* that don't expect a leading invisible character.
|
|
299
|
-
*
|
|
300
|
-
* @param str - The string to strip BOM from
|
|
301
|
-
* @returns The string without BOM
|
|
302
|
-
*
|
|
303
|
-
* @example
|
|
304
|
-
* ```ts
|
|
305
|
-
* stripBom('\uFEFFhello world')
|
|
306
|
-
* // Returns: 'hello world'
|
|
307
|
-
*
|
|
308
|
-
* stripBom('hello world')
|
|
309
|
-
* // Returns: 'hello world' (no BOM to strip)
|
|
310
|
-
*
|
|
311
|
-
* stripBom('')
|
|
312
|
-
* // Returns: ''
|
|
313
|
-
* ```
|
|
314
|
-
*/
|
|
315
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
316
|
-
export declare function stripBom(str: string): string;
|
|
317
|
-
/* c8 ignore stop */
|
|
318
241
|
/**
|
|
319
242
|
* Get the visual width of a string in terminal columns.
|
|
320
243
|
*
|
|
@@ -392,11 +315,36 @@ export declare function stripBom(str: string): string;
|
|
|
392
315
|
* stringWidth('')
|
|
393
316
|
* // Returns: 0
|
|
394
317
|
* ```
|
|
395
|
-
*
|
|
396
|
-
* @throws {TypeError} When input is not a string
|
|
397
318
|
*/
|
|
398
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
399
319
|
export declare function stringWidth(text: string): number;
|
|
320
|
+
/**
|
|
321
|
+
* Strip the Byte Order Mark (BOM) from the beginning of a string.
|
|
322
|
+
*
|
|
323
|
+
* The BOM (U+FEFF) is a Unicode character that can appear at the start of
|
|
324
|
+
* a text file to indicate byte order and encoding. In UTF-16 (JavaScript's
|
|
325
|
+
* internal string representation), it appears as 0xFEFF. This function
|
|
326
|
+
* removes it if present, leaving the rest of the string unchanged.
|
|
327
|
+
*
|
|
328
|
+
* Most text processing doesn't need to handle the BOM explicitly, but it
|
|
329
|
+
* can cause issues when parsing JSON, CSV, or other structured data formats
|
|
330
|
+
* that don't expect a leading invisible character.
|
|
331
|
+
*
|
|
332
|
+
* @param str - The string to strip BOM from
|
|
333
|
+
* @returns The string without BOM
|
|
334
|
+
*
|
|
335
|
+
* @example
|
|
336
|
+
* ```ts
|
|
337
|
+
* stripBom('\uFEFFhello world')
|
|
338
|
+
* // Returns: 'hello world'
|
|
339
|
+
*
|
|
340
|
+
* stripBom('hello world')
|
|
341
|
+
* // Returns: 'hello world' (no BOM to strip)
|
|
342
|
+
*
|
|
343
|
+
* stripBom('')
|
|
344
|
+
* // Returns: ''
|
|
345
|
+
* ```
|
|
346
|
+
*/
|
|
347
|
+
export declare function stripBom(str: string): string;
|
|
400
348
|
/**
|
|
401
349
|
* Convert a string to kebab-case (handles camelCase and snake_case).
|
|
402
350
|
*
|
|
@@ -405,8 +353,8 @@ export declare function stringWidth(text: string): number;
|
|
|
405
353
|
* - Inserting hyphens before uppercase letters (for camelCase)
|
|
406
354
|
* - Replacing underscores with hyphens (for snake_case)
|
|
407
355
|
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
356
|
+
* Handles mixed formats (camelCase, snake_case, acronyms) in one pass.
|
|
357
|
+
* Returns empty string for empty input.
|
|
410
358
|
*
|
|
411
359
|
* @param str - The string to convert
|
|
412
360
|
* @returns The kebab-case string
|
|
@@ -423,13 +371,12 @@ export declare function stringWidth(text: string): number;
|
|
|
423
371
|
* // Returns: 'xmlhttp-request'
|
|
424
372
|
*
|
|
425
373
|
* toKebabCase('iOS_Version')
|
|
426
|
-
* // Returns: '
|
|
374
|
+
* // Returns: 'i-os-version'
|
|
427
375
|
*
|
|
428
376
|
* toKebabCase('')
|
|
429
377
|
* // Returns: ''
|
|
430
378
|
* ```
|
|
431
379
|
*/
|
|
432
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
433
380
|
export declare function toKebabCase(str: string): string;
|
|
434
381
|
/**
|
|
435
382
|
* Trim newlines from the beginning and end of a string.
|
|
@@ -464,5 +411,4 @@ export declare function toKebabCase(str: string): string;
|
|
|
464
411
|
* // Returns: 'hello'
|
|
465
412
|
* ```
|
|
466
413
|
*/
|
|
467
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
468
414
|
export declare function trimNewlines(str: string): string;
|
package/dist/strings.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
+
"use strict";
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -21,7 +22,6 @@ var strings_exports = {};
|
|
|
21
22
|
__export(strings_exports, {
|
|
22
23
|
ansiRegex: () => import_ansi.ansiRegex,
|
|
23
24
|
applyLinePrefix: () => applyLinePrefix,
|
|
24
|
-
camelToKebab: () => camelToKebab,
|
|
25
25
|
centerText: () => centerText,
|
|
26
26
|
fromCharCode: () => fromCharCode,
|
|
27
27
|
indentString: () => indentString,
|
|
@@ -56,49 +56,6 @@ function applyLinePrefix(str, options) {
|
|
|
56
56
|
${prefix}`) : str}` : str;
|
|
57
57
|
}
|
|
58
58
|
// @__NO_SIDE_EFFECTS__
|
|
59
|
-
function camelToKebab(str) {
|
|
60
|
-
const { length } = str;
|
|
61
|
-
if (!length) {
|
|
62
|
-
return "";
|
|
63
|
-
}
|
|
64
|
-
let result = "";
|
|
65
|
-
let i = 0;
|
|
66
|
-
while (i < length) {
|
|
67
|
-
const char = str[i];
|
|
68
|
-
if (!char) {
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
const charCode = char.charCodeAt(0);
|
|
72
|
-
const isUpperCase = charCode >= 65 && charCode <= 90;
|
|
73
|
-
if (isUpperCase) {
|
|
74
|
-
if (result.length > 0) {
|
|
75
|
-
result += "-";
|
|
76
|
-
}
|
|
77
|
-
while (i < length) {
|
|
78
|
-
const currChar = str[i];
|
|
79
|
-
if (!currChar) {
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
const currCharCode = currChar.charCodeAt(0);
|
|
83
|
-
const isCurrUpper = currCharCode >= 65 && currCharCode <= 90;
|
|
84
|
-
if (isCurrUpper) {
|
|
85
|
-
result += fromCharCode(
|
|
86
|
-
currCharCode + 32
|
|
87
|
-
/*'a'-'A'*/
|
|
88
|
-
);
|
|
89
|
-
i += 1;
|
|
90
|
-
} else {
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
} else {
|
|
95
|
-
result += char;
|
|
96
|
-
i += 1;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return result;
|
|
100
|
-
}
|
|
101
|
-
// @__NO_SIDE_EFFECTS__
|
|
102
59
|
function centerText(text, width) {
|
|
103
60
|
const textLength = (0, import_ansi.stripAnsi)(text).length;
|
|
104
61
|
if (textLength >= width) {
|
|
@@ -143,10 +100,6 @@ function search(str, regexp, options) {
|
|
|
143
100
|
const result = str.slice(offset).search(regexp);
|
|
144
101
|
return result === -1 ? -1 : result + offset;
|
|
145
102
|
}
|
|
146
|
-
// @__NO_SIDE_EFFECTS__
|
|
147
|
-
function stripBom(str) {
|
|
148
|
-
return str.length > 0 && str.charCodeAt(0) === 65279 ? str.slice(1) : str;
|
|
149
|
-
}
|
|
150
103
|
const segmenter = new Intl.Segmenter();
|
|
151
104
|
let zeroWidthClusterRegex;
|
|
152
105
|
let leadingNonPrintingRegex;
|
|
@@ -201,6 +154,10 @@ function stringWidth(text) {
|
|
|
201
154
|
return width;
|
|
202
155
|
}
|
|
203
156
|
// @__NO_SIDE_EFFECTS__
|
|
157
|
+
function stripBom(str) {
|
|
158
|
+
return str.length > 0 && str.charCodeAt(0) === 65279 ? str.slice(1) : str;
|
|
159
|
+
}
|
|
160
|
+
// @__NO_SIDE_EFFECTS__
|
|
204
161
|
function toKebabCase(str) {
|
|
205
162
|
if (!str.length) {
|
|
206
163
|
return str;
|
|
@@ -245,7 +202,6 @@ function trimNewlines(str) {
|
|
|
245
202
|
0 && (module.exports = {
|
|
246
203
|
ansiRegex,
|
|
247
204
|
applyLinePrefix,
|
|
248
|
-
camelToKebab,
|
|
249
205
|
centerText,
|
|
250
206
|
fromCharCode,
|
|
251
207
|
indentString,
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
export declare function suppressMaxListenersWarning(): void;
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
* @fileoverview Utilities to suppress specific process warnings.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Restore the original process.emitWarning function.
|
|
6
|
+
* Call this to re-enable all warnings after suppressing them.
|
|
6
7
|
*
|
|
7
8
|
* @example
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* ```typescript
|
|
10
|
+
* suppressMaxListenersWarning()
|
|
11
|
+
* // ... do work ...
|
|
12
|
+
* restoreWarnings() // Re-enable all warnings
|
|
13
|
+
* ```
|
|
11
14
|
*/
|
|
12
|
-
export declare function
|
|
15
|
+
export declare function restoreWarnings(): void;
|
|
13
16
|
/**
|
|
14
17
|
* Set max listeners on an EventTarget (like AbortSignal) to avoid TypeError.
|
|
15
18
|
*
|
|
@@ -35,17 +38,31 @@ export declare function suppressWarningType(warningType: string): void;
|
|
|
35
38
|
*/
|
|
36
39
|
export declare function setMaxEventTargetListeners(target: EventTarget | AbortSignal | undefined, maxListeners?: number): void;
|
|
37
40
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
41
|
+
* Suppress MaxListenersExceededWarning messages.
|
|
42
|
+
* This is useful in tests or scripts where multiple listeners are expected.
|
|
40
43
|
*
|
|
41
44
|
* @example
|
|
42
|
-
*
|
|
45
|
+
* import { suppressMaxListenersWarning } from '@socketsecurity/lib/suppress-warnings'
|
|
46
|
+
*
|
|
43
47
|
* suppressMaxListenersWarning()
|
|
44
|
-
* // ... do work ...
|
|
45
|
-
* restoreWarnings() // Re-enable all warnings
|
|
46
|
-
* ```
|
|
47
48
|
*/
|
|
48
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Silence `MaxListenersExceededWarning` messages from `process.emitWarning`.
|
|
51
|
+
* Installs a single shared wrapper around `process.emitWarning` on first call
|
|
52
|
+
* so repeat invocations are cheap.
|
|
53
|
+
*/
|
|
54
|
+
export declare function suppressMaxListenersWarning(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Suppress all process warnings of a specific type.
|
|
57
|
+
*
|
|
58
|
+
* @param warningType - The warning type to suppress (e.g., 'DeprecationWarning', 'ExperimentalWarning')
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* import { suppressWarningType } from '@socketsecurity/lib/suppress-warnings'
|
|
62
|
+
*
|
|
63
|
+
* suppressWarningType('ExperimentalWarning')
|
|
64
|
+
*/
|
|
65
|
+
export declare function suppressWarningType(warningType: string): void;
|
|
49
66
|
/**
|
|
50
67
|
* Suppress warnings temporarily within a callback.
|
|
51
68
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
+
"use strict";
|
|
3
4
|
var __create = Object.create;
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
5
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -64,13 +65,12 @@ function setupSuppression() {
|
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
setupSuppression();
|
|
68
|
+
function restoreWarnings() {
|
|
69
|
+
if (originalEmitWarning) {
|
|
70
|
+
import_node_process.default.emitWarning = originalEmitWarning;
|
|
71
|
+
originalEmitWarning = void 0;
|
|
72
|
+
suppressedWarnings.clear();
|
|
73
|
+
}
|
|
74
74
|
}
|
|
75
75
|
function setMaxEventTargetListeners(target, maxListeners = 10) {
|
|
76
76
|
if (!target) {
|
|
@@ -85,12 +85,13 @@ function setMaxEventTargetListeners(target, maxListeners = 10) {
|
|
|
85
85
|
target[kMaxEventTargetListeners] = maxListeners;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
function suppressMaxListenersWarning() {
|
|
89
|
+
suppressedWarnings.add("MaxListenersExceededWarning");
|
|
90
|
+
setupSuppression();
|
|
91
|
+
}
|
|
92
|
+
function suppressWarningType(warningType) {
|
|
93
|
+
suppressedWarnings.add(warningType);
|
|
94
|
+
setupSuppression();
|
|
94
95
|
}
|
|
95
96
|
async function withSuppressedWarnings(warningType, callback) {
|
|
96
97
|
const wasAlreadySuppressed = suppressedWarnings.has(warningType);
|
package/dist/tables.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Table formatting utilities for CLI applications.
|
|
3
|
+
* Provides ASCII table rendering with borders, alignment, and colors.
|
|
4
|
+
*/
|
|
1
5
|
export type ColumnAlignment = 'left' | 'right' | 'center';
|
|
2
6
|
/**
|
|
3
7
|
* Table column configuration.
|
|
@@ -10,60 +14,60 @@ export type TableColumn = {
|
|
|
10
14
|
color?: ((value: string) => string) | undefined;
|
|
11
15
|
};
|
|
12
16
|
/**
|
|
13
|
-
* Format data as
|
|
17
|
+
* Format data as a simple table without borders.
|
|
18
|
+
* Lighter weight alternative to formatTable().
|
|
14
19
|
*
|
|
15
20
|
* @param data - Array of data objects
|
|
16
21
|
* @param columns - Column configuration
|
|
17
22
|
* @returns Formatted table string
|
|
18
23
|
*
|
|
19
24
|
* @example
|
|
20
|
-
* import {
|
|
25
|
+
* import { formatSimpleTable } from '@socketsecurity/lib/tables'
|
|
21
26
|
* import colors from 'yoctocolors-cjs'
|
|
22
27
|
*
|
|
23
28
|
* const data = [
|
|
24
|
-
* { name: 'lodash', version: '4.17.21'
|
|
25
|
-
* { name: 'react', version: '18.2.0'
|
|
29
|
+
* { name: 'lodash', version: '4.17.21' },
|
|
30
|
+
* { name: 'react', version: '18.2.0' },
|
|
26
31
|
* ]
|
|
27
32
|
* const columns = [
|
|
28
33
|
* { key: 'name', header: 'Package' },
|
|
29
|
-
* { key: 'version', header: 'Version'
|
|
30
|
-
* { key: 'issues', header: 'Issues', align: 'right', color: (v) => v === '0' ? colors.green(v) : colors.red(v) },
|
|
34
|
+
* { key: 'version', header: 'Version' },
|
|
31
35
|
* ]
|
|
32
|
-
* console.log(
|
|
36
|
+
* console.log(formatSimpleTable(data, columns))
|
|
33
37
|
* // Output:
|
|
34
|
-
* //
|
|
35
|
-
* //
|
|
36
|
-
* //
|
|
37
|
-
* //
|
|
38
|
-
* // │ react │ 18.2.0 │ 2 │
|
|
39
|
-
* // └─────────┴─────────┴────────┘
|
|
38
|
+
* // Package Version
|
|
39
|
+
* // ─────── ───────
|
|
40
|
+
* // lodash 4.17.21
|
|
41
|
+
* // react 18.2.0
|
|
40
42
|
*/
|
|
41
|
-
export declare function
|
|
43
|
+
export declare function formatSimpleTable(data: Array<Record<string, unknown>>, columns: TableColumn[]): string;
|
|
42
44
|
/**
|
|
43
|
-
* Format data as
|
|
44
|
-
* Lighter weight alternative to formatTable().
|
|
45
|
+
* Format data as an ASCII table with borders.
|
|
45
46
|
*
|
|
46
47
|
* @param data - Array of data objects
|
|
47
48
|
* @param columns - Column configuration
|
|
48
49
|
* @returns Formatted table string
|
|
49
50
|
*
|
|
50
51
|
* @example
|
|
51
|
-
* import {
|
|
52
|
+
* import { formatTable } from '@socketsecurity/lib/tables'
|
|
52
53
|
* import colors from 'yoctocolors-cjs'
|
|
53
54
|
*
|
|
54
55
|
* const data = [
|
|
55
|
-
* { name: 'lodash', version: '4.17.21' },
|
|
56
|
-
* { name: 'react', version: '18.2.0' },
|
|
56
|
+
* { name: 'lodash', version: '4.17.21', issues: 0 },
|
|
57
|
+
* { name: 'react', version: '18.2.0', issues: 2 },
|
|
57
58
|
* ]
|
|
58
59
|
* const columns = [
|
|
59
60
|
* { key: 'name', header: 'Package' },
|
|
60
|
-
* { key: 'version', header: 'Version' },
|
|
61
|
+
* { key: 'version', header: 'Version', align: 'center' },
|
|
62
|
+
* { key: 'issues', header: 'Issues', align: 'right', color: (v) => v === '0' ? colors.green(v) : colors.red(v) },
|
|
61
63
|
* ]
|
|
62
|
-
* console.log(
|
|
64
|
+
* console.log(formatTable(data, columns))
|
|
63
65
|
* // Output:
|
|
64
|
-
* //
|
|
65
|
-
* //
|
|
66
|
-
* //
|
|
67
|
-
* //
|
|
66
|
+
* // ┌─────────┬─────────┬────────┐
|
|
67
|
+
* // │ Package │ Version │ Issues │
|
|
68
|
+
* // ├─────────┼─────────┼────────┤
|
|
69
|
+
* // │ lodash │ 4.17.21 │ 0 │
|
|
70
|
+
* // │ react │ 18.2.0 │ 2 │
|
|
71
|
+
* // └─────────┴─────────┴────────┘
|
|
68
72
|
*/
|
|
69
|
-
export declare function
|
|
73
|
+
export declare function formatTable(data: Array<Record<string, unknown>>, columns: TableColumn[]): string;
|
package/dist/tables.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
+
"use strict";
|
|
3
4
|
var __create = Object.create;
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
5
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -54,7 +55,7 @@ function padText(text, width, align = "left") {
|
|
|
54
55
|
return text + " ".repeat(padding);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
+
function formatSimpleTable(data, columns) {
|
|
58
59
|
if (data.length === 0) {
|
|
59
60
|
return "(no data)";
|
|
60
61
|
}
|
|
@@ -66,17 +67,12 @@ function formatTable(data, columns) {
|
|
|
66
67
|
return col.width ?? Math.max(headerWidth, maxDataWidth);
|
|
67
68
|
});
|
|
68
69
|
const lines = [];
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
const headerCells = columns.map((col, i) => {
|
|
72
|
-
const text = import_yoctocolors_cjs.default.bold(col.header);
|
|
73
|
-
return padText(text, widths[i], col.align);
|
|
74
|
-
});
|
|
75
|
-
lines.push(
|
|
76
|
-
import_yoctocolors_cjs.default.dim("\u2502 ") + headerCells.join(import_yoctocolors_cjs.default.dim(" \u2502 ")) + import_yoctocolors_cjs.default.dim(" \u2502")
|
|
70
|
+
const headerCells = columns.map(
|
|
71
|
+
(col, i) => padText(import_yoctocolors_cjs.default.bold(col.header), widths[i], col.align)
|
|
77
72
|
);
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
lines.push(headerCells.join(" "));
|
|
74
|
+
const separators = widths.map((w) => import_yoctocolors_cjs.default.dim("\u2500".repeat(w)));
|
|
75
|
+
lines.push(separators.join(" "));
|
|
80
76
|
for (const row of data) {
|
|
81
77
|
const cells = columns.map((col, i) => {
|
|
82
78
|
let value = String(row[col.key] ?? "");
|
|
@@ -85,15 +81,11 @@ function formatTable(data, columns) {
|
|
|
85
81
|
}
|
|
86
82
|
return padText(value, widths[i], col.align);
|
|
87
83
|
});
|
|
88
|
-
lines.push(
|
|
89
|
-
import_yoctocolors_cjs.default.dim("\u2502 ") + cells.join(import_yoctocolors_cjs.default.dim(" \u2502 ")) + import_yoctocolors_cjs.default.dim(" \u2502")
|
|
90
|
-
);
|
|
84
|
+
lines.push(cells.join(" "));
|
|
91
85
|
}
|
|
92
|
-
const bottomBorder = `\u2514\u2500${widths.map((w) => "\u2500".repeat(w)).join("\u2500\u2534\u2500")}\u2500\u2518`;
|
|
93
|
-
lines.push(import_yoctocolors_cjs.default.dim(bottomBorder));
|
|
94
86
|
return lines.join("\n");
|
|
95
87
|
}
|
|
96
|
-
function
|
|
88
|
+
function formatTable(data, columns) {
|
|
97
89
|
if (data.length === 0) {
|
|
98
90
|
return "(no data)";
|
|
99
91
|
}
|
|
@@ -105,12 +97,17 @@ function formatSimpleTable(data, columns) {
|
|
|
105
97
|
return col.width ?? Math.max(headerWidth, maxDataWidth);
|
|
106
98
|
});
|
|
107
99
|
const lines = [];
|
|
108
|
-
const
|
|
109
|
-
|
|
100
|
+
const topBorder = `\u250C\u2500${widths.map((w) => "\u2500".repeat(w)).join("\u2500\u252C\u2500")}\u2500\u2510`;
|
|
101
|
+
lines.push(import_yoctocolors_cjs.default.dim(topBorder));
|
|
102
|
+
const headerCells = columns.map((col, i) => {
|
|
103
|
+
const text = import_yoctocolors_cjs.default.bold(col.header);
|
|
104
|
+
return padText(text, widths[i], col.align);
|
|
105
|
+
});
|
|
106
|
+
lines.push(
|
|
107
|
+
import_yoctocolors_cjs.default.dim("\u2502 ") + headerCells.join(import_yoctocolors_cjs.default.dim(" \u2502 ")) + import_yoctocolors_cjs.default.dim(" \u2502")
|
|
110
108
|
);
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
lines.push(separators.join(" "));
|
|
109
|
+
const headerSep = `\u251C\u2500${widths.map((w) => "\u2500".repeat(w)).join("\u2500\u253C\u2500")}\u2500\u2524`;
|
|
110
|
+
lines.push(import_yoctocolors_cjs.default.dim(headerSep));
|
|
114
111
|
for (const row of data) {
|
|
115
112
|
const cells = columns.map((col, i) => {
|
|
116
113
|
let value = String(row[col.key] ?? "");
|
|
@@ -119,8 +116,12 @@ function formatSimpleTable(data, columns) {
|
|
|
119
116
|
}
|
|
120
117
|
return padText(value, widths[i], col.align);
|
|
121
118
|
});
|
|
122
|
-
lines.push(
|
|
119
|
+
lines.push(
|
|
120
|
+
import_yoctocolors_cjs.default.dim("\u2502 ") + cells.join(import_yoctocolors_cjs.default.dim(" \u2502 ")) + import_yoctocolors_cjs.default.dim(" \u2502")
|
|
121
|
+
);
|
|
123
122
|
}
|
|
123
|
+
const bottomBorder = `\u2514\u2500${widths.map((w) => "\u2500".repeat(w)).join("\u2500\u2534\u2500")}\u2500\u2518`;
|
|
124
|
+
lines.push(import_yoctocolors_cjs.default.dim(bottomBorder));
|
|
124
125
|
return lines.join("\n");
|
|
125
126
|
}
|
|
126
127
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Temporary package executor detection utilities for Socket ecosystem.
|
|
3
|
+
* Identifies and handles temporary execution contexts such as npx, pnpm dlx, and yarn dlx.
|
|
4
|
+
*/
|
|
1
5
|
/**
|
|
2
6
|
* Detects if the current process is running in a temporary package execution context
|
|
3
7
|
* such as npm exec, npx, pnpm dlx, or yarn dlx.
|