@poe-platform/safe-bash 0.1.534 → 0.1.535
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-5Y4AEZB2.js +517 -0
- package/dist/safe-bash/chunks/chunk-5Y4AEZB2.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-IKATLB4I.js → chunk-AVXYPKV7.js} +7 -5
- package/dist/safe-bash/chunks/{chunk-IKATLB4I.js.map → chunk-AVXYPKV7.js.map} +1 -1
- package/dist/safe-bash/chunks/{chunk-LUJYX5H5.js → chunk-L2GZSOSJ.js} +245 -747
- package/dist/safe-bash/chunks/chunk-L2GZSOSJ.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-54Z5EUCW.js → chunk-M7KZ7V4P.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-UGMUVHIY.js → chunk-NVUC5B2R.js} +10 -188
- package/dist/safe-bash/chunks/{chunk-UGMUVHIY.js.map → chunk-NVUC5B2R.js.map} +3 -3
- package/dist/safe-bash/chunks/{chunk-2GV4WO7O.js → chunk-PPVCI2F2.js} +2 -2
- package/dist/safe-bash/chunks/chunk-QY2XHZTE.js +192 -0
- package/dist/safe-bash/chunks/chunk-QY2XHZTE.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-6MHYEBAJ.js → chunk-UZELUFGF.js} +8 -6
- package/dist/safe-bash/chunks/{chunk-6MHYEBAJ.js.map → chunk-UZELUFGF.js.map} +1 -1
- package/dist/safe-bash/chunks/chunk-XROAIPKA.js +12095 -0
- package/dist/safe-bash/chunks/chunk-XROAIPKA.js.map +7 -0
- package/dist/safe-bash/commands/csplit/command.d.ts +6 -0
- package/dist/safe-bash/commands/csplit/command.d.ts.map +1 -0
- package/dist/safe-bash/commands/csplit/command.js +78 -0
- package/dist/safe-bash/commands/csplit/command.js.map +1 -0
- package/dist/safe-bash/commands/csplit/index.browser.js +14 -0
- package/dist/safe-bash/commands/csplit/index.browser.js.map +7 -0
- package/dist/safe-bash/commands/csplit/index.d.ts +7 -0
- package/dist/safe-bash/commands/csplit/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/csplit/index.js +21 -0
- package/dist/safe-bash/commands/csplit/index.js.map +1 -0
- package/dist/safe-bash/commands/csplit/internal.d.ts +61 -0
- package/dist/safe-bash/commands/csplit/internal.d.ts.map +1 -0
- package/dist/safe-bash/commands/csplit/internal.js +147 -0
- package/dist/safe-bash/commands/csplit/internal.js.map +1 -0
- package/dist/safe-bash/commands/csplit/io.d.ts +52 -0
- package/dist/safe-bash/commands/csplit/io.d.ts.map +1 -0
- package/dist/safe-bash/commands/csplit/io.js +330 -0
- package/dist/safe-bash/commands/csplit/io.js.map +1 -0
- package/dist/safe-bash/commands/csplit/options.d.ts +16 -0
- package/dist/safe-bash/commands/csplit/options.d.ts.map +1 -0
- package/dist/safe-bash/commands/csplit/options.js +178 -0
- package/dist/safe-bash/commands/csplit/options.js.map +1 -0
- package/dist/safe-bash/commands/csplit/patterns.d.ts +19 -0
- package/dist/safe-bash/commands/csplit/patterns.d.ts.map +1 -0
- package/dist/safe-bash/commands/csplit/patterns.js +92 -0
- package/dist/safe-bash/commands/csplit/patterns.js.map +1 -0
- package/dist/safe-bash/commands/csplit/quoting.d.ts +2 -0
- package/dist/safe-bash/commands/csplit/quoting.d.ts.map +1 -0
- package/dist/safe-bash/commands/csplit/quoting.js +138 -0
- package/dist/safe-bash/commands/csplit/quoting.js.map +1 -0
- package/dist/safe-bash/commands/csplit/split.d.ts +18 -0
- package/dist/safe-bash/commands/csplit/split.d.ts.map +1 -0
- package/dist/safe-bash/commands/csplit/split.js +122 -0
- package/dist/safe-bash/commands/csplit/split.js.map +1 -0
- package/dist/safe-bash/commands/expr/bre-engine.d.ts +4 -1
- package/dist/safe-bash/commands/expr/bre-engine.d.ts.map +1 -1
- package/dist/safe-bash/commands/expr/bre-engine.js +724 -13
- package/dist/safe-bash/commands/expr/bre-engine.js.map +1 -1
- package/dist/safe-bash/commands/expr/bre-worker.d.ts +2 -1
- package/dist/safe-bash/commands/expr/bre-worker.d.ts.map +1 -1
- package/dist/safe-bash/commands/expr/bre-worker.js +10 -1
- package/dist/safe-bash/commands/expr/bre-worker.js.map +1 -1
- package/dist/safe-bash/commands/network/index.browser.js +5 -3
- package/dist/safe-bash/commands/regex-execution/bounded-provider.d.ts.map +1 -1
- package/dist/safe-bash/commands/regex-execution/bounded-provider.js +16 -5
- package/dist/safe-bash/commands/regex-execution/bounded-provider.js.map +1 -1
- package/dist/safe-bash/commands/regex-execution/portable.d.ts +3 -1
- package/dist/safe-bash/commands/regex-execution/portable.d.ts.map +1 -1
- package/dist/safe-bash/commands/regex-execution/portable.js +17 -4
- package/dist/safe-bash/commands/regex-execution/portable.js.map +1 -1
- package/dist/safe-bash/commands/regex-execution/protocol.d.ts +31 -0
- package/dist/safe-bash/commands/regex-execution/protocol.d.ts.map +1 -1
- package/dist/safe-bash/commands/regex-execution/protocol.js +83 -0
- package/dist/safe-bash/commands/regex-execution/protocol.js.map +1 -1
- package/dist/safe-bash/commands/regex-execution/provider.d.ts +2 -2
- package/dist/safe-bash/commands/regex-execution/provider.d.ts.map +1 -1
- package/dist/safe-bash/commands/regex-execution/worker.js +16 -2
- package/dist/safe-bash/commands/regex-execution/worker.js.map +1 -1
- package/dist/safe-bash/commands/xml/index.browser.js +4 -3
- package/dist/safe-bash/commands/yq/index.browser.js +5 -4
- package/dist/safe-bash/core.browser.js +1918 -4077
- package/dist/safe-bash/core.browser.js.map +4 -4
- 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 +3 -0
- package/dist/safe-bash/plugins/composition.d.ts.map +1 -1
- package/dist/safe-bash/plugins/composition.js +3 -1
- package/dist/safe-bash/plugins/composition.js.map +1 -1
- package/dist/safe-bash/plugins/index.js +1 -1
- package/dist/safe-bash/plugins/index.js.map +1 -1
- package/package.json +8 -2
- package/dist/safe-bash/chunks/chunk-LUJYX5H5.js.map +0 -7
- /package/dist/safe-bash/chunks/{chunk-54Z5EUCW.js.map → chunk-M7KZ7V4P.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-2GV4WO7O.js.map → chunk-PPVCI2F2.js.map} +0 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createOutputOperation
|
|
3
|
+
} from "./chunk-PPVCI2F2.js";
|
|
4
|
+
import {
|
|
5
|
+
FsError,
|
|
6
|
+
createBytePipe,
|
|
7
|
+
init_platform,
|
|
8
|
+
outputFailure
|
|
9
|
+
} from "./chunk-L2GZSOSJ.js";
|
|
10
|
+
|
|
11
|
+
// packages/safe-bash/src/contracts/filesystem-output.ts
|
|
12
|
+
init_platform();
|
|
13
|
+
var filesystemOutputBudgets = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
function bindFileOutputBudget(context, budget) {
|
|
15
|
+
if (!context.registerCleanup) throw new TypeError("Shell output budgets require invocation cleanup ownership");
|
|
16
|
+
filesystemOutputBudgets.set(context.registerCleanup, budget);
|
|
17
|
+
}
|
|
18
|
+
async function writeFileOutput(context, bytes, write) {
|
|
19
|
+
context.signal.throwIfAborted();
|
|
20
|
+
const budget = context.registerCleanup && filesystemOutputBudgets.get(context.registerCleanup);
|
|
21
|
+
let pending;
|
|
22
|
+
const destination = { write(chunk) {
|
|
23
|
+
context.signal.throwIfAborted();
|
|
24
|
+
return pending = (async () => {
|
|
25
|
+
await write(chunk);
|
|
26
|
+
})();
|
|
27
|
+
} };
|
|
28
|
+
try {
|
|
29
|
+
await (budget?.(destination) ?? destination).write(bytes);
|
|
30
|
+
} catch (error) {
|
|
31
|
+
await pending?.catch(() => {
|
|
32
|
+
});
|
|
33
|
+
context.signal.throwIfAborted();
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
context.signal.throwIfAborted();
|
|
37
|
+
}
|
|
38
|
+
async function openFileOutput(context, path, flag, incremental) {
|
|
39
|
+
let pipe;
|
|
40
|
+
let task;
|
|
41
|
+
let completed = false;
|
|
42
|
+
let ended = false;
|
|
43
|
+
let closing = false;
|
|
44
|
+
let failure;
|
|
45
|
+
const consumer = new AbortController();
|
|
46
|
+
let writes = Promise.resolve();
|
|
47
|
+
let acknowledge;
|
|
48
|
+
const acknowledgeWrite = () => {
|
|
49
|
+
const accepted = acknowledge;
|
|
50
|
+
acknowledge = void 0;
|
|
51
|
+
accepted?.();
|
|
52
|
+
};
|
|
53
|
+
let ready;
|
|
54
|
+
const opened = new Promise((resolve) => {
|
|
55
|
+
ready = resolve;
|
|
56
|
+
});
|
|
57
|
+
const destination = {
|
|
58
|
+
[outputFailure]: (reason) => operation.abort(reason),
|
|
59
|
+
async write(chunk) {
|
|
60
|
+
if (closing) throw new FsError("EBADF", { path, syscall: "write" });
|
|
61
|
+
const writing = writes.then(async () => {
|
|
62
|
+
for (let offset = 0; offset < chunk.byteLength; offset += 64 * 1024) {
|
|
63
|
+
const accepted = new Promise((resolve) => {
|
|
64
|
+
acknowledge = resolve;
|
|
65
|
+
});
|
|
66
|
+
await pipe.writable.write(chunk.subarray(offset, offset + 64 * 1024));
|
|
67
|
+
await accepted;
|
|
68
|
+
if (failure) throw failure.reason;
|
|
69
|
+
operation.signal.throwIfAborted();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
writes = writing.catch(() => {
|
|
73
|
+
});
|
|
74
|
+
await writing;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const budget = context.registerCleanup && filesystemOutputBudgets.get(context.registerCleanup);
|
|
78
|
+
const operation = createOutputOperation(context, budget?.(destination) ?? destination);
|
|
79
|
+
operation.registerCleanup(async () => {
|
|
80
|
+
closing = true;
|
|
81
|
+
if (!completed) {
|
|
82
|
+
void operation.abort(operation.signal.aborted ? operation.signal.reason : new FsError("ECANCELED", { path, syscall: "write" }));
|
|
83
|
+
await pipe?.abort(operation.signal.reason);
|
|
84
|
+
}
|
|
85
|
+
await task?.catch(() => {
|
|
86
|
+
});
|
|
87
|
+
await writes;
|
|
88
|
+
});
|
|
89
|
+
try {
|
|
90
|
+
pipe = createBytePipe({ highWaterMark: 1, signal: operation.signal });
|
|
91
|
+
let reading = false;
|
|
92
|
+
const source = {
|
|
93
|
+
[Symbol.asyncIterator]() {
|
|
94
|
+
return (async function* () {
|
|
95
|
+
reading = true;
|
|
96
|
+
ready();
|
|
97
|
+
for await (const chunk of pipe.readable) {
|
|
98
|
+
yield chunk;
|
|
99
|
+
acknowledgeWrite();
|
|
100
|
+
}
|
|
101
|
+
operation.signal.throwIfAborted();
|
|
102
|
+
ended = true;
|
|
103
|
+
})();
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
task = (async () => {
|
|
107
|
+
const { fs } = context;
|
|
108
|
+
const signal = operation.signal;
|
|
109
|
+
signal.throwIfAborted();
|
|
110
|
+
const capabilities = await fs.capabilitiesFor?.(path, { signal }) ?? fs.capabilities;
|
|
111
|
+
if (capabilities.readOnly === true) throw new FsError("EROFS", { path, syscall: "write" });
|
|
112
|
+
try {
|
|
113
|
+
await fs.access(path, 2, { signal });
|
|
114
|
+
} catch (error) {
|
|
115
|
+
signal.throwIfAborted();
|
|
116
|
+
if (!(error instanceof FsError) || error.code !== "ENOENT" && error.code !== "ENOTSUP") throw error;
|
|
117
|
+
}
|
|
118
|
+
signal.throwIfAborted();
|
|
119
|
+
const streaming = flag === "a" ? capabilities.streamingAppend ?? capabilities.streamingWrite : capabilities.streamingWrite;
|
|
120
|
+
if ((!incremental || capabilities.descriptorWriteStream === true) && streaming !== false && fs.writeStream) {
|
|
121
|
+
try {
|
|
122
|
+
await fs.writeStream(path, source, { flag, signal });
|
|
123
|
+
if (!ended) throw new FsError("EIO", { path, message: "Streaming writer returned before consuming output" });
|
|
124
|
+
return;
|
|
125
|
+
} catch (error) {
|
|
126
|
+
signal.throwIfAborted();
|
|
127
|
+
if (reading || !(error instanceof FsError) || error.code !== "ENOTSUP") throw error;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (flag === "w" && capabilities.write === false) throw new FsError("ENOTSUP", { path, syscall: "writeFile" });
|
|
131
|
+
if ((!incremental || flag === "a") && capabilities.append === false) throw new FsError("ENOTSUP", { path, syscall: "appendFile" });
|
|
132
|
+
const sink = incremental ? await incremental() : await (async () => {
|
|
133
|
+
if (flag === "a") await fs.appendFile(path, new Uint8Array(), { signal });
|
|
134
|
+
else await fs.writeFile(path, new Uint8Array(), { flag, signal });
|
|
135
|
+
return { write: (chunk) => fs.appendFile(path, chunk, { signal }) };
|
|
136
|
+
})();
|
|
137
|
+
for await (const chunk of source) {
|
|
138
|
+
signal.throwIfAborted();
|
|
139
|
+
await sink.write(chunk);
|
|
140
|
+
}
|
|
141
|
+
})();
|
|
142
|
+
void task.then(acknowledgeWrite, (error) => {
|
|
143
|
+
failure = { reason: error };
|
|
144
|
+
acknowledgeWrite();
|
|
145
|
+
if (!operation.signal.aborted) consumer.abort(error);
|
|
146
|
+
void operation.abort(error).catch(() => {
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
await Promise.race([opened, task]);
|
|
150
|
+
operation.signal.throwIfAborted();
|
|
151
|
+
const write = async (chunk) => {
|
|
152
|
+
try {
|
|
153
|
+
await operation.output.write(chunk);
|
|
154
|
+
} catch (error) {
|
|
155
|
+
throw failure ? failure.reason : error;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
return {
|
|
159
|
+
signal: operation.signal,
|
|
160
|
+
sink: {
|
|
161
|
+
[outputFailure]: destination[outputFailure],
|
|
162
|
+
ownedOutput: { consumerClosed: consumer.signal, write },
|
|
163
|
+
write
|
|
164
|
+
},
|
|
165
|
+
async finish() {
|
|
166
|
+
closing = true;
|
|
167
|
+
try {
|
|
168
|
+
await writes;
|
|
169
|
+
await pipe.close();
|
|
170
|
+
await task;
|
|
171
|
+
operation.signal.throwIfAborted();
|
|
172
|
+
completed = true;
|
|
173
|
+
} catch (error) {
|
|
174
|
+
throw failure ? failure.reason : error;
|
|
175
|
+
} finally {
|
|
176
|
+
await operation.close();
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
abort: (reason) => operation.abort(reason)
|
|
180
|
+
};
|
|
181
|
+
} catch (error) {
|
|
182
|
+
await operation.abort(error);
|
|
183
|
+
throw error;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export {
|
|
188
|
+
bindFileOutputBudget,
|
|
189
|
+
writeFileOutput,
|
|
190
|
+
openFileOutput
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=chunk-QY2XHZTE.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/contracts/filesystem-output.ts"],
|
|
4
|
+
"sourcesContent": ["import type { CommandContext } from \"./command.js\";\nimport { FsError } from \"./errors.js\";\nimport { createBytePipe, outputFailure, type BytePipe, type ByteSink, type ByteSource } from \"./io.js\";\nimport { createOutputOperation } from \"./output.js\";\n\nconst filesystemOutputBudgets = new WeakMap<NonNullable<CommandContext[\"registerCleanup\"]>, (sink: ByteSink) => ByteSink>();\n\nexport type FileOutputContext = Pick<CommandContext, \"fs\" | \"signal\" | \"registerCleanup\">;\n\nexport function bindFileOutputBudget(context: Pick<CommandContext, \"registerCleanup\">, budget: (sink: ByteSink) => ByteSink): void {\n if (!context.registerCleanup) throw new TypeError(\"Shell output budgets require invocation cleanup ownership\");\n filesystemOutputBudgets.set(context.registerCleanup, budget);\n}\n\nexport async function writeFileOutput(context: Pick<CommandContext, \"signal\" | \"registerCleanup\">, bytes: Uint8Array, write: (bytes: Uint8Array) => Promise<void>): Promise<void> {\n context.signal.throwIfAborted();\n const budget = context.registerCleanup && filesystemOutputBudgets.get(context.registerCleanup);\n let pending: Promise<void> | undefined;\n const destination: ByteSink = { write(chunk) {\n context.signal.throwIfAborted();\n return pending = (async () => { await write(chunk); })();\n } };\n try { await (budget?.(destination) ?? destination).write(bytes); }\n catch (error) {\n // Shell sink cancellation may win its race before the direct host call.\n // Keep the original awaited-write lifetime without a retained cleanup hook.\n await pending?.catch(() => {});\n context.signal.throwIfAborted();\n throw error;\n }\n context.signal.throwIfAborted();\n}\n\nexport interface FileOutput {\n readonly sink: ByteSink;\n readonly signal: AbortSignal;\n finish(): Promise<void>;\n abort(reason: unknown): Promise<void>;\n}\n\nexport async function openFileOutput(context: FileOutputContext, path: string, flag: \"w\" | \"a\", incremental?: () => Promise<ByteSink>): Promise<FileOutput> {\n let pipe: BytePipe | undefined;\n let task: Promise<void> | undefined;\n let completed = false;\n let ended = false;\n let closing = false;\n let failure: { reason: unknown } | undefined;\n const consumer = new AbortController();\n let writes = Promise.resolve();\n let acknowledge: (() => void) | undefined;\n const acknowledgeWrite = (): void => {\n const accepted = acknowledge;\n acknowledge = undefined;\n accepted?.();\n };\n let ready!: () => void;\n const opened = new Promise<void>(resolve => { ready = resolve; });\n const destination: ByteSink = {\n [outputFailure]: reason => operation.abort(reason),\n async write(chunk) {\n if (closing) throw new FsError(\"EBADF\", { path, syscall: \"write\" });\n const writing = writes.then(async () => {\n for (let offset = 0; offset < chunk.byteLength; offset += 64 * 1024) {\n const accepted = new Promise<void>(resolve => { acknowledge = resolve; });\n await pipe!.writable.write(chunk.subarray(offset, offset + 64 * 1024));\n await accepted;\n if (failure) throw failure.reason;\n operation.signal.throwIfAborted();\n }\n });\n writes = writing.catch(() => {});\n await writing;\n },\n };\n const budget = context.registerCleanup && filesystemOutputBudgets.get(context.registerCleanup);\n const operation = createOutputOperation(context, budget?.(destination) ?? destination);\n operation.registerCleanup(async () => {\n closing = true;\n if (!completed) {\n void operation.abort(operation.signal.aborted ? operation.signal.reason : new FsError(\"ECANCELED\", { path, syscall: \"write\" }));\n await pipe?.abort(operation.signal.reason);\n }\n await task?.catch(() => {});\n await writes;\n });\n try {\n pipe = createBytePipe({ highWaterMark: 1, signal: operation.signal });\n let reading = false;\n const source: ByteSource = {\n [Symbol.asyncIterator]() {\n return (async function* () {\n reading = true;\n ready();\n for await (const chunk of pipe!.readable) {\n yield chunk;\n acknowledgeWrite();\n }\n operation.signal.throwIfAborted();\n ended = true;\n })();\n },\n };\n task = (async () => {\n const { fs } = context;\n const signal = operation.signal;\n signal.throwIfAborted();\n const capabilities = await fs.capabilitiesFor?.(path, { signal }) ?? fs.capabilities;\n if (capabilities.readOnly === true) throw new FsError(\"EROFS\", { path, syscall: \"write\" });\n try { await fs.access(path, 2, { signal }); }\n catch (error) {\n signal.throwIfAborted();\n if (!(error instanceof FsError) || error.code !== \"ENOENT\" && error.code !== \"ENOTSUP\") throw error;\n }\n signal.throwIfAborted();\n const streaming = flag === \"a\" ? capabilities.streamingAppend ?? capabilities.streamingWrite : capabilities.streamingWrite;\n if ((!incremental || capabilities.descriptorWriteStream === true) && streaming !== false && fs.writeStream) {\n try {\n await fs.writeStream(path, source, { flag, signal });\n if (!ended) throw new FsError(\"EIO\", { path, message: \"Streaming writer returned before consuming output\" });\n return;\n } catch (error) {\n signal.throwIfAborted();\n if (reading || !(error instanceof FsError) || error.code !== \"ENOTSUP\") throw error;\n }\n }\n if (flag === \"w\" && capabilities.write === false) throw new FsError(\"ENOTSUP\", { path, syscall: \"writeFile\" });\n if ((!incremental || flag === \"a\") && capabilities.append === false) throw new FsError(\"ENOTSUP\", { path, syscall: \"appendFile\" });\n const sink = incremental ? await incremental() : await (async (): Promise<ByteSink> => {\n if (flag === \"a\") await fs.appendFile(path, new Uint8Array(), { signal });\n else await fs.writeFile(path, new Uint8Array(), { flag, signal });\n return { write: chunk => fs.appendFile(path, chunk, { signal }) };\n })();\n for await (const chunk of source) {\n signal.throwIfAborted();\n await sink.write(chunk);\n }\n })();\n void task.then(acknowledgeWrite, error => {\n failure = { reason: error };\n acknowledgeWrite();\n if (!operation.signal.aborted) consumer.abort(error);\n void operation.abort(error).catch(() => {});\n });\n await Promise.race([opened, task]);\n operation.signal.throwIfAborted();\n const write = async (chunk: Uint8Array): Promise<void> => {\n try { await operation.output.write(chunk); }\n catch (error) { throw failure ? failure.reason : error; }\n };\n return {\n signal: operation.signal,\n sink: {\n [outputFailure]: destination[outputFailure]!,\n ownedOutput: { consumerClosed: consumer.signal, write },\n write,\n },\n async finish() {\n closing = true;\n try {\n await writes;\n await pipe!.close();\n await task;\n operation.signal.throwIfAborted();\n completed = true;\n } catch (error) { throw failure ? failure.reason : error; }\n finally { await operation.close(); }\n },\n abort: reason => operation.abort(reason),\n };\n } catch (error) {\n await operation.abort(error);\n throw error;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAAA;AAKA,IAAM,0BAA0B,oBAAI,QAAsF;AAInH,SAAS,qBAAqB,SAAkD,QAA4C;AACjI,MAAI,CAAC,QAAQ,gBAAiB,OAAM,IAAI,UAAU,2DAA2D;AAC7G,0BAAwB,IAAI,QAAQ,iBAAiB,MAAM;AAC7D;AAEA,eAAsB,gBAAgB,SAA6D,OAAmB,OAA4D;AAChL,UAAQ,OAAO,eAAe;AAC9B,QAAM,SAAS,QAAQ,mBAAmB,wBAAwB,IAAI,QAAQ,eAAe;AAC7F,MAAI;AACJ,QAAM,cAAwB,EAAE,MAAM,OAAO;AAC3C,YAAQ,OAAO,eAAe;AAC9B,WAAO,WAAW,YAAY;AAAE,YAAM,MAAM,KAAK;AAAA,IAAG,GAAG;AAAA,EACzD,EAAE;AACF,MAAI;AAAE,WAAO,SAAS,WAAW,KAAK,aAAa,MAAM,KAAK;AAAA,EAAG,SAC1D,OAAO;AAGZ,UAAM,SAAS,MAAM,MAAM;AAAA,IAAC,CAAC;AAC7B,YAAQ,OAAO,eAAe;AAC9B,UAAM;AAAA,EACR;AACA,UAAQ,OAAO,eAAe;AAChC;AASA,eAAsB,eAAe,SAA4B,MAAc,MAAiB,aAA4D;AAC1J,MAAI;AACJ,MAAI;AACJ,MAAI,YAAY;AAChB,MAAI,QAAQ;AACZ,MAAI,UAAU;AACd,M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AAE,gBAAgB,SAAS,QAAQ,MAAM;AAAA,QACtD;AAAA,MACF;AAAA,MACA,MAAM,SAAS;AACb,kBAAU;AACV,YAAI;AACF,gBAAM;AACN,gBAAM,KAAM,MAAM;AAClB,gBAAM;AACN,oBAAU,OAAO,eAAe;AAChC,sBAAY;AAAA,QACd,SAAS,OAAO;AAAE,gBAAM,UAAU,QAAQ,SAAS;AAAA,QAAO,UAC1D;AAAU,gBAAM,UAAU,MAAM;AAAA,QAAG;AAAA,MACrC;AAAA,MACA,OAAO,YAAU,UAAU,MAAM,MAAM;AAAA,IACzC;AAAA,EACF,SAAS,OAAO;AACd,UAAM,UAAU,MAAM,KAAK;AAC3B,UAAM;AAAA,EACR;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -21,21 +21,23 @@ import {
|
|
|
21
21
|
scalarJson,
|
|
22
22
|
truth,
|
|
23
23
|
wellFormed
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-M7KZ7V4P.js";
|
|
25
|
+
import {
|
|
26
|
+
escapeText,
|
|
27
|
+
pathOf
|
|
28
|
+
} from "./chunk-5Y4AEZB2.js";
|
|
25
29
|
import {
|
|
26
30
|
createOutputOperation
|
|
27
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-PPVCI2F2.js";
|
|
28
32
|
import {
|
|
29
33
|
FsError,
|
|
30
|
-
escapeText,
|
|
31
34
|
getCommandArguments,
|
|
32
35
|
import_buffer,
|
|
33
36
|
init_platform,
|
|
34
|
-
pathOf,
|
|
35
37
|
readBytes,
|
|
36
38
|
shellValueByteLength,
|
|
37
39
|
yieldTurn
|
|
38
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-L2GZSOSJ.js";
|
|
39
41
|
|
|
40
42
|
// packages/safe-bash/src/commands/yq/index.ts
|
|
41
43
|
init_platform();
|
|
@@ -5152,4 +5154,4 @@ export {
|
|
|
5152
5154
|
createYqCommands,
|
|
5153
5155
|
yqCommands
|
|
5154
5156
|
};
|
|
5155
|
-
//# sourceMappingURL=chunk-
|
|
5157
|
+
//# sourceMappingURL=chunk-UZELUFGF.js.map
|