@poe-platform/safe-bash 0.1.726 → 0.1.727
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-6VZX7ESE.js → chunk-26N7BLXE.js} +3 -3
- package/dist/safe-bash/chunks/{chunk-ZZ7JQBPX.js → chunk-4A2OLEML.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-LTREB3HX.js → chunk-54MC6XF5.js} +4 -4
- package/dist/safe-bash/chunks/{chunk-Z3CCN6Y2.js → chunk-6J5FUESH.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-YR5RZBWS.js → chunk-6TBFZ5JE.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-6HJNJ625.js → chunk-7MMYQG3P.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-WTZZX4LV.js → chunk-A4MB2KXV.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-EM2JW7ZH.js → chunk-ATYJKRBZ.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-VV24PRPB.js → chunk-AZQOEGP3.js} +1050 -101
- package/dist/safe-bash/chunks/chunk-AZQOEGP3.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-EFMXWUYE.js → chunk-B6JEJ6AT.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-JFGGQUYP.js → chunk-BFXGHT3R.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-RP5IZOOR.js → chunk-BJYV5J65.js} +1050 -101
- package/dist/safe-bash/chunks/chunk-BJYV5J65.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-HNHOPD3P.js → chunk-DIEFWGXO.js} +46 -26
- package/dist/safe-bash/chunks/{chunk-HNHOPD3P.js.map → chunk-DIEFWGXO.js.map} +2 -2
- package/dist/safe-bash/chunks/{chunk-SME47P4B.js → chunk-DV6EZOKM.js} +46 -26
- package/dist/safe-bash/chunks/{chunk-SME47P4B.js.map → chunk-DV6EZOKM.js.map} +2 -2
- package/dist/safe-bash/chunks/{chunk-646RTREQ.js → chunk-EEDOYIPC.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-OFAAHWL5.js → chunk-GCQ5A2T2.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-MJW4KSKV.js → chunk-GLPJEDLY.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-FOOJWH7J.js → chunk-GO5OKPBO.js} +4 -4
- package/dist/safe-bash/chunks/{chunk-5JANWFJ3.js → chunk-GWYXCCGO.js} +4 -4
- package/dist/safe-bash/chunks/{chunk-DPHRNHPT.js → chunk-H6KJ4L22.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-FLX2BZBF.js → chunk-HGBYIDAK.js} +4 -4
- package/dist/safe-bash/chunks/{chunk-VGJIDLZM.js → chunk-KS5VSJYM.js} +15 -8
- package/dist/safe-bash/chunks/chunk-KS5VSJYM.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-PO3Z7W3A.js → chunk-MUHYGUFD.js} +4 -4
- package/dist/safe-bash/chunks/{chunk-5DLGYPGJ.js → chunk-PDSTXORC.js} +126 -58
- package/dist/safe-bash/chunks/chunk-PDSTXORC.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-TIHMU25L.js → chunk-PQ37GDJF.js} +3 -3
- package/dist/safe-bash/chunks/{chunk-OTM5RCWZ.js → chunk-QNEDWYC2.js} +15 -8
- package/dist/safe-bash/chunks/chunk-QNEDWYC2.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-LZ7FUN6K.js → chunk-RHHDOA67.js} +5 -5
- package/dist/safe-bash/chunks/{chunk-DSCL3VA2.js → chunk-SJ3B26XV.js} +4 -4
- package/dist/safe-bash/chunks/{chunk-6JBTVWHH.js → chunk-SWACYEIT.js} +5 -5
- package/dist/safe-bash/chunks/{chunk-7UJW7TYR.js → chunk-TD6NWAUK.js} +126 -58
- package/dist/safe-bash/chunks/chunk-TD6NWAUK.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-Q4I754TV.js → chunk-THOBFD5C.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-XELW5O3R.js → chunk-U2STHT7S.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-5X4SOSTT.js → chunk-UJHE5PTK.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-B6YFFKYG.js → chunk-X4I3RHTC.js} +5 -1
- package/dist/safe-bash/chunks/chunk-X4I3RHTC.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-YOK5UHA7.js → chunk-XKXFX3RH.js} +5 -1
- package/dist/safe-bash/chunks/chunk-XKXFX3RH.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-PLCYP2E5.js → chunk-XV4K3UUF.js} +2 -2
- package/dist/safe-bash/commands/csplit/index.browser.js +2 -2
- package/dist/safe-bash/commands/factor/index.browser.js +2 -2
- package/dist/safe-bash/commands/getopt/index.browser.js +2 -2
- package/dist/safe-bash/commands/hexdump/index.browser.js +2 -2
- package/dist/safe-bash/commands/iconv/index.browser.js +2 -2
- package/dist/safe-bash/commands/internal.d.ts.map +1 -1
- package/dist/safe-bash/commands/internal.js +4 -3
- package/dist/safe-bash/commands/internal.js.map +1 -1
- package/dist/safe-bash/commands/line-endings/index.browser.js +2 -2
- package/dist/safe-bash/commands/llm/index.browser.js +4 -4
- package/dist/safe-bash/commands/network/index.browser.js +4 -4
- package/dist/safe-bash/commands/node/index.browser.js +4 -4
- package/dist/safe-bash/commands/pandoc/index.js.map +1 -1
- package/dist/safe-bash/commands/pr/index.browser.js +3 -3
- package/dist/safe-bash/commands/python/index.browser.js +2 -2
- package/dist/safe-bash/commands/record-buffer.d.ts.map +1 -1
- package/dist/safe-bash/commands/record-buffer.js +12 -4
- package/dist/safe-bash/commands/record-buffer.js.map +1 -1
- package/dist/safe-bash/commands/regex-execution/bounded-provider.d.ts.map +1 -1
- package/dist/safe-bash/commands/regex-execution/bounded-provider.js +75 -8
- package/dist/safe-bash/commands/regex-execution/bounded-provider.js.map +1 -1
- package/dist/safe-bash/commands/regex-execution/ere/limits.d.ts +1 -1
- package/dist/safe-bash/commands/regex-execution/ere/limits.d.ts.map +1 -1
- package/dist/safe-bash/commands/regex-execution/ere/limits.js +6 -4
- package/dist/safe-bash/commands/regex-execution/ere/limits.js.map +1 -1
- package/dist/safe-bash/commands/regex-execution/portable.d.ts.map +1 -1
- package/dist/safe-bash/commands/regex-execution/portable.js +7 -2
- package/dist/safe-bash/commands/regex-execution/portable.js.map +1 -1
- package/dist/safe-bash/commands/regex-execution/protocol.d.ts +2 -0
- package/dist/safe-bash/commands/regex-execution/protocol.d.ts.map +1 -1
- package/dist/safe-bash/commands/regex-execution/protocol.js +26 -0
- package/dist/safe-bash/commands/regex-execution/protocol.js.map +1 -1
- package/dist/safe-bash/commands/regex-execution/utf8.d.ts +1 -1
- package/dist/safe-bash/commands/regex-execution/utf8.d.ts.map +1 -1
- package/dist/safe-bash/commands/regex-execution/utf8.js +26 -2
- package/dist/safe-bash/commands/regex-execution/utf8.js.map +1 -1
- package/dist/safe-bash/commands/search/grep.d.ts.map +1 -1
- package/dist/safe-bash/commands/search/grep.js +109 -15
- package/dist/safe-bash/commands/search/grep.js.map +1 -1
- package/dist/safe-bash/commands/search/matcher.d.ts +1 -1
- package/dist/safe-bash/commands/search/matcher.d.ts.map +1 -1
- package/dist/safe-bash/commands/search/matcher.js +2 -0
- package/dist/safe-bash/commands/search/matcher.js.map +1 -1
- package/dist/safe-bash/commands/search/shared.d.ts.map +1 -1
- package/dist/safe-bash/commands/search/shared.js +23 -12
- package/dist/safe-bash/commands/search/shared.js.map +1 -1
- package/dist/safe-bash/commands/standard.d.ts.map +1 -1
- package/dist/safe-bash/commands/standard.js +22 -0
- package/dist/safe-bash/commands/standard.js.map +1 -1
- package/dist/safe-bash/commands/streams.d.ts.map +1 -1
- package/dist/safe-bash/commands/streams.js +54 -10
- package/dist/safe-bash/commands/streams.js.map +1 -1
- package/dist/safe-bash/commands/structured/input.d.ts.map +1 -1
- package/dist/safe-bash/commands/structured/input.js +484 -55
- package/dist/safe-bash/commands/structured/input.js.map +1 -1
- package/dist/safe-bash/commands/structured/interpreter.d.ts +3 -0
- package/dist/safe-bash/commands/structured/interpreter.d.ts.map +1 -1
- package/dist/safe-bash/commands/structured/interpreter.js +157 -1
- package/dist/safe-bash/commands/structured/interpreter.js.map +1 -1
- package/dist/safe-bash/commands/structured/jq.d.ts.map +1 -1
- package/dist/safe-bash/commands/structured/jq.js +50 -24
- package/dist/safe-bash/commands/structured/jq.js.map +1 -1
- package/dist/safe-bash/commands/structured/limits.d.ts +5 -0
- package/dist/safe-bash/commands/structured/limits.d.ts.map +1 -1
- package/dist/safe-bash/commands/structured/limits.js +51 -36
- package/dist/safe-bash/commands/structured/limits.js.map +1 -1
- package/dist/safe-bash/commands/structured/numbers.d.ts +1 -0
- package/dist/safe-bash/commands/structured/numbers.d.ts.map +1 -1
- package/dist/safe-bash/commands/structured/numbers.js +32 -0
- package/dist/safe-bash/commands/structured/numbers.js.map +1 -1
- package/dist/safe-bash/commands/text-programs/awk-reader.d.ts +1 -0
- package/dist/safe-bash/commands/text-programs/awk-reader.d.ts.map +1 -1
- package/dist/safe-bash/commands/text-programs/awk-reader.js +41 -5
- package/dist/safe-bash/commands/text-programs/awk-reader.js.map +1 -1
- package/dist/safe-bash/commands/text-programs/awk-retention.d.ts +1 -0
- package/dist/safe-bash/commands/text-programs/awk-retention.d.ts.map +1 -1
- package/dist/safe-bash/commands/text-programs/awk-retention.js +9 -0
- package/dist/safe-bash/commands/text-programs/awk-retention.js.map +1 -1
- package/dist/safe-bash/commands/text-programs/awk-runtime.d.ts +13 -0
- package/dist/safe-bash/commands/text-programs/awk-runtime.d.ts.map +1 -1
- package/dist/safe-bash/commands/text-programs/awk-runtime.js +421 -83
- package/dist/safe-bash/commands/text-programs/awk-runtime.js.map +1 -1
- package/dist/safe-bash/commands/text-programs/awk-values.d.ts.map +1 -1
- package/dist/safe-bash/commands/text-programs/awk-values.js +21 -0
- package/dist/safe-bash/commands/text-programs/awk-values.js.map +1 -1
- package/dist/safe-bash/commands/text-programs/regex.d.ts +15 -2
- package/dist/safe-bash/commands/text-programs/regex.d.ts.map +1 -1
- package/dist/safe-bash/commands/text-programs/regex.js +501 -13
- package/dist/safe-bash/commands/text-programs/regex.js.map +1 -1
- package/dist/safe-bash/commands/text-programs/sed.d.ts.map +1 -1
- package/dist/safe-bash/commands/text-programs/sed.js +242 -102
- package/dist/safe-bash/commands/text-programs/sed.js.map +1 -1
- package/dist/safe-bash/commands/text-programs/shared.d.ts +2 -0
- package/dist/safe-bash/commands/text-programs/shared.d.ts.map +1 -1
- package/dist/safe-bash/commands/text-programs/shared.js +36 -0
- package/dist/safe-bash/commands/text-programs/shared.js.map +1 -1
- package/dist/safe-bash/commands/text.d.ts.map +1 -1
- package/dist/safe-bash/commands/text.js +136 -19
- package/dist/safe-bash/commands/text.js.map +1 -1
- package/dist/safe-bash/commands/tsort/index.browser.js +2 -2
- package/dist/safe-bash/commands/xml/index.browser.js +5 -5
- package/dist/safe-bash/commands/yq/index.browser.js +5 -5
- package/dist/safe-bash/contracts/yield.d.ts +1 -0
- package/dist/safe-bash/contracts/yield.d.ts.map +1 -1
- package/dist/safe-bash/contracts/yield.js +3 -0
- package/dist/safe-bash/contracts/yield.js.map +1 -1
- package/dist/safe-bash/core.browser.js +1052 -256
- package/dist/safe-bash/core.browser.js.map +3 -3
- package/dist/safe-bash/plugins/composition.d.ts +1 -0
- package/dist/safe-bash/plugins/composition.d.ts.map +1 -1
- package/dist/safe-bash/plugins/composition.js +80 -2
- package/dist/safe-bash/plugins/composition.js.map +1 -1
- package/dist/safe-bash/plugins/index.d.ts.map +1 -1
- package/dist/safe-bash/plugins/index.js +2 -2
- package/dist/safe-bash/plugins/index.js.map +1 -1
- package/dist/safe-bash-command-fold/arguments.d.ts +1 -1
- package/dist/safe-bash-command-fold/contracts.d.ts +2 -1
- package/dist/safe-bash-command-fold/engine.d.ts +1 -1
- package/dist/safe-bash-command-fold/index.js +10 -8
- package/dist/safe-bash-command-fold/index.js.map +2 -2
- package/dist/safe-bash-command-sips/index.js +231 -67
- package/dist/safe-bash-command-sips/index.js.map +2 -2
- package/dist/safe-bash-command-unrtf/contracts.d.ts +5 -2
- package/dist/safe-bash-command-unrtf/index.js +6 -5
- package/dist/safe-bash-command-unrtf/index.js.map +2 -2
- package/dist/safe-playwright-cloudflare/browser-run-code.js +22 -6
- package/package.json +2 -2
- package/dist/safe-bash/chunks/chunk-5DLGYPGJ.js.map +0 -7
- package/dist/safe-bash/chunks/chunk-7UJW7TYR.js.map +0 -7
- package/dist/safe-bash/chunks/chunk-B6YFFKYG.js.map +0 -7
- package/dist/safe-bash/chunks/chunk-OTM5RCWZ.js.map +0 -7
- package/dist/safe-bash/chunks/chunk-RP5IZOOR.js.map +0 -7
- package/dist/safe-bash/chunks/chunk-VGJIDLZM.js.map +0 -7
- package/dist/safe-bash/chunks/chunk-VV24PRPB.js.map +0 -7
- package/dist/safe-bash/chunks/chunk-YOK5UHA7.js.map +0 -7
- /package/dist/safe-bash/chunks/{chunk-6VZX7ESE.js.map → chunk-26N7BLXE.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-ZZ7JQBPX.js.map → chunk-4A2OLEML.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-LTREB3HX.js.map → chunk-54MC6XF5.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-Z3CCN6Y2.js.map → chunk-6J5FUESH.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-YR5RZBWS.js.map → chunk-6TBFZ5JE.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-6HJNJ625.js.map → chunk-7MMYQG3P.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-WTZZX4LV.js.map → chunk-A4MB2KXV.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-EM2JW7ZH.js.map → chunk-ATYJKRBZ.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-EFMXWUYE.js.map → chunk-B6JEJ6AT.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-JFGGQUYP.js.map → chunk-BFXGHT3R.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-646RTREQ.js.map → chunk-EEDOYIPC.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-OFAAHWL5.js.map → chunk-GCQ5A2T2.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-MJW4KSKV.js.map → chunk-GLPJEDLY.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-FOOJWH7J.js.map → chunk-GO5OKPBO.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-5JANWFJ3.js.map → chunk-GWYXCCGO.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-DPHRNHPT.js.map → chunk-H6KJ4L22.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-FLX2BZBF.js.map → chunk-HGBYIDAK.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-PO3Z7W3A.js.map → chunk-MUHYGUFD.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-TIHMU25L.js.map → chunk-PQ37GDJF.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-LZ7FUN6K.js.map → chunk-RHHDOA67.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-DSCL3VA2.js.map → chunk-SJ3B26XV.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-6JBTVWHH.js.map → chunk-SWACYEIT.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-Q4I754TV.js.map → chunk-THOBFD5C.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-XELW5O3R.js.map → chunk-U2STHT7S.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-5X4SOSTT.js.map → chunk-UJHE5PTK.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-PLCYP2E5.js.map → chunk-XV4K3UUF.js.map} +0 -0
|
@@ -18,20 +18,20 @@ import {
|
|
|
18
18
|
stringify,
|
|
19
19
|
truth,
|
|
20
20
|
wellFormed
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-BJYV5J65.js";
|
|
22
22
|
import {
|
|
23
23
|
shellValueByteLength
|
|
24
24
|
} from "./chunk-RA4KWAKW.js";
|
|
25
25
|
import {
|
|
26
26
|
pathOf
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-KS5VSJYM.js";
|
|
28
28
|
import {
|
|
29
29
|
escapeText,
|
|
30
30
|
writeDiagnostic
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-A4MB2KXV.js";
|
|
32
32
|
import {
|
|
33
33
|
yieldTurn
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-X4I3RHTC.js";
|
|
35
35
|
import {
|
|
36
36
|
getCommandArguments
|
|
37
37
|
} from "./chunk-P7NFUYPJ.js";
|
|
@@ -954,6 +954,7 @@ async function executeJq(context, limits, convert) {
|
|
|
954
954
|
let diagnosticWriteFailed = false;
|
|
955
955
|
let stdoutWriteFailed = false;
|
|
956
956
|
const flush = async (force = false) => {
|
|
957
|
+
if (!diagnostics.length) return;
|
|
957
958
|
let written = 0;
|
|
958
959
|
try {
|
|
959
960
|
while (written < diagnostics.length && (force || diagnostics[written].location.complete)) {
|
|
@@ -976,10 +977,47 @@ async function executeJq(context, limits, convert) {
|
|
|
976
977
|
const interpreter = new Interpreter(budget, options.variables);
|
|
977
978
|
let last;
|
|
978
979
|
let status = 0;
|
|
980
|
+
const suffix = options.rawOutput0 ? "\0" : options.joinOutput ? "" : "\n";
|
|
981
|
+
const publishResult = async (result) => {
|
|
982
|
+
const pt = budget.tickSync();
|
|
983
|
+
if (pt) await pt;
|
|
984
|
+
budget.value(result);
|
|
985
|
+
if (++budget.results > limits.maxResults) throw new JqLimitError("maxResults");
|
|
986
|
+
const remaining = limits.maxOutputBytes - budget.outputBytes;
|
|
987
|
+
const prefix = options.sequence && !(options.raw && typeof result === "string") ? "" : "";
|
|
988
|
+
const output = options.sortKeys ? await sortObjectKeys(result, budget) : result;
|
|
989
|
+
const rawString = options.raw && typeof output === "string";
|
|
990
|
+
const format = rawString ? { ...options.format, color: false } : options.format;
|
|
991
|
+
const text = rawString && !format.ascii ? output : await stringify(output, budget, format, Math.max(0, remaining - suffix.length - prefix.length), "maxOutputBytes");
|
|
992
|
+
const chunkText = `${prefix}${text}${suffix}`;
|
|
993
|
+
const byteLen = import_buffer.Buffer.byteLength(chunkText);
|
|
994
|
+
if (byteLen > remaining) throw new JqLimitError("maxOutputBytes");
|
|
995
|
+
budget.outputBytes += byteLen;
|
|
996
|
+
try {
|
|
997
|
+
await writeBytes(context.stdout, import_buffer.Buffer.from(chunkText), context.signal);
|
|
998
|
+
} catch (error) {
|
|
999
|
+
stdoutWriteFailed = true;
|
|
1000
|
+
throw error;
|
|
1001
|
+
}
|
|
1002
|
+
};
|
|
979
1003
|
const emit = async (input2) => {
|
|
980
|
-
await flush();
|
|
1004
|
+
if (diagnostics.length) await flush();
|
|
981
1005
|
status = options.exitStatus ? last === void 0 ? 4 : truth(last) ? 0 : 1 : 0;
|
|
982
1006
|
let invocationLast;
|
|
1007
|
+
if (!options.rawOutput0) {
|
|
1008
|
+
const syncResults = interpreter.tryRunSync(ast, input2);
|
|
1009
|
+
if (syncResults !== void 0) {
|
|
1010
|
+
for (let i = 0; i < syncResults.length; i++) {
|
|
1011
|
+
const result = syncResults[i];
|
|
1012
|
+
await publishResult(result);
|
|
1013
|
+
invocationLast = result;
|
|
1014
|
+
status = options.exitStatus ? truth(result) ? 0 : 1 : 0;
|
|
1015
|
+
}
|
|
1016
|
+
if (status < 2 && invocationLast !== void 0) last = invocationLast;
|
|
1017
|
+
if (diagnostics.length) await flush();
|
|
1018
|
+
return;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
983
1021
|
const iterator = interpreter.run(ast, input2);
|
|
984
1022
|
try {
|
|
985
1023
|
while (true) {
|
|
@@ -1002,25 +1040,7 @@ async function executeJq(context, limits, convert) {
|
|
|
1002
1040
|
}
|
|
1003
1041
|
if (next.done) break;
|
|
1004
1042
|
const result = next.value;
|
|
1005
|
-
await
|
|
1006
|
-
budget.value(result);
|
|
1007
|
-
if (++budget.results > limits.maxResults) throw new JqLimitError("maxResults");
|
|
1008
|
-
const remaining = limits.maxOutputBytes - budget.outputBytes;
|
|
1009
|
-
const suffix = options.rawOutput0 ? "\0" : options.joinOutput ? "" : "\n";
|
|
1010
|
-
const prefix = options.sequence && !(options.raw && typeof result === "string") ? "" : "";
|
|
1011
|
-
const output = options.sortKeys ? await sortObjectKeys(result, budget) : result;
|
|
1012
|
-
const rawString = options.raw && typeof output === "string";
|
|
1013
|
-
const format = rawString ? { ...options.format, color: false } : options.format;
|
|
1014
|
-
const text = rawString && !format.ascii ? output : await stringify(output, budget, format, Math.max(0, remaining - suffix.length - prefix.length), "maxOutputBytes");
|
|
1015
|
-
if (prefix.length + import_buffer.Buffer.byteLength(text) + suffix.length > remaining) throw new JqLimitError("maxOutputBytes");
|
|
1016
|
-
const bytes = import_buffer.Buffer.from(`${prefix}${text}${suffix}`);
|
|
1017
|
-
budget.outputBytes += bytes.byteLength;
|
|
1018
|
-
try {
|
|
1019
|
-
await writeBytes(context.stdout, bytes, context.signal);
|
|
1020
|
-
} catch (error) {
|
|
1021
|
-
stdoutWriteFailed = true;
|
|
1022
|
-
throw error;
|
|
1023
|
-
}
|
|
1043
|
+
await publishResult(result);
|
|
1024
1044
|
invocationLast = result;
|
|
1025
1045
|
status = options.exitStatus ? truth(result) ? 0 : 1 : 0;
|
|
1026
1046
|
}
|
|
@@ -1028,7 +1048,7 @@ async function executeJq(context, limits, convert) {
|
|
|
1028
1048
|
await iterator.return(void 0);
|
|
1029
1049
|
}
|
|
1030
1050
|
if (status < 2 && invocationLast !== void 0) last = invocationLast;
|
|
1031
|
-
await flush();
|
|
1051
|
+
if (diagnostics.length) await flush();
|
|
1032
1052
|
};
|
|
1033
1053
|
if (options.nullInput) {
|
|
1034
1054
|
await emit(null);
|
|
@@ -1336,4 +1356,4 @@ export {
|
|
|
1336
1356
|
createXmlCommands,
|
|
1337
1357
|
xmlCommands
|
|
1338
1358
|
};
|
|
1339
|
-
//# sourceMappingURL=chunk-
|
|
1359
|
+
//# sourceMappingURL=chunk-DIEFWGXO.js.map
|