@socketsecurity/lib 6.0.5 → 6.0.6
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 +18 -0
- package/dist/ai/discover.js +3 -2
- package/dist/ai/spawn.js +8 -5
- package/dist/ai/worktree.js +11 -6
- package/dist/ansi/strip.js +2 -2
- package/dist/archives/_internal.js +4 -4
- package/dist/archives/zip.js +1 -1
- package/dist/arrays/_internal.js +2 -2
- package/dist/arrays/chunk.js +1 -1
- package/dist/arrays/join.js +2 -2
- package/dist/arrays/unique.js +1 -1
- package/dist/bin/acorn-bindgen.cjs +769 -0
- package/dist/bin/acorn.wasm +0 -0
- package/dist/bin/check-primordials.js +3 -2
- package/dist/bin/check.js +3 -2
- package/dist/bin/exec.js +1 -1
- package/dist/bin/prim.cjs +39064 -0
- package/dist/bin/resolve.js +1 -1
- package/dist/colors/socket-palette.js +2 -2
- package/dist/compression/_internal.js +3 -2
- package/dist/compression/brotli.js +5 -12
- package/dist/compression/gzip.js +5 -13
- package/dist/constants/agents.js +4 -4
- package/dist/constants/packages.js +6 -6
- package/dist/constants/socket.js +1 -1
- package/dist/crypto/hash.js +2 -2
- package/dist/debug/_internal.js +2 -2
- package/dist/debug/caller-info.js +1 -1
- package/dist/debug/namespace.js +5 -5
- package/dist/debug/output.js +3 -3
- package/dist/dlx/binary-download.js +3 -2
- package/dist/eco/npm/npm/flags.js +5 -5
- package/dist/eco/npm/pnpm/flags.js +3 -3
- package/dist/env/boolean.js +1 -1
- package/dist/env/ci.js +1 -1
- package/dist/env/debug.js +1 -1
- package/dist/env/github.js +8 -8
- package/dist/env/home.js +1 -1
- package/dist/env/locale.js +3 -3
- package/dist/env/node-auth-token.js +1 -1
- package/dist/env/node-env.js +1 -1
- package/dist/env/npm.js +5 -5
- package/dist/env/number.js +1 -1
- package/dist/env/package-manager.js +3 -3
- package/dist/env/path.js +1 -1
- package/dist/env/pre-commit.js +1 -1
- package/dist/env/rewire.js +2 -2
- package/dist/env/shell.js +1 -1
- package/dist/env/socket-cli.js +13 -13
- package/dist/env/socket.js +33 -32
- package/dist/env/string.js +1 -1
- package/dist/env/temp-dir.js +3 -3
- package/dist/env/term.js +1 -1
- package/dist/env/test.js +3 -3
- package/dist/env/windows.js +4 -4
- package/dist/env/xdg.js +3 -3
- package/dist/events/exit/_internal.js +5 -5
- package/dist/events/exit/handler.js +1 -1
- package/dist/events/exit/intercept.js +2 -2
- package/dist/events/exit/lifecycle.js +3 -3
- package/dist/events/exit/signals.js +1 -1
- package/dist/external/@sinclair/typebox/value.js +5 -1
- package/dist/external/@sinclair/typebox.js +5 -1
- package/dist/external/@socketregistry/packageurl-js.js +27 -0
- package/dist/external-tools/bazel/resolve.js +2 -1
- package/dist/external-tools/cdxgen/resolve.js +2 -1
- package/dist/external-tools/from-pip-venv.d.ts +73 -0
- package/dist/external-tools/from-pip-venv.js +98 -0
- package/dist/external-tools/janus/asset-names.js +1 -1
- package/dist/external-tools/janus/from-download.js +3 -5
- package/dist/external-tools/janus/resolve.js +2 -1
- package/dist/external-tools/jre/from-download.js +2 -1
- package/dist/external-tools/jre/resolve.js +2 -1
- package/dist/external-tools/manifest.js +7 -5
- package/dist/external-tools/opengrep/resolve.js +2 -1
- package/dist/external-tools/sbt/resolve.js +2 -1
- package/dist/external-tools/skillspector/from-dlx.d.ts +24 -0
- package/dist/external-tools/skillspector/from-dlx.js +41 -0
- package/dist/external-tools/skillspector/from-path.d.ts +8 -0
- package/dist/external-tools/skillspector/from-path.js +32 -0
- package/dist/external-tools/skillspector/from-vfs.d.ts +8 -0
- package/dist/external-tools/skillspector/from-vfs.js +27 -0
- package/dist/external-tools/skillspector/resolve.d.ts +34 -0
- package/dist/external-tools/skillspector/resolve.js +53 -0
- package/dist/external-tools/skillspector/types.d.ts +24 -0
- package/dist/external-tools/skillspector/types.js +2 -0
- package/dist/external-tools/synp/resolve.js +2 -1
- package/dist/external-tools/trivy/resolve.js +2 -1
- package/dist/external-tools/trufflehog/resolve.js +2 -1
- package/dist/external-tools/uv/resolve.js +2 -1
- package/dist/fs/access.js +4 -4
- package/dist/fs/encoding.js +2 -2
- package/dist/fs/find-up.js +2 -2
- package/dist/fs/inspect.js +6 -6
- package/dist/fs/read-dir.js +3 -3
- package/dist/fs/read-file.js +6 -6
- package/dist/fs/read-json.js +2 -2
- package/dist/fs/safe.js +2 -2
- package/dist/fs/unique.js +1 -1
- package/dist/fs/validate.js +1 -1
- package/dist/fs/write-json.js +1 -1
- package/dist/git/_internal.js +2 -1
- package/dist/globs/_internal.js +4 -4
- package/dist/globs/match.js +4 -3
- package/dist/globs/matcher.js +2 -2
- package/dist/globs/stream.js +1 -1
- package/dist/http-request/browser.js +17 -11
- package/dist/http-request/download.js +1 -1
- package/dist/http-request/headers.d.ts +32 -3
- package/dist/http-request/headers.js +42 -13
- package/dist/http-request/request-attempt.js +1 -0
- package/dist/http-request/request-types.d.ts +5 -0
- package/dist/http-request/request.js +32 -15
- package/dist/http-request/response-reader.d.ts +12 -1
- package/dist/http-request/response-reader.js +22 -2
- package/dist/http-request/user-agent.js +1 -1
- package/dist/json/edit.js +1 -1
- package/dist/json/parse.js +4 -4
- package/dist/logger/colors.js +2 -2
- package/dist/logger/console.js +1 -1
- package/dist/logger/symbols.js +1 -1
- package/dist/node/async-hooks.js +2 -2
- package/dist/node/child-process.js +2 -2
- package/dist/node/crypto.js +2 -2
- package/dist/node/events.js +2 -2
- package/dist/node/fs-promises.js +2 -2
- package/dist/node/fs.js +2 -2
- package/dist/node/http.js +2 -2
- package/dist/node/https.js +2 -2
- package/dist/node/module.js +3 -3
- package/dist/node/os.js +2 -2
- package/dist/node/path.js +2 -2
- package/dist/node/timers-promises.js +2 -2
- package/dist/node/url.js +2 -2
- package/dist/node/util.js +2 -2
- package/dist/objects/getters.js +2 -2
- package/dist/objects/inspect.js +3 -3
- package/dist/objects/mutate.js +1 -1
- package/dist/objects/predicates.js +4 -4
- package/dist/objects/sort.js +4 -4
- package/dist/packages/edit-class.js +1 -1
- package/dist/packages/edit.js +2 -2
- package/dist/packages/exports.js +6 -6
- package/dist/packages/licenses.js +8 -8
- package/dist/packages/manifest.js +3 -3
- package/dist/packages/normalize.js +4 -4
- package/dist/packages/operations.js +11 -11
- package/dist/packages/provenance.d.ts +6 -0
- package/dist/packages/provenance.js +12 -3
- package/dist/packages/specs.js +5 -5
- package/dist/packages/validation.js +3 -3
- package/dist/paths/_internal.js +3 -3
- package/dist/paths/conversion.js +4 -4
- package/dist/paths/normalize.js +3 -1
- package/dist/paths/packages.js +3 -3
- package/dist/paths/predicates.js +7 -7
- package/dist/paths/resolve.js +3 -3
- package/dist/process/spawn/_internal.js +3 -3
- package/dist/process/spawn/errors.js +2 -2
- package/dist/process/spawn/stdio.js +1 -1
- package/dist/promises/_internal.js +1 -1
- package/dist/promises/iterate.js +5 -5
- package/dist/promises/options.js +3 -3
- package/dist/promises/retry.js +1 -1
- package/dist/secrets/_internal.js +3 -2
- package/dist/secrets/keychain.js +5 -4
- package/dist/secrets/linux.js +6 -4
- package/dist/secrets/macos.js +5 -3
- package/dist/secrets/rc.js +9 -6
- package/dist/secrets/windows.js +7 -4
- package/dist/shell/parse.d.ts +108 -1
- package/dist/shell/parse.js +168 -2
- package/dist/smol/detect.js +1 -1
- package/dist/smol/http.js +1 -1
- package/dist/smol/https.js +1 -1
- package/dist/smol/manifest.js +1 -1
- package/dist/smol/path.js +1 -1
- package/dist/smol/primordial.js +1 -1
- package/dist/smol/purl.js +1 -1
- package/dist/smol/versions.js +1 -1
- package/dist/smol/vfs.js +1 -1
- package/dist/sorts/_internal.js +4 -4
- package/dist/sorts/natural.js +3 -3
- package/dist/sorts/semver.js +1 -1
- package/dist/sorts/strings.js +1 -1
- package/dist/spinner/default.js +1 -1
- package/dist/spinner/spinner.js +1 -1
- package/dist/ssri/convert.js +2 -2
- package/dist/ssri/parse.js +1 -1
- package/dist/ssri/validate.js +2 -2
- package/dist/stdio/prompts.js +1 -1
- package/dist/streams/parallel.js +2 -2
- package/dist/streams/transform.js +1 -1
- package/dist/strings/format.js +4 -4
- package/dist/strings/predicates.js +2 -2
- package/dist/strings/search.js +1 -1
- package/dist/strings/transform.js +3 -3
- package/dist/strings/width.js +2 -2
- package/dist/temporal/instant.js +4 -2
- package/dist/temporal/slots.js +3 -2
- package/dist/themes/context.js +2 -2
- package/dist/url/parse.js +2 -2
- package/dist/url/predicates.js +1 -1
- package/dist/url/search-params.js +6 -6
- package/dist/words/article.js +1 -1
- package/dist/words/capitalize.js +1 -1
- package/dist/words/pluralize.d.ts +24 -2
- package/dist/words/pluralize.js +37 -2
- package/dist/words/types.d.ts +25 -2
- package/package.json +44 -4
package/dist/shell/parse.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_array = require('../primordials/array.js');
|
|
4
5
|
let src_external_shell_quote = require("../external/shell-quote");
|
|
5
6
|
|
|
6
7
|
//#region src/shell/parse.ts
|
|
@@ -14,8 +15,146 @@ let src_external_shell_quote = require("../external/shell-quote");
|
|
|
14
15
|
* against `env`; unresolved ones collapse to an empty string.
|
|
15
16
|
*/
|
|
16
17
|
/**
|
|
18
|
+
* Visit each simple command in `cmd` in order. A "simple command" is the
|
|
19
|
+
* POSIX-grammar term for a run of bare-string tokens between shell
|
|
20
|
+
* control-operator boundaries (`&&`, `;`, `||`, `|`) — e.g. in `sudo apt && rm
|
|
21
|
+
* -rf /`, the two simple commands are `['sudo', 'apt']` and `['rm', '-rf',
|
|
22
|
+
* '/']`. Glob and comment tokens are ignored.
|
|
23
|
+
*
|
|
24
|
+
* The visitor receives each simple command's tokens as a `readonly string[]`;
|
|
25
|
+
* returning `true` short-circuits the walk so callers like `hasBinCall` /
|
|
26
|
+
* `findBinCall` can bail on the first match without finishing the parse.
|
|
27
|
+
*
|
|
28
|
+
* Public so consumers can write their own per-command matchers without
|
|
29
|
+
* re-parsing the command line. Used internally by `findBinCall` /
|
|
30
|
+
* `findBinCalls` / `hasBinCall`.
|
|
31
|
+
*
|
|
32
|
+
* Shell-quote is permissive (partial parses don't throw); the walk tolerates
|
|
33
|
+
* any shape it returns.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* eachSimpleCommand('sudo apt && rm -rf /', tokens => {
|
|
37
|
+
* console.log(tokens)
|
|
38
|
+
* // → ['sudo', 'apt']
|
|
39
|
+
* // → ['rm', '-rf', '/']
|
|
40
|
+
* })
|
|
41
|
+
*
|
|
42
|
+
* // Short-circuit on first match:
|
|
43
|
+
* eachSimpleCommand('a ; b ; c', tokens => {
|
|
44
|
+
* if (tokens[0] === 'b') {
|
|
45
|
+
* return true // stop the walk
|
|
46
|
+
* }
|
|
47
|
+
* })
|
|
48
|
+
*/
|
|
49
|
+
function eachSimpleCommand(cmd, visit) {
|
|
50
|
+
const entries = (0, src_external_shell_quote.parse)(cmd);
|
|
51
|
+
let current = [];
|
|
52
|
+
const flush = () => {
|
|
53
|
+
if (current.length > 0) {
|
|
54
|
+
const stop = visit(current);
|
|
55
|
+
current = [];
|
|
56
|
+
return stop === true;
|
|
57
|
+
}
|
|
58
|
+
current = [];
|
|
59
|
+
return false;
|
|
60
|
+
};
|
|
61
|
+
for (let i = 0, { length } = entries; i < length; i += 1) {
|
|
62
|
+
const entry = entries[i];
|
|
63
|
+
if (entry && typeof entry === "object" && "op" in entry) {
|
|
64
|
+
if (flush()) return;
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (typeof entry === "string") require_primordials_array.ArrayPrototypePush(current, entry);
|
|
68
|
+
}
|
|
69
|
+
flush();
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Walk a parsed shell command and return the args of the FIRST binary call
|
|
73
|
+
* whose leading tokens match `prefix` (e.g. `['sudo']`, `['gh', 'auth',
|
|
74
|
+
* 'refresh']`). Returns `undefined` when no call matches.
|
|
75
|
+
*
|
|
76
|
+
* Short-circuits on the first match — does NOT materialize every match. Use
|
|
77
|
+
* this when "did any call match, and what were its args?" is enough. For audit
|
|
78
|
+
* / counting use cases where every match matters, use `findBinCalls`.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* findBinCall('sudo apt update && sudo -k', ['sudo'])
|
|
82
|
+
* // → ['apt', 'update']
|
|
83
|
+
*
|
|
84
|
+
* findBinCall('echo "sudo foo"', ['sudo'])
|
|
85
|
+
* // → undefined
|
|
86
|
+
*/
|
|
87
|
+
function findBinCall(cmd, prefix) {
|
|
88
|
+
if (prefix.length === 0) return;
|
|
89
|
+
let found;
|
|
90
|
+
eachSimpleCommand(cmd, (tokens) => {
|
|
91
|
+
if (!simpleCommandStartsWith(tokens, prefix)) return false;
|
|
92
|
+
found = require_primordials_array.ArrayPrototypeSlice(tokens, prefix.length);
|
|
93
|
+
return true;
|
|
94
|
+
});
|
|
95
|
+
return found;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Walk a parsed shell command and return the args of every binary call whose
|
|
99
|
+
* leading tokens match `prefix` (e.g. `['sudo']`, `['gh', 'auth', 'refresh']`).
|
|
100
|
+
* Returns an empty array when no call matches.
|
|
101
|
+
*
|
|
102
|
+
* Segments split at op tokens (`&&`, `;`, `||`, `|`) so each chained command is
|
|
103
|
+
* scanned independently. Each match's args are returned as a `string[]` slice
|
|
104
|
+
* positioned after the matched prefix — useful for caller-side `.some(...)`
|
|
105
|
+
* over flag/value pairs.
|
|
106
|
+
*
|
|
107
|
+
* The AST walk means embedded args (`echo "sudo foo"`), variable substitutions
|
|
108
|
+
* (`$gh`), and command substitution (`$(...)`) don't trip the matcher — only
|
|
109
|
+
* actual calls do.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* findBinCalls('sudo apt update && sudo -k', ['sudo'])
|
|
113
|
+
* // → [['apt', 'update'], ['-k']]
|
|
114
|
+
*
|
|
115
|
+
* findBinCalls('gh auth refresh -s workflow', ['gh', 'auth', 'refresh'])
|
|
116
|
+
* // → [['-s', 'workflow']]
|
|
117
|
+
*
|
|
118
|
+
* findBinCalls('echo "sudo foo"', ['sudo'])
|
|
119
|
+
* // → []
|
|
120
|
+
*/
|
|
121
|
+
function findBinCalls(cmd, prefix) {
|
|
122
|
+
if (prefix.length === 0) return [];
|
|
123
|
+
const matches = [];
|
|
124
|
+
eachSimpleCommand(cmd, (tokens) => {
|
|
125
|
+
if (simpleCommandStartsWith(tokens, prefix)) require_primordials_array.ArrayPrototypePush(matches, require_primordials_array.ArrayPrototypeSlice(tokens, prefix.length));
|
|
126
|
+
});
|
|
127
|
+
return matches;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Convenience: does `cmd` contain at least one binary call matching the
|
|
131
|
+
* leading-tokens `prefix`? The most common audit-pattern shape.
|
|
132
|
+
*
|
|
133
|
+
* Short-circuits on the first match — walks the parsed entries once and returns
|
|
134
|
+
* `true` as soon as a simple command matches. No intermediate match list or
|
|
135
|
+
* args slices are allocated.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* hasBinCall('echo hi && sudo rm', ['sudo']) // → true
|
|
139
|
+
* hasBinCall('echo "sudo foo"', ['sudo']) // → false
|
|
140
|
+
* hasBinCall('gh auth refresh -s workflow', ['gh', 'auth', 'refresh']) // → true
|
|
141
|
+
*/
|
|
142
|
+
function hasBinCall(cmd, prefix) {
|
|
143
|
+
if (prefix.length === 0) return false;
|
|
144
|
+
let found = false;
|
|
145
|
+
eachSimpleCommand(cmd, (tokens) => {
|
|
146
|
+
if (simpleCommandStartsWith(tokens, prefix)) {
|
|
147
|
+
found = true;
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
return false;
|
|
151
|
+
});
|
|
152
|
+
return found;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
17
155
|
* Tokenize `cmd` into `ParseEntry` items, preserving operators and comments.
|
|
18
|
-
*
|
|
156
|
+
* `shell-quote` is permissive — an unterminated quote does not throw; the
|
|
157
|
+
* parser drops the opening quote and returns the rest as plain tokens.
|
|
19
158
|
*
|
|
20
159
|
* @example
|
|
21
160
|
* parseShell('git commit -m "hello world"')
|
|
@@ -30,6 +169,33 @@ let src_external_shell_quote = require("../external/shell-quote");
|
|
|
30
169
|
function parseShell(cmd, env) {
|
|
31
170
|
return (0, src_external_shell_quote.parse)(cmd, env);
|
|
32
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* Does the simple command represented by `tokens` start with `prefix`? The
|
|
174
|
+
* natural companion to `eachSimpleCommand` — the visitor callback uses this to
|
|
175
|
+
* test whether a simple command is a call to a specific binary or command-line
|
|
176
|
+
* prefix.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* simpleCommandStartsWith(['sudo', 'apt', 'update'], ['sudo'])
|
|
180
|
+
* // → true
|
|
181
|
+
*
|
|
182
|
+
* simpleCommandStartsWith(
|
|
183
|
+
* ['gh', 'auth', 'status'],
|
|
184
|
+
* ['gh', 'auth', 'refresh'],
|
|
185
|
+
* )
|
|
186
|
+
* // → false
|
|
187
|
+
*/
|
|
188
|
+
function simpleCommandStartsWith(tokens, prefix) {
|
|
189
|
+
const { length: pl } = prefix;
|
|
190
|
+
if (tokens.length < pl) return false;
|
|
191
|
+
for (let i = 0; i < pl; i += 1) if (tokens[i] !== prefix[i]) return false;
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
33
194
|
|
|
34
195
|
//#endregion
|
|
35
|
-
exports.
|
|
196
|
+
exports.eachSimpleCommand = eachSimpleCommand;
|
|
197
|
+
exports.findBinCall = findBinCall;
|
|
198
|
+
exports.findBinCalls = findBinCalls;
|
|
199
|
+
exports.hasBinCall = hasBinCall;
|
|
200
|
+
exports.parseShell = parseShell;
|
|
201
|
+
exports.simpleCommandStartsWith = simpleCommandStartsWith;
|
package/dist/smol/detect.js
CHANGED
|
@@ -39,7 +39,7 @@ let _smolUtilProbed = false;
|
|
|
39
39
|
* Returns `node:smol-util` when running on the smol Node binary, otherwise
|
|
40
40
|
* `undefined`. Result is cached across calls.
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
43
43
|
function getSmolUtil() {
|
|
44
44
|
if (!_smolUtilProbed) {
|
|
45
45
|
_smolUtilProbed = true;
|
package/dist/smol/http.js
CHANGED
|
@@ -24,7 +24,7 @@ let _smolHttpProbed = false;
|
|
|
24
24
|
* Returns `node:smol-http` when running on the smol Node binary, otherwise
|
|
25
25
|
* `undefined`. Result is cached across calls.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
28
28
|
function getSmolHttp() {
|
|
29
29
|
if (!_smolHttpProbed) {
|
|
30
30
|
_smolHttpProbed = true;
|
package/dist/smol/https.js
CHANGED
|
@@ -22,7 +22,7 @@ let _smolHttpsProbed = false;
|
|
|
22
22
|
* Returns `node:smol-https` when running on the smol Node binary, otherwise
|
|
23
23
|
* `undefined`. Result is cached across calls.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
26
26
|
function getSmolHttps() {
|
|
27
27
|
if (!_smolHttpsProbed) {
|
|
28
28
|
_smolHttpsProbed = true;
|
package/dist/smol/manifest.js
CHANGED
|
@@ -24,7 +24,7 @@ let _smolManifestProbed = false;
|
|
|
24
24
|
* Returns `node:smol-manifest` when running on the smol Node binary, otherwise
|
|
25
25
|
* `undefined`. Result is cached across calls.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
28
28
|
function getSmolManifest() {
|
|
29
29
|
if (!_smolManifestProbed) {
|
|
30
30
|
_smolManifestProbed = true;
|
package/dist/smol/path.js
CHANGED
|
@@ -24,7 +24,7 @@ let _smolPathProbed = false;
|
|
|
24
24
|
*
|
|
25
25
|
* @returns The native binding, or `undefined` to signal "use the JS fallback".
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
28
28
|
function getSmolPath() {
|
|
29
29
|
if (!_smolPathProbed) {
|
|
30
30
|
_smolPathProbed = true;
|
package/dist/smol/primordial.js
CHANGED
|
@@ -26,7 +26,7 @@ let _smolPrimordialProbed = false;
|
|
|
26
26
|
* Returns `node:smol-primordial` when running on the smol Node binary,
|
|
27
27
|
* otherwise `undefined`. Result is cached across calls.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
30
30
|
function getSmolPrimordial() {
|
|
31
31
|
if (!_smolPrimordialProbed) {
|
|
32
32
|
_smolPrimordialProbed = true;
|
package/dist/smol/purl.js
CHANGED
|
@@ -25,7 +25,7 @@ let _smolPurlProbed = false;
|
|
|
25
25
|
* Returns `node:smol-purl` when running on the smol Node binary, otherwise
|
|
26
26
|
* `undefined`. Result is cached across calls.
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
29
29
|
function getSmolPurl() {
|
|
30
30
|
if (!_smolPurlProbed) {
|
|
31
31
|
_smolPurlProbed = true;
|
package/dist/smol/versions.js
CHANGED
|
@@ -22,7 +22,7 @@ let _smolVersionsProbed = false;
|
|
|
22
22
|
* Returns `node:smol-versions` when running on the smol Node binary, otherwise
|
|
23
23
|
* `undefined`. Result is cached across calls.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
26
26
|
function getSmolVersions() {
|
|
27
27
|
if (!_smolVersionsProbed) {
|
|
28
28
|
_smolVersionsProbed = true;
|
package/dist/smol/vfs.js
CHANGED
|
@@ -37,7 +37,7 @@ let _smolVfsProbed = false;
|
|
|
37
37
|
* binding-module loader is collapsed into this function so callers don't deal
|
|
38
38
|
* with two indirection levels.
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
41
41
|
function getSmolVfs() {
|
|
42
42
|
if (!_smolVfsProbed) {
|
|
43
43
|
_smolVfsProbed = true;
|
package/dist/sorts/_internal.js
CHANGED
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
//#region src/sorts/_internal.ts
|
|
6
6
|
let _fastSort;
|
|
7
7
|
let _semver;
|
|
8
|
-
|
|
8
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
9
9
|
function getFastSort() {
|
|
10
|
-
if (_fastSort === void 0) _fastSort =
|
|
10
|
+
if (_fastSort === void 0) _fastSort = /*@__PURE__*/ require("../external/fast-sort.js");
|
|
11
11
|
return _fastSort;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
14
14
|
function getSemver() {
|
|
15
|
-
if (_semver === void 0) _semver =
|
|
15
|
+
if (_semver === void 0) _semver = /*@__PURE__*/ require("../external/semver.js");
|
|
16
16
|
return _semver;
|
|
17
17
|
}
|
|
18
18
|
|
package/dist/sorts/natural.js
CHANGED
|
@@ -24,7 +24,7 @@ let _naturalSorter;
|
|
|
24
24
|
* localeCompare('a', 'a') // 0
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
28
28
|
function localeCompare(x, y) {
|
|
29
29
|
if (_localeCompare === void 0) _localeCompare = new Intl.Collator().compare;
|
|
30
30
|
return _localeCompare(x, y);
|
|
@@ -38,7 +38,7 @@ function localeCompare(x, y) {
|
|
|
38
38
|
* naturalCompare('img10', 'img2') // positive (img10 after img2)
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
42
42
|
function naturalCompare(x, y) {
|
|
43
43
|
if (_naturalCompare === void 0) _naturalCompare = new Intl.Collator(void 0, {
|
|
44
44
|
numeric: true,
|
|
@@ -55,7 +55,7 @@ function naturalCompare(x, y) {
|
|
|
55
55
|
* // ['file1', 'file2', 'file10']
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
|
-
|
|
58
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
59
59
|
function naturalSorter(arrayToSort) {
|
|
60
60
|
if (_naturalSorter === void 0) _naturalSorter = (/* @__PURE__ */ require_sorts__internal.getFastSort()).createNewSortInstance({ comparer: naturalCompare });
|
|
61
61
|
return _naturalSorter(arrayToSort);
|
package/dist/sorts/semver.js
CHANGED
|
@@ -18,7 +18,7 @@ const require_sorts__internal = require('./_internal.js');
|
|
|
18
18
|
* compareSemver('1.0.0', '1.0.0') // 0
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
22
22
|
function compareSemver(a, b) {
|
|
23
23
|
/* c8 ignore start */
|
|
24
24
|
const semver = /* @__PURE__ */ require_sorts__internal.getSemver();
|
package/dist/sorts/strings.js
CHANGED
package/dist/spinner/default.js
CHANGED
package/dist/spinner/spinner.js
CHANGED
|
@@ -55,7 +55,7 @@ let _defaultSpinner;
|
|
|
55
55
|
*
|
|
56
56
|
* @returns New spinner instance
|
|
57
57
|
*/
|
|
58
|
-
|
|
58
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
59
59
|
function Spinner(options) {
|
|
60
60
|
if (_Spinner === void 0) {
|
|
61
61
|
const YoctoSpinnerClass = (0, src_external__socketregistry_yocto_spinner.default)({}).constructor;
|
package/dist/ssri/convert.js
CHANGED
|
@@ -31,7 +31,7 @@ const require_primordials_error = require('../primordials/error.js');
|
|
|
31
31
|
*
|
|
32
32
|
* @throws Error if hex format is invalid
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
35
35
|
function hexToSsri(hex, algorithm = "sha256") {
|
|
36
36
|
if (!/^[a-f0-9]+$/i.test(hex)) throw new require_primordials_error.ErrorCtor(`Invalid hex format: ${hex}`);
|
|
37
37
|
return `${algorithm}-${require_primordials_buffer.BufferPrototypeToString(require_primordials_buffer.BufferFrom(hex, "hex"), "base64")}`;
|
|
@@ -56,7 +56,7 @@ function hexToSsri(hex, algorithm = "sha256") {
|
|
|
56
56
|
*
|
|
57
57
|
* @throws Error if SSRI format is invalid
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
60
60
|
function ssriToHex(ssri) {
|
|
61
61
|
const match = /^([a-z0-9]+)-([A-Za-z0-9+/]+=*)$/i.exec(ssri);
|
|
62
62
|
if (!match || !match[2] || match[2].length < 2) throw new require_primordials_error.ErrorCtor(`Invalid SSRI format: ${ssri}`);
|
package/dist/ssri/parse.js
CHANGED
|
@@ -27,7 +27,7 @@ const require_primordials_error = require('../primordials/error.js');
|
|
|
27
27
|
*
|
|
28
28
|
* @throws Error if SSRI format is invalid
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
31
31
|
function parseSsri(ssri) {
|
|
32
32
|
const match = /^([a-z0-9]+)-([A-Za-z0-9+/]+=*)$/i.exec(ssri);
|
|
33
33
|
if (!match || !match[1] || !match[2] || match[2].length < 2) throw new require_primordials_error.ErrorCtor(`Invalid SSRI format: ${ssri}`);
|
package/dist/ssri/validate.js
CHANGED
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
26
26
|
*
|
|
27
27
|
* @returns True if string is valid hex format
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
30
30
|
function isValidHex(value) {
|
|
31
31
|
return /^[a-f0-9]+$/i.test(value);
|
|
32
32
|
}
|
|
@@ -46,7 +46,7 @@ function isValidHex(value) {
|
|
|
46
46
|
*
|
|
47
47
|
* @returns True if string matches SSRI format
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
50
50
|
function isValidSsri(value) {
|
|
51
51
|
return /^[a-z0-9]+-[A-Za-z0-9+/]{2,}=*$/i.test(value);
|
|
52
52
|
}
|
package/dist/stdio/prompts.js
CHANGED
|
@@ -152,7 +152,7 @@ function resolveTheme(theme) {
|
|
|
152
152
|
*
|
|
153
153
|
* @returns Wrapped prompt function with spinner, theme, and signal handling
|
|
154
154
|
*/
|
|
155
|
-
|
|
155
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
156
156
|
function wrapPrompt(inquirerPrompt) {
|
|
157
157
|
return async (...args) => {
|
|
158
158
|
const origContext = args.length > 1 ? args[1] : void 0;
|
package/dist/streams/parallel.js
CHANGED
|
@@ -26,7 +26,7 @@ let src_external_streaming_iterables = require("../external/streaming-iterables"
|
|
|
26
26
|
* )
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
30
30
|
async function parallelEach(iterable, func, options) {
|
|
31
31
|
for await (const _ of /* @__PURE__ */ parallelMap(iterable, func, options));
|
|
32
32
|
}
|
|
@@ -47,7 +47,7 @@ async function parallelEach(iterable, func, options) {
|
|
|
47
47
|
* }
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
51
51
|
function parallelMap(iterable, func, options) {
|
|
52
52
|
const opts = /* @__PURE__ */ require_promises_options.normalizeIterationOptions(options);
|
|
53
53
|
return (0, src_external_streaming_iterables.parallelMap)(opts.concurrency, async (item) => {
|
|
@@ -24,7 +24,7 @@ let src_external_streaming_iterables = require("../external/streaming-iterables"
|
|
|
24
24
|
* }
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
28
28
|
function transform(iterable, func, options) {
|
|
29
29
|
const opts = /* @__PURE__ */ require_promises_options.normalizeIterationOptions(options);
|
|
30
30
|
return (0, src_external_streaming_iterables.transform)(opts.concurrency, async (item) => {
|
package/dist/strings/format.js
CHANGED
|
@@ -38,7 +38,7 @@ const fromCharCode = String.fromCharCode;
|
|
|
38
38
|
*
|
|
39
39
|
* @returns The string with prefix applied to each line
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
42
42
|
function applyLinePrefix(str, options) {
|
|
43
43
|
const { prefix = "" } = {
|
|
44
44
|
__proto__: null,
|
|
@@ -80,7 +80,7 @@ function applyLinePrefix(str, options) {
|
|
|
80
80
|
*
|
|
81
81
|
* @returns The centered text with padding
|
|
82
82
|
*/
|
|
83
|
-
|
|
83
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
84
84
|
function centerText(text, width) {
|
|
85
85
|
const textLength = (/* @__PURE__ */ require_ansi_strip.stripAnsi(text)).length;
|
|
86
86
|
if (textLength >= width) return text;
|
|
@@ -114,7 +114,7 @@ function centerText(text, width) {
|
|
|
114
114
|
*
|
|
115
115
|
* @returns The indented string
|
|
116
116
|
*/
|
|
117
|
-
|
|
117
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
118
118
|
function indentString(str, options) {
|
|
119
119
|
const { count = 1 } = {
|
|
120
120
|
__proto__: null,
|
|
@@ -141,7 +141,7 @@ function indentString(str, options) {
|
|
|
141
141
|
*
|
|
142
142
|
* @returns The repeated string, or empty string if count <= 0
|
|
143
143
|
*/
|
|
144
|
-
|
|
144
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
145
145
|
function repeatString(str, count) {
|
|
146
146
|
if (count <= 0) return "";
|
|
147
147
|
return require_primordials_string.StringPrototypeRepeat(str, count);
|
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
26
26
|
*
|
|
27
27
|
* @returns `true` if the value is a blank string, `false` otherwise
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
30
30
|
function isBlankString(value) {
|
|
31
31
|
return typeof value === "string" && (!value.length || /^\s+$/.test(value));
|
|
32
32
|
}
|
|
@@ -51,7 +51,7 @@ function isBlankString(value) {
|
|
|
51
51
|
*
|
|
52
52
|
* @returns `true` if the value is a non-empty string, `false` otherwise
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
55
55
|
function isNonEmptyString(value) {
|
|
56
56
|
return typeof value === "string" && value.length > 0;
|
|
57
57
|
}
|
package/dist/strings/search.js
CHANGED
|
@@ -37,7 +37,7 @@ const require_primordials_math = require('../primordials/math.js');
|
|
|
37
37
|
*
|
|
38
38
|
* @returns The index of the first match, or -1 if not found
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
41
41
|
function search(str, regexp, options) {
|
|
42
42
|
const { fromIndex = 0 } = {
|
|
43
43
|
__proto__: null,
|
|
@@ -31,7 +31,7 @@ const require_primordials_string = require('../primordials/string.js');
|
|
|
31
31
|
*
|
|
32
32
|
* @returns The string without BOM
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
35
35
|
function stripBom(str) {
|
|
36
36
|
return str.length > 0 && require_primordials_string.StringPrototypeCharCodeAt(str, 0) === 65279 ? require_primordials_string.StringPrototypeSlice(str, 1) : str;
|
|
37
37
|
}
|
|
@@ -60,7 +60,7 @@ function stripBom(str) {
|
|
|
60
60
|
*
|
|
61
61
|
* @returns The kebab-case string
|
|
62
62
|
*/
|
|
63
|
-
|
|
63
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
64
64
|
function toKebabCase(str) {
|
|
65
65
|
if (!str.length) return str;
|
|
66
66
|
return require_primordials_string.StringPrototypeReplace(str, /([a-z]+[0-9]*)([A-Z])/g, "$1-$2").replace(/_/g, "-").toLowerCase();
|
|
@@ -90,7 +90,7 @@ function toKebabCase(str) {
|
|
|
90
90
|
*
|
|
91
91
|
* @returns The string with leading and trailing newlines removed
|
|
92
92
|
*/
|
|
93
|
-
|
|
93
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
94
94
|
function trimNewlines(str) {
|
|
95
95
|
const { length } = str;
|
|
96
96
|
if (length === 0) return str;
|
package/dist/strings/width.js
CHANGED
|
@@ -21,7 +21,7 @@ const require_ansi_strip = require('../ansi/strip.js');
|
|
|
21
21
|
* details and Unicode Standard Annex #11 references.
|
|
22
22
|
*/
|
|
23
23
|
let _eastAsianWidth;
|
|
24
|
-
|
|
24
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
25
25
|
function getEastAsianWidth() {
|
|
26
26
|
if (_eastAsianWidth === void 0) _eastAsianWidth = (/* @__PURE__ */ require("../external/get-east-asian-width")).eastAsianWidth;
|
|
27
27
|
return _eastAsianWidth;
|
|
@@ -65,7 +65,7 @@ try {
|
|
|
65
65
|
*
|
|
66
66
|
* @returns The visual width in terminal columns
|
|
67
67
|
*/
|
|
68
|
-
|
|
68
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
69
69
|
function stringWidth(text) {
|
|
70
70
|
if (typeof text !== "string" || !text.length) return 0;
|
|
71
71
|
/* c8 ignore next */
|
package/dist/temporal/instant.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_primordials_error = require('../primordials/error.js');
|
|
5
|
+
const require_primordials_object = require('../primordials/object.js');
|
|
6
|
+
const require_primordials_json = require('../primordials/json.js');
|
|
5
7
|
const require_primordials_globals = require('../primordials/globals.js');
|
|
6
8
|
const require_temporal_slots = require('./slots.js');
|
|
7
9
|
|
|
@@ -58,7 +60,7 @@ function epochNanosecondsImpl() {
|
|
|
58
60
|
if (!require_temporal_slots.hasInstantSlot(instant)) throw new require_primordials_error.TypeErrorCtor(`Temporal.Instant.prototype.epochNanoseconds: receiver lacks [[InitializedTemporalInstant]] internal slot; saw ${describe(instant)}. Call on a Temporal.Instant instance constructed via 'new Temporal.Instant(…)'.`);
|
|
59
61
|
return require_temporal_slots.getInstantNanoseconds(instant);
|
|
60
62
|
}
|
|
61
|
-
|
|
63
|
+
require_primordials_object.ObjectDefineProperty(Instant.prototype, "epochNanoseconds", {
|
|
62
64
|
get: epochNanosecondsImpl,
|
|
63
65
|
configurable: true
|
|
64
66
|
});
|
|
@@ -72,7 +74,7 @@ function describe(value) {
|
|
|
72
74
|
const ctor = value.constructor;
|
|
73
75
|
return ctor && ctor.name ? `<${ctor.name}>` : "<object>";
|
|
74
76
|
}
|
|
75
|
-
return typeof value === "string" ?
|
|
77
|
+
return typeof value === "string" ? require_primordials_json.JSONStringify(value) : String(value);
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
//#endregion
|
package/dist/temporal/slots.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
4
5
|
|
|
5
6
|
//#region src/temporal/slots.ts
|
|
6
7
|
/**
|
|
@@ -19,8 +20,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
19
20
|
* `[[InitializedTemporalInstant]]` and `RequireInternalSlot`. Reference impl:
|
|
20
21
|
* js-temporal/temporal-polyfill `lib/slots.ts` (pinned commit in README.md).
|
|
21
22
|
*/
|
|
22
|
-
const _initializedInstant =
|
|
23
|
-
const _instantNanoseconds =
|
|
23
|
+
const _initializedInstant = new require_primordials_map_set.WeakSetCtor();
|
|
24
|
+
const _instantNanoseconds = new require_primordials_map_set.WeakMapCtor();
|
|
24
25
|
/**
|
|
25
26
|
* Read `[[Nanoseconds]]`. Caller MUST gate on `hasInstantSlot` first; behaviour
|
|
26
27
|
* on absent-slot input is undefined.
|
package/dist/themes/context.js
CHANGED
|
@@ -19,9 +19,9 @@ function emitThemeChange(theme) {
|
|
|
19
19
|
*
|
|
20
20
|
* @private
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
23
23
|
function getAsyncHooks() {
|
|
24
|
-
if (_async_hooks === void 0) _async_hooks =
|
|
24
|
+
if (_async_hooks === void 0) _async_hooks = /*@__PURE__*/ require("node:async_hooks");
|
|
25
25
|
return _async_hooks;
|
|
26
26
|
}
|
|
27
27
|
/**
|
package/dist/url/parse.js
CHANGED
|
@@ -19,7 +19,7 @@ const UrlCtor = URL;
|
|
|
19
19
|
* createRelativeUrl('/api/test', { base: 'https://example.com' }) // 'https://example.com/api/test'
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
23
23
|
function createRelativeUrl(path, options) {
|
|
24
24
|
const { base = "" } = {
|
|
25
25
|
__proto__: null,
|
|
@@ -42,7 +42,7 @@ function createRelativeUrl(path, options) {
|
|
|
42
42
|
* parseUrl('invalid') // undefined
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
46
46
|
function parseUrl(value) {
|
|
47
47
|
try {
|
|
48
48
|
return new UrlCtor(value);
|
package/dist/url/predicates.js
CHANGED
|
@@ -18,7 +18,7 @@ const require_url_parse = require('./parse.js');
|
|
|
18
18
|
* isUrl(null) // false
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
22
22
|
function isUrl(value) {
|
|
23
23
|
return (typeof value === "string" && value !== "" || value !== null && typeof value === "object") && !!/* @__PURE__ */ require_url_parse.parseUrl(value);
|
|
24
24
|
}
|