@poe-platform/safe-bash 0.1.535 → 0.1.536
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/safe-bash/chunks/chunk-FRSZDCZA.js +1236 -0
- package/dist/safe-bash/chunks/chunk-FRSZDCZA.js.map +7 -0
- package/dist/safe-bash/commands/pr/command.d.ts +4 -0
- package/dist/safe-bash/commands/pr/command.d.ts.map +1 -0
- package/dist/safe-bash/commands/pr/command.js +117 -0
- package/dist/safe-bash/commands/pr/command.js.map +1 -0
- package/dist/safe-bash/commands/pr/format.d.ts +52 -0
- package/dist/safe-bash/commands/pr/format.d.ts.map +1 -0
- package/dist/safe-bash/commands/pr/format.js +527 -0
- package/dist/safe-bash/commands/pr/format.js.map +1 -0
- package/dist/safe-bash/commands/pr/index.browser.js +13 -0
- package/dist/safe-bash/commands/pr/index.browser.js.map +7 -0
- package/dist/safe-bash/commands/pr/index.d.ts +7 -0
- package/dist/safe-bash/commands/pr/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/pr/index.js +13 -0
- package/dist/safe-bash/commands/pr/index.js.map +1 -0
- package/dist/safe-bash/commands/pr/internal.d.ts +61 -0
- package/dist/safe-bash/commands/pr/internal.d.ts.map +1 -0
- package/dist/safe-bash/commands/pr/internal.js +181 -0
- package/dist/safe-bash/commands/pr/internal.js.map +1 -0
- package/dist/safe-bash/commands/pr/io.d.ts +37 -0
- package/dist/safe-bash/commands/pr/io.d.ts.map +1 -0
- package/dist/safe-bash/commands/pr/io.js +210 -0
- package/dist/safe-bash/commands/pr/io.js.map +1 -0
- package/dist/safe-bash/commands/pr/options.d.ts +36 -0
- package/dist/safe-bash/commands/pr/options.d.ts.map +1 -0
- package/dist/safe-bash/commands/pr/options.js +250 -0
- package/dist/safe-bash/commands/pr/options.js.map +1 -0
- package/dist/safe-bash/core.browser.js +36 -5
- package/dist/safe-bash/core.browser.js.map +3 -3
- package/dist/safe-bash/core.d.ts +1 -0
- package/dist/safe-bash/core.d.ts.map +1 -1
- package/dist/safe-bash/core.js +1 -0
- package/dist/safe-bash/core.js.map +1 -1
- package/dist/safe-bash/plugins/composition.d.ts +2 -0
- package/dist/safe-bash/plugins/composition.d.ts.map +1 -1
- package/dist/safe-bash/plugins/composition.js +5 -1
- package/dist/safe-bash/plugins/composition.js.map +1 -1
- package/dist/safe-bash/shell/runtime.d.ts.map +1 -1
- package/dist/safe-bash/shell/runtime.js +28 -3
- package/dist/safe-bash/shell/runtime.js.map +1 -1
- package/package.json +8 -2
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { Budget, PrError, quote } from "./internal.js";
|
|
2
|
+
function digit(value) { return value >= "0" && value <= "9"; }
|
|
3
|
+
function integer(value, minimum, label) {
|
|
4
|
+
let offset = 0;
|
|
5
|
+
while (" \t\r\n\v\f".includes(value[offset] ?? "!") && offset < value.length)
|
|
6
|
+
offset++;
|
|
7
|
+
if (value[offset] === "+" || value[offset] === "-")
|
|
8
|
+
offset++;
|
|
9
|
+
const start = offset;
|
|
10
|
+
while (offset < value.length && digit(value[offset]))
|
|
11
|
+
offset++;
|
|
12
|
+
if (offset !== value.length || offset === start)
|
|
13
|
+
throw new PrError(`${label}: ${quote(value)}`);
|
|
14
|
+
const result = Number(value);
|
|
15
|
+
if (result < minimum || result > 2147483647 || !Number.isSafeInteger(result))
|
|
16
|
+
throw new PrError(`${label}: ${quote(value)}: Numerical result out of range`);
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
export function parseOptions(args, budget) {
|
|
20
|
+
const options = {
|
|
21
|
+
files: [], columns: 1, explicitColumns: false, merge: false, across: false,
|
|
22
|
+
length: 66, width: 72, header: undefined, extremities: true, keepFF: false,
|
|
23
|
+
formFeed: false, numbered: false, digits: 5, numberSeparator: "\t", startNumber: 1,
|
|
24
|
+
separator: "", useSeparator: false, truncate: false, join: false, doubleSpace: false,
|
|
25
|
+
margin: 0, expand: false, tabify: false, inputTab: "\t", inputTabWidth: 8,
|
|
26
|
+
outputTab: "\t", outputTabWidth: 8, control: false, octal: false, quiet: false, information: undefined,
|
|
27
|
+
};
|
|
28
|
+
const long = {
|
|
29
|
+
columns: "#", across: "a", "show-control-chars": "c", "double-space": "d", "expand-tabs": "e",
|
|
30
|
+
"form-feed": "f", header: "h", "output-tabs": "i", "join-lines": "J", length: "l", merge: "m",
|
|
31
|
+
"number-lines": "n", "first-line-number": "N", indent: "o", "no-file-warnings": "r", separator: "s",
|
|
32
|
+
"sep-string": "S", "omit-header": "t", "omit-pagination": "T", "show-nonprinting": "v", width: "w", "page-width": "W",
|
|
33
|
+
};
|
|
34
|
+
let oldWidth = false, oldSeparator = false, oldOptions = false, stop = false;
|
|
35
|
+
let columnDigits;
|
|
36
|
+
let accumulating = false;
|
|
37
|
+
for (let index = 0; index < args.length; index++) {
|
|
38
|
+
const argument = args[index];
|
|
39
|
+
budget.charge(argument.length);
|
|
40
|
+
if (stop) {
|
|
41
|
+
options.files.push(argument);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (argument === "--") {
|
|
45
|
+
stop = true;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (argument === "--help" || argument === "--version") {
|
|
49
|
+
options.information = argument === "--help" ? "help" : "version";
|
|
50
|
+
return options;
|
|
51
|
+
}
|
|
52
|
+
if (!argument.startsWith("-") || argument === "-") {
|
|
53
|
+
accumulating = false;
|
|
54
|
+
options.files.push(argument);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const isLong = argument.startsWith("--");
|
|
58
|
+
let switches = argument.slice(1), attached;
|
|
59
|
+
if (isLong) {
|
|
60
|
+
const equal = argument.indexOf("=");
|
|
61
|
+
const name = argument.slice(2, equal < 0 ? undefined : equal);
|
|
62
|
+
const candidates = Object.keys(long).filter(candidate => candidate.startsWith(name));
|
|
63
|
+
if (!Object.hasOwn(long, name) && candidates.length > 1)
|
|
64
|
+
throw new PrError(`option ${quote(argument)} is ambiguous; possibilities:${candidates.map(candidate => ` '--${candidate}'`).join("")}`, true);
|
|
65
|
+
switches = long[name] ?? (candidates.length === 1 ? long[candidates[0]] : undefined) ?? "";
|
|
66
|
+
if (!switches)
|
|
67
|
+
throw new PrError(`unrecognized option ${quote(argument)}`, true);
|
|
68
|
+
if (equal >= 0)
|
|
69
|
+
attached = argument.slice(equal + 1);
|
|
70
|
+
}
|
|
71
|
+
for (let offset = 0; offset < switches.length; offset++) {
|
|
72
|
+
const option = switches[offset];
|
|
73
|
+
if (digit(option)) {
|
|
74
|
+
columnDigits = (accumulating ? columnDigits ?? "" : "") + option;
|
|
75
|
+
accumulating = true;
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
accumulating = false;
|
|
79
|
+
const required = "#hlwWNo".includes(option);
|
|
80
|
+
const optional = "nseiS".includes(option);
|
|
81
|
+
let value = attached;
|
|
82
|
+
if (required || optional) {
|
|
83
|
+
if (!isLong && offset + 1 < switches.length)
|
|
84
|
+
value = switches.slice(offset + 1);
|
|
85
|
+
if (required && value === undefined) {
|
|
86
|
+
value = args[++index];
|
|
87
|
+
if (value === undefined)
|
|
88
|
+
throw new PrError(isLong ? `option ${quote(argument)} requires an argument` : `option requires an argument -- '${option}'`, true);
|
|
89
|
+
}
|
|
90
|
+
offset = switches.length;
|
|
91
|
+
}
|
|
92
|
+
else if (attached !== undefined)
|
|
93
|
+
throw new PrError(`option ${quote(argument.slice(0, argument.indexOf("=")))} doesn't allow an argument`, true);
|
|
94
|
+
switch (option) {
|
|
95
|
+
case "#":
|
|
96
|
+
options.columns = integer(value, 1, "invalid number of columns");
|
|
97
|
+
options.explicitColumns = true;
|
|
98
|
+
columnDigits = undefined;
|
|
99
|
+
break;
|
|
100
|
+
case "h":
|
|
101
|
+
options.header = value;
|
|
102
|
+
break;
|
|
103
|
+
case "l":
|
|
104
|
+
options.length = integer(value, 1, "'-l PAGE_LENGTH' invalid number of lines");
|
|
105
|
+
break;
|
|
106
|
+
case "w":
|
|
107
|
+
oldWidth = true;
|
|
108
|
+
oldOptions = true;
|
|
109
|
+
{
|
|
110
|
+
const width = integer(value, 1, "'-w PAGE_WIDTH' invalid number of characters");
|
|
111
|
+
if (!options.truncate)
|
|
112
|
+
options.width = width;
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
case "W":
|
|
116
|
+
oldWidth = false;
|
|
117
|
+
options.truncate = true;
|
|
118
|
+
options.width = integer(value, 1, "'-W PAGE_WIDTH' invalid number of characters");
|
|
119
|
+
break;
|
|
120
|
+
case "m":
|
|
121
|
+
options.merge = true;
|
|
122
|
+
break;
|
|
123
|
+
case "a":
|
|
124
|
+
options.across = true;
|
|
125
|
+
break;
|
|
126
|
+
case "b": break;
|
|
127
|
+
case "d":
|
|
128
|
+
options.doubleSpace = true;
|
|
129
|
+
break;
|
|
130
|
+
case "f":
|
|
131
|
+
case "F":
|
|
132
|
+
options.formFeed = true;
|
|
133
|
+
break;
|
|
134
|
+
case "J":
|
|
135
|
+
options.join = true;
|
|
136
|
+
break;
|
|
137
|
+
case "N":
|
|
138
|
+
options.startNumber = integer(value, -2147483648, "'-N NUMBER' invalid starting line number");
|
|
139
|
+
break;
|
|
140
|
+
case "o":
|
|
141
|
+
options.margin = integer(value, 0, "'-o MARGIN' invalid line offset");
|
|
142
|
+
break;
|
|
143
|
+
case "r":
|
|
144
|
+
options.quiet = true;
|
|
145
|
+
break;
|
|
146
|
+
case "s":
|
|
147
|
+
oldOptions = true;
|
|
148
|
+
oldSeparator = true;
|
|
149
|
+
if (!options.useSeparator && value !== undefined)
|
|
150
|
+
options.separator = value;
|
|
151
|
+
break;
|
|
152
|
+
case "S":
|
|
153
|
+
oldSeparator = false;
|
|
154
|
+
options.useSeparator = true;
|
|
155
|
+
options.separator = value ?? "";
|
|
156
|
+
break;
|
|
157
|
+
case "t":
|
|
158
|
+
options.extremities = false;
|
|
159
|
+
options.keepFF = true;
|
|
160
|
+
break;
|
|
161
|
+
case "T":
|
|
162
|
+
options.extremities = false;
|
|
163
|
+
options.keepFF = false;
|
|
164
|
+
break;
|
|
165
|
+
case "c":
|
|
166
|
+
options.control = true;
|
|
167
|
+
break;
|
|
168
|
+
case "v":
|
|
169
|
+
options.octal = true;
|
|
170
|
+
break;
|
|
171
|
+
case "n":
|
|
172
|
+
case "e":
|
|
173
|
+
case "i": {
|
|
174
|
+
if (option === "n")
|
|
175
|
+
options.numbered = true;
|
|
176
|
+
if (option === "e")
|
|
177
|
+
options.expand = true;
|
|
178
|
+
if (option === "i")
|
|
179
|
+
options.tabify = true;
|
|
180
|
+
if (value === undefined || !value.length)
|
|
181
|
+
break;
|
|
182
|
+
let character;
|
|
183
|
+
if (!digit(value[0])) {
|
|
184
|
+
character = value[0];
|
|
185
|
+
value = value.slice(1);
|
|
186
|
+
}
|
|
187
|
+
let count;
|
|
188
|
+
if (value.length) {
|
|
189
|
+
try {
|
|
190
|
+
count = integer(value, 1, "invalid number");
|
|
191
|
+
}
|
|
192
|
+
catch {
|
|
193
|
+
throw new PrError(`'-${option}' extra characters or invalid number in the argument: ${quote(value)}${Number(value) > 2147483647 ? ": Value too large for defined data type" : ""}`, true);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (option === "n") {
|
|
197
|
+
options.numberSeparator = character ?? options.numberSeparator;
|
|
198
|
+
options.digits = count ?? options.digits;
|
|
199
|
+
}
|
|
200
|
+
if (option === "e") {
|
|
201
|
+
options.inputTab = character ?? options.inputTab;
|
|
202
|
+
options.inputTabWidth = count ?? options.inputTabWidth;
|
|
203
|
+
}
|
|
204
|
+
if (option === "i") {
|
|
205
|
+
options.outputTab = character ?? options.outputTab;
|
|
206
|
+
options.outputTabWidth = count ?? options.outputTabWidth;
|
|
207
|
+
}
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
default: throw new PrError(`invalid option -- '${option}'`, true);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (columnDigits !== undefined) {
|
|
215
|
+
options.columns = integer(columnDigits, 1, "invalid number of columns");
|
|
216
|
+
options.explicitColumns = true;
|
|
217
|
+
}
|
|
218
|
+
if (options.merge && options.explicitColumns)
|
|
219
|
+
throw new PrError("cannot specify number of columns when printing in parallel");
|
|
220
|
+
if (options.merge && options.across)
|
|
221
|
+
throw new PrError("cannot specify both printing across and printing in parallel");
|
|
222
|
+
if (oldOptions) {
|
|
223
|
+
if (oldWidth) {
|
|
224
|
+
if (options.merge || options.explicitColumns) {
|
|
225
|
+
options.truncate = true;
|
|
226
|
+
if (oldSeparator)
|
|
227
|
+
options.useSeparator = true;
|
|
228
|
+
}
|
|
229
|
+
else
|
|
230
|
+
options.join = true;
|
|
231
|
+
}
|
|
232
|
+
else if (!options.useSeparator && oldSeparator && (options.merge || options.explicitColumns)) {
|
|
233
|
+
if (!options.truncate) {
|
|
234
|
+
options.join = true;
|
|
235
|
+
if (options.separator.length)
|
|
236
|
+
options.useSeparator = true;
|
|
237
|
+
}
|
|
238
|
+
else
|
|
239
|
+
options.useSeparator = true;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
const { limits } = budget;
|
|
243
|
+
budget.check(options.files.length, limits.maxFiles, "input files");
|
|
244
|
+
budget.check(options.merge ? Math.max(1, options.files.length) : options.columns, limits.maxColumns, "columns");
|
|
245
|
+
budget.check(options.length, limits.maxPageLines, "page lines");
|
|
246
|
+
for (const width of [options.width, options.margin, options.digits, options.inputTabWidth, options.outputTabWidth])
|
|
247
|
+
budget.check(width, limits.maxPageWidth, "page width");
|
|
248
|
+
return options;
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/commands/pr/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAoCvD,SAAS,KAAK,CAAC,KAAa,IAAa,OAAO,KAAK,IAAI,GAAG,IA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AQ,EAAE,CAAC;gBAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;gBAAC,IAAI,OAAO,CAAC,SAAS,CAAC,MAAM;oBAAE,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;YAAC,CAAC;;gBACrG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;QACnC,CAAC;IACH,CAAC;IACD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IACnE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAChH,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IAChE,KAAK,MAAM,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,cAAc,CAAC;QAAE,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IAC3K,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -97,6 +97,11 @@ import {
|
|
|
97
97
|
openFileOutput,
|
|
98
98
|
writeFileOutput
|
|
99
99
|
} from "./chunks/chunk-QY2XHZTE.js";
|
|
100
|
+
import {
|
|
101
|
+
createPrCommand,
|
|
102
|
+
createPrCommands,
|
|
103
|
+
prCommands
|
|
104
|
+
} from "./chunks/chunk-FRSZDCZA.js";
|
|
100
105
|
import {
|
|
101
106
|
createOutputOperation
|
|
102
107
|
} from "./chunks/chunk-PPVCI2F2.js";
|
|
@@ -36223,6 +36228,9 @@ function composeAgentCommands(options2, executors) {
|
|
|
36223
36228
|
const grep = createGrepCommands(executors.grep);
|
|
36224
36229
|
const exprLimits = options2.expr?.limits;
|
|
36225
36230
|
const csplitLimits = options2.csplit?.limits;
|
|
36231
|
+
const prOptions = options2.pr;
|
|
36232
|
+
const prLimits = prOptions?.limits;
|
|
36233
|
+
const prClock = prOptions?.clock;
|
|
36226
36234
|
const whichLimits = options2.which?.limits;
|
|
36227
36235
|
const timeoutOptions = options2.timeout;
|
|
36228
36236
|
const applyPatchLimits = options2.applyPatch?.limits;
|
|
@@ -36256,7 +36264,8 @@ function composeAgentCommands(options2, executors) {
|
|
|
36256
36264
|
}),
|
|
36257
36265
|
...createApplyPatchCommands(applyPatchLimits === void 0 ? {} : { limits: applyPatchLimits }),
|
|
36258
36266
|
...createXmlCommands(xmlLimits === void 0 ? {} : { limits: xmlLimits }),
|
|
36259
|
-
createCsplitCommandWithExecutor(executors.csplit, csplitLimits === void 0 ? {} : { limits: csplitLimits })
|
|
36267
|
+
createCsplitCommandWithExecutor(executors.csplit, csplitLimits === void 0 ? {} : { limits: csplitLimits }),
|
|
36268
|
+
...createPrCommands({ ...prLimits === void 0 ? {} : { limits: prLimits }, ...prClock === void 0 ? {} : { clock: prClock } })
|
|
36260
36269
|
);
|
|
36261
36270
|
return new CommandRegistry(commands).list();
|
|
36262
36271
|
}
|
|
@@ -41557,8 +41566,18 @@ var Budget25 = class {
|
|
|
41557
41566
|
signal.throwIfAborted();
|
|
41558
41567
|
if (!(chunk instanceof Uint8Array)) throw new TypeError("Shell output must be Uint8Array");
|
|
41559
41568
|
if (chunk.byteLength > this.limits.maxOutputBytes - this.bytes) this.fail("maxOutputBytes");
|
|
41560
|
-
|
|
41561
|
-
|
|
41569
|
+
try {
|
|
41570
|
+
const capability = sink.ownedOutput;
|
|
41571
|
+
const write2 = capability.write;
|
|
41572
|
+
signal.throwIfAborted();
|
|
41573
|
+
if (chunk.byteLength > this.limits.maxOutputBytes - this.bytes) this.fail("maxOutputBytes");
|
|
41574
|
+
this.bytes += chunk.byteLength;
|
|
41575
|
+
await Reflect.apply(write2, capability, [chunk]);
|
|
41576
|
+
} catch (error) {
|
|
41577
|
+
signal.throwIfAborted();
|
|
41578
|
+
throw error;
|
|
41579
|
+
}
|
|
41580
|
+
signal.throwIfAborted();
|
|
41562
41581
|
}
|
|
41563
41582
|
} } : {},
|
|
41564
41583
|
write: async (chunk) => {
|
|
@@ -41726,7 +41745,16 @@ function signalSink(sink, signal) {
|
|
|
41726
41745
|
consumerClosed: sink.ownedOutput.consumerClosed,
|
|
41727
41746
|
async write(chunk) {
|
|
41728
41747
|
signal.throwIfAborted();
|
|
41729
|
-
|
|
41748
|
+
try {
|
|
41749
|
+
const capability = sink.ownedOutput;
|
|
41750
|
+
const write3 = capability.write;
|
|
41751
|
+
signal.throwIfAborted();
|
|
41752
|
+
await Reflect.apply(write3, capability, [chunk]);
|
|
41753
|
+
} catch (error) {
|
|
41754
|
+
signal.throwIfAborted();
|
|
41755
|
+
throw error;
|
|
41756
|
+
}
|
|
41757
|
+
signal.throwIfAborted();
|
|
41730
41758
|
}
|
|
41731
41759
|
} } : {},
|
|
41732
41760
|
async write(chunk) {
|
|
@@ -48532,7 +48560,7 @@ init_platform();
|
|
|
48532
48560
|
// packages/safe-js/dist/browser/safe-fs.js
|
|
48533
48561
|
init_platform();
|
|
48534
48562
|
|
|
48535
|
-
// packages/safe-js/dist/browser/chunks/chunk-
|
|
48563
|
+
// packages/safe-js/dist/browser/chunks/chunk-HG5OAL4N.js
|
|
48536
48564
|
init_platform();
|
|
48537
48565
|
var platform = Object.freeze({
|
|
48538
48566
|
errno(_code) {
|
|
@@ -52362,6 +52390,8 @@ export {
|
|
|
52362
52390
|
createOriginAuthorizer,
|
|
52363
52391
|
createOutputOperation,
|
|
52364
52392
|
createOverlayFileSystem2 as createOverlayFileSystem,
|
|
52393
|
+
createPrCommand,
|
|
52394
|
+
createPrCommands,
|
|
52365
52395
|
createReadOnlyFileSystem2 as createReadOnlyFileSystem,
|
|
52366
52396
|
createSafeJsCommands,
|
|
52367
52397
|
createSearchCommands,
|
|
@@ -52420,6 +52450,7 @@ export {
|
|
|
52420
52450
|
pipeBytes,
|
|
52421
52451
|
portableSearchCommands,
|
|
52422
52452
|
posixPath3 as posixPath,
|
|
52453
|
+
prCommands,
|
|
52423
52454
|
readBytes,
|
|
52424
52455
|
relativePath3 as relativePath,
|
|
52425
52456
|
resolvePath3 as resolvePath,
|