@poe-platform/safe-bash 0.1.629 → 0.1.631
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/README.md +2 -2
- package/dist/office-package/compression.d.ts +19 -0
- package/dist/office-package/compression.js +186 -0
- package/dist/office-package/runtime.d.ts +11 -0
- package/dist/office-package/runtime.js +28 -0
- package/dist/safe-bash/chunks/{bz2-B2RXT4EX.js → bz2-ACU4EOVE.js} +2 -2
- package/dist/safe-bash/chunks/chunk-2E4KBFO6.js +239 -0
- package/dist/safe-bash/chunks/chunk-2E4KBFO6.js.map +7 -0
- package/dist/safe-bash/chunks/chunk-3E5M2WEL.js +33 -0
- package/dist/safe-bash/chunks/chunk-3E5M2WEL.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-WPEMUXV4.js → chunk-3LD67SER.js} +12 -10
- package/dist/safe-bash/chunks/{chunk-WPEMUXV4.js.map → chunk-3LD67SER.js.map} +1 -1
- package/dist/safe-bash/chunks/{chunk-6LSSEOG7.js → chunk-6HNK7Q66.js} +11 -7
- package/dist/safe-bash/chunks/{chunk-6LSSEOG7.js.map → chunk-6HNK7Q66.js.map} +1 -1
- package/dist/safe-bash/chunks/{chunk-AD7UAP5B.js → chunk-7EEWZY5S.js} +10 -8
- package/dist/safe-bash/chunks/{chunk-AD7UAP5B.js.map → chunk-7EEWZY5S.js.map} +1 -1
- package/dist/safe-bash/chunks/{chunk-RNKTWFEM.js → chunk-CDBQXRWL.js} +3 -3
- package/dist/safe-bash/chunks/{chunk-UYX72YHY.js → chunk-CHHAB5SS.js} +10 -74
- package/dist/safe-bash/chunks/{chunk-UYX72YHY.js.map → chunk-CHHAB5SS.js.map} +3 -3
- package/dist/safe-bash/chunks/{chunk-KYNRHYHP.js → chunk-EI4X5ETX.js} +15 -13
- package/dist/safe-bash/chunks/{chunk-KYNRHYHP.js.map → chunk-EI4X5ETX.js.map} +1 -1
- package/dist/safe-bash/chunks/{chunk-KZ7QCYNT.js → chunk-GIBLUW2U.js} +13 -9
- package/dist/safe-bash/chunks/{chunk-KZ7QCYNT.js.map → chunk-GIBLUW2U.js.map} +1 -1
- package/dist/safe-bash/chunks/chunk-GPV7ZFYS.js +1528 -0
- package/dist/safe-bash/chunks/chunk-GPV7ZFYS.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-N5CYTGBN.js → chunk-H3E67KTZ.js} +13 -9
- package/dist/safe-bash/chunks/{chunk-N5CYTGBN.js.map → chunk-H3E67KTZ.js.map} +1 -1
- package/dist/safe-bash/chunks/{chunk-AFH57PPL.js → chunk-IEKESMO4.js} +3 -3
- package/dist/safe-bash/chunks/{chunk-DPJWEGIX.js → chunk-JLBIUYT3.js} +2 -2
- package/dist/safe-bash/chunks/chunk-JZDO5MC3.js +77 -0
- package/dist/safe-bash/chunks/chunk-JZDO5MC3.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-GFZKQIPL.js → chunk-LA6BX562.js} +8 -6
- package/dist/safe-bash/chunks/{chunk-GFZKQIPL.js.map → chunk-LA6BX562.js.map} +1 -1
- package/dist/safe-bash/chunks/{chunk-PVJJFCGA.js → chunk-M3GPCYSP.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-FWDMJTQO.js → chunk-NDCZ3UBP.js} +13 -9
- package/dist/safe-bash/chunks/{chunk-FWDMJTQO.js.map → chunk-NDCZ3UBP.js.map} +1 -1
- package/dist/safe-bash/chunks/{chunk-2KL6W6NB.js → chunk-O2EVBRKF.js} +1 -2
- package/dist/safe-bash/chunks/chunk-OFT77XIB.js +389 -0
- package/dist/safe-bash/chunks/chunk-OFT77XIB.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-PCLOK32J.js → chunk-PC6BEIAF.js} +13 -9
- package/dist/safe-bash/chunks/{chunk-PCLOK32J.js.map → chunk-PC6BEIAF.js.map} +1 -1
- package/dist/safe-bash/chunks/{chunk-3M5F7LD5.js → chunk-QWKP7ZU7.js} +13 -9
- package/dist/safe-bash/chunks/{chunk-3M5F7LD5.js.map → chunk-QWKP7ZU7.js.map} +1 -1
- package/dist/safe-bash/chunks/chunk-THXJ6CLF.js +53 -0
- package/dist/safe-bash/chunks/chunk-THXJ6CLF.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-HHJSJWUD.js → chunk-V73A742N.js} +57 -15
- package/dist/safe-bash/chunks/chunk-V73A742N.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-4BYUV5PA.js → chunk-VN3ZGME3.js} +12 -8
- package/dist/safe-bash/chunks/{chunk-4BYUV5PA.js.map → chunk-VN3ZGME3.js.map} +1 -1
- package/dist/safe-bash/chunks/chunk-WECHUK3Y.js +4285 -0
- package/dist/safe-bash/chunks/chunk-WECHUK3Y.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-X55AMTNM.js → chunk-WIOEUR7D.js} +14 -10
- package/dist/safe-bash/chunks/{chunk-X55AMTNM.js.map → chunk-WIOEUR7D.js.map} +1 -1
- package/dist/safe-bash/chunks/chunk-WPIOO4NX.js +443 -0
- package/dist/safe-bash/chunks/chunk-WPIOO4NX.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-C7QNJ3D4.js → chunk-WYTI64IU.js} +2 -2
- package/dist/safe-bash/chunks/{xz-AVXFDXW4.js → xz-U4QDTPZL.js} +2 -2
- package/dist/safe-bash/chunks/{zstd-R6RPHJYO.js → zstd-OG5RPYXO.js} +2 -2
- package/dist/safe-bash/commands/archive/zip/crc.d.ts +2 -0
- package/dist/safe-bash/commands/archive/zip/crc.d.ts.map +1 -0
- package/dist/safe-bash/commands/archive/zip/crc.js +7 -0
- package/dist/safe-bash/commands/archive/zip/crc.js.map +1 -0
- package/dist/safe-bash/commands/archive/zip/crypto.d.ts +4 -0
- package/dist/safe-bash/commands/archive/zip/crypto.d.ts.map +1 -0
- package/dist/safe-bash/commands/archive/zip/crypto.js +34 -0
- package/dist/safe-bash/commands/archive/zip/crypto.js.map +1 -0
- package/dist/safe-bash/commands/archive/zip/help.d.ts +3 -0
- package/dist/safe-bash/commands/archive/zip/help.d.ts.map +1 -0
- package/dist/safe-bash/commands/archive/zip/help.js +87 -0
- package/dist/safe-bash/commands/archive/zip/help.js.map +1 -0
- package/dist/safe-bash/commands/archive/zip/move.d.ts +12 -0
- package/dist/safe-bash/commands/archive/zip/move.d.ts.map +1 -0
- package/dist/safe-bash/commands/archive/zip/move.js +60 -0
- package/dist/safe-bash/commands/archive/zip/move.js.map +1 -0
- package/dist/safe-bash/commands/archive/zip/options.js +5 -5
- package/dist/safe-bash/commands/archive/zip/options.js.map +1 -1
- package/dist/safe-bash/commands/archive/zip-format.d.ts +1 -1
- package/dist/safe-bash/commands/archive/zip-format.d.ts.map +1 -1
- package/dist/safe-bash/commands/archive/zip-format.js +14 -17
- package/dist/safe-bash/commands/archive/zip-format.js.map +1 -1
- package/dist/safe-bash/commands/archive/zip.d.ts.map +1 -1
- package/dist/safe-bash/commands/archive/zip.js +45 -15
- package/dist/safe-bash/commands/archive/zip.js.map +1 -1
- package/dist/safe-bash/commands/bytes/compression/bounded-codec.d.ts +2 -0
- package/dist/safe-bash/commands/bytes/compression/bounded-codec.d.ts.map +1 -1
- package/dist/safe-bash/commands/bytes/compression/bounded-codec.js +4 -0
- package/dist/safe-bash/commands/bytes/compression/bounded-codec.js.map +1 -1
- package/dist/safe-bash/commands/bytes/compression/codec.d.ts +4 -24
- package/dist/safe-bash/commands/bytes/compression/codec.d.ts.map +1 -1
- package/dist/safe-bash/commands/bytes/compression/codec.js +12 -168
- package/dist/safe-bash/commands/bytes/compression/codec.js.map +1 -1
- package/dist/safe-bash/commands/cmp.js +1 -1
- package/dist/safe-bash/commands/cmp.js.map +1 -1
- package/dist/safe-bash/commands/csplit/index.browser.js +10 -7
- package/dist/safe-bash/commands/docx/index.browser.js +54 -0
- package/dist/safe-bash/commands/docx/index.browser.js.map +7 -0
- package/dist/safe-bash/commands/docx/index.d.ts +25 -0
- package/dist/safe-bash/commands/docx/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/docx/index.js +42 -0
- package/dist/safe-bash/commands/docx/index.js.map +1 -0
- package/dist/safe-bash/commands/docx/io.d.ts +15 -0
- package/dist/safe-bash/commands/docx/io.d.ts.map +1 -0
- package/dist/safe-bash/commands/docx/io.js +16 -0
- package/dist/safe-bash/commands/docx/io.js.map +1 -0
- package/dist/safe-bash/commands/factor/index.browser.js +7 -5
- package/dist/safe-bash/commands/filesystem.d.ts.map +1 -1
- package/dist/safe-bash/commands/filesystem.js +9 -1
- package/dist/safe-bash/commands/filesystem.js.map +1 -1
- package/dist/safe-bash/commands/getopt/index.browser.js +7 -5
- package/dist/safe-bash/commands/hexdump/index.browser.js +8 -6
- package/dist/safe-bash/commands/iconv/index.browser.js +8 -6
- package/dist/safe-bash/commands/line-endings/index.browser.js +10 -7
- package/dist/safe-bash/commands/llm/index.browser.js +10 -8
- package/dist/safe-bash/commands/llm/providers/index.browser.js +3 -3
- package/dist/safe-bash/commands/network/index.browser.js +11 -8
- package/dist/safe-bash/commands/node/browser.d.ts +2 -0
- package/dist/safe-bash/commands/node/browser.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/browser.js +2 -0
- package/dist/safe-bash/commands/node/browser.js.map +1 -0
- package/dist/safe-bash/commands/node/index.browser.js +18 -0
- package/dist/safe-bash/commands/node/index.browser.js.map +7 -0
- package/dist/safe-bash/commands/node/safejs.d.ts +6 -0
- package/dist/safe-bash/commands/node/safejs.d.ts.map +1 -1
- package/dist/safe-bash/commands/node/safejs.js +25 -1
- package/dist/safe-bash/commands/node/safejs.js.map +1 -1
- package/dist/safe-bash/commands/op/index.browser.js +3 -3
- package/dist/safe-bash/commands/op/index.js +0 -1
- package/dist/safe-bash/commands/op/index.js.map +2 -2
- package/dist/safe-bash/commands/pptx/index.d.ts +29 -0
- package/dist/safe-bash/commands/pptx/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/pptx/index.js +153 -0
- package/dist/safe-bash/commands/pptx/index.js.map +1 -0
- package/dist/safe-bash/commands/pr/index.browser.js +8 -6
- package/dist/safe-bash/commands/predicates.js +1 -1
- package/dist/safe-bash/commands/python/execution.d.ts +3 -0
- package/dist/safe-bash/commands/python/execution.d.ts.map +1 -0
- package/dist/safe-bash/commands/python/execution.js +193 -0
- package/dist/safe-bash/commands/python/execution.js.map +1 -0
- package/dist/safe-bash/commands/python/index.browser.js +21 -0
- package/dist/safe-bash/commands/python/index.browser.js.map +7 -0
- package/dist/safe-bash/commands/python/index.d.ts +49 -0
- package/dist/safe-bash/commands/python/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/python/index.js +317 -0
- package/dist/safe-bash/commands/python/index.js.map +1 -0
- package/dist/safe-bash/commands/python/installation.d.ts +9 -0
- package/dist/safe-bash/commands/python/installation.d.ts.map +1 -0
- package/dist/safe-bash/commands/python/installation.js +80 -0
- package/dist/safe-bash/commands/python/installation.js.map +1 -0
- package/dist/safe-bash/commands/python/invocation.d.ts +10 -0
- package/dist/safe-bash/commands/python/invocation.d.ts.map +1 -0
- package/dist/safe-bash/commands/python/invocation.js +81 -0
- package/dist/safe-bash/commands/python/invocation.js.map +1 -0
- package/dist/safe-bash/commands/python/node.d.ts +12 -0
- package/dist/safe-bash/commands/python/node.d.ts.map +1 -0
- package/dist/safe-bash/commands/python/node.js +33 -0
- package/dist/safe-bash/commands/python/node.js.map +1 -0
- package/dist/safe-bash/commands/python/provisioning-runtime.d.ts +5 -0
- package/dist/safe-bash/commands/python/provisioning-runtime.d.ts.map +1 -0
- package/dist/safe-bash/commands/python/provisioning-runtime.js +179 -0
- package/dist/safe-bash/commands/python/provisioning-runtime.js.map +1 -0
- package/dist/safe-bash/commands/python/provisioning.d.ts +49 -0
- package/dist/safe-bash/commands/python/provisioning.d.ts.map +1 -0
- package/dist/safe-bash/commands/python/provisioning.js +320 -0
- package/dist/safe-bash/commands/python/provisioning.js.map +1 -0
- package/dist/safe-bash/commands/python/reply.d.ts +3 -0
- package/dist/safe-bash/commands/python/reply.d.ts.map +1 -0
- package/dist/safe-bash/commands/python/reply.js +103 -0
- package/dist/safe-bash/commands/python/reply.js.map +1 -0
- package/dist/safe-bash/commands/python/worker.browser.js +736 -0
- package/dist/safe-bash/commands/python/worker.browser.js.map +7 -0
- package/dist/safe-bash/commands/python/worker.d.ts +47 -0
- package/dist/safe-bash/commands/python/worker.d.ts.map +1 -0
- package/dist/safe-bash/commands/python/worker.js +373 -0
- package/dist/safe-bash/commands/python/worker.js.map +1 -0
- package/dist/safe-bash/commands/safejs/index.d.ts +5 -17
- package/dist/safe-bash/commands/safejs/index.d.ts.map +1 -1
- package/dist/safe-bash/commands/safejs/index.js +3 -202
- package/dist/safe-bash/commands/safejs/index.js.map +1 -1
- package/dist/safe-bash/commands/safejs/runtime.d.ts +15 -0
- package/dist/safe-bash/commands/safejs/runtime.d.ts.map +1 -0
- package/dist/safe-bash/commands/safejs/runtime.js +190 -0
- package/dist/safe-bash/commands/safejs/runtime.js.map +1 -0
- package/dist/safe-bash/commands/tsort/index.browser.js +8 -6
- package/dist/safe-bash/commands/xml/index.browser.js +9 -7
- package/dist/safe-bash/commands/yq/index.browser.js +10 -8
- package/dist/safe-bash/commands/yq/index.d.ts.map +1 -1
- package/dist/safe-bash/commands/yq/index.js +32 -4
- package/dist/safe-bash/commands/yq/index.js.map +1 -1
- package/dist/safe-bash/commands/yq/parser.d.ts.map +1 -1
- package/dist/safe-bash/commands/yq/parser.js +21 -5
- package/dist/safe-bash/commands/yq/parser.js.map +1 -1
- package/dist/safe-bash/contracts/command.d.ts +2 -0
- package/dist/safe-bash/contracts/command.d.ts.map +1 -1
- package/dist/safe-bash/contracts/command.js +6 -2
- package/dist/safe-bash/contracts/command.js.map +1 -1
- package/dist/safe-bash/contracts/filesystem-descriptor.d.ts +13 -0
- package/dist/safe-bash/contracts/filesystem-descriptor.d.ts.map +1 -0
- package/dist/safe-bash/contracts/filesystem-descriptor.js +189 -0
- package/dist/safe-bash/contracts/filesystem-descriptor.js.map +1 -0
- package/dist/safe-bash/contracts/filesystem-output-budget.d.ts +15 -0
- package/dist/safe-bash/contracts/filesystem-output-budget.d.ts.map +1 -0
- package/dist/safe-bash/contracts/filesystem-output-budget.js +69 -0
- package/dist/safe-bash/contracts/filesystem-output-budget.js.map +1 -0
- package/dist/safe-bash/contracts/filesystem-output.d.ts +11 -5
- package/dist/safe-bash/contracts/filesystem-output.d.ts.map +1 -1
- package/dist/safe-bash/contracts/filesystem-output.js +229 -20
- package/dist/safe-bash/contracts/filesystem-output.js.map +1 -1
- package/dist/safe-bash/contracts/io.d.ts +29 -0
- package/dist/safe-bash/contracts/io.d.ts.map +1 -1
- package/dist/safe-bash/contracts/io.js +317 -37
- package/dist/safe-bash/contracts/io.js.map +1 -1
- package/dist/safe-bash/core.browser.js +5963 -6522
- package/dist/safe-bash/core.browser.js.map +4 -4
- package/dist/safe-bash/core.d.ts +2 -0
- package/dist/safe-bash/core.d.ts.map +1 -1
- package/dist/safe-bash/core.js +2 -0
- package/dist/safe-bash/core.js.map +1 -1
- package/dist/safe-bash/index.d.ts +1 -0
- package/dist/safe-bash/index.d.ts.map +1 -1
- package/dist/safe-bash/index.js +1 -0
- package/dist/safe-bash/index.js.map +1 -1
- package/dist/safe-bash/opt-in/commands/cmp/compare.js +95 -0
- package/dist/safe-bash/opt-in/commands/cmp/index.d.ts +6 -0
- package/dist/safe-bash/opt-in/commands/cmp/index.js +99 -0
- package/dist/safe-bash/opt-in/commands/cmp/io.js +218 -0
- package/dist/safe-bash/opt-in/commands/cmp/options.d.ts +24 -0
- package/dist/safe-bash/opt-in/commands/cmp/options.js +195 -0
- package/dist/safe-bash/opt-in/commands/dd/conversions.js +152 -0
- package/dist/safe-bash/opt-in/commands/dd/index.d.ts +18 -0
- package/dist/safe-bash/opt-in/commands/dd/index.js +561 -0
- package/dist/safe-bash/opt-in/commands/dd/io.d.ts +31 -0
- package/dist/safe-bash/opt-in/commands/dd/io.js +244 -0
- package/dist/safe-bash/opt-in/commands/dd/options.js +184 -0
- package/dist/safe-bash/opt-in/commands/dd/report.js +69 -0
- package/dist/safe-bash/opt-in/commands/install/arguments.js +224 -0
- package/dist/safe-bash/opt-in/commands/install/index.d.ts +6 -0
- package/dist/safe-bash/opt-in/commands/install/index.js +678 -0
- package/dist/safe-bash/opt-in/commands/install/mode.js +71 -0
- package/dist/safe-bash/opt-in/commands/install/options.d.ts +36 -0
- package/dist/safe-bash/opt-in/commands/install/options.js +27 -0
- package/dist/safe-bash/opt-in/commands/shuf/args.js +179 -0
- package/dist/safe-bash/opt-in/commands/shuf/index.d.ts +6 -0
- package/dist/safe-bash/opt-in/commands/shuf/index.js +20 -0
- package/dist/safe-bash/opt-in/commands/shuf/input.js +93 -0
- package/dist/safe-bash/opt-in/commands/shuf/options.d.ts +9 -0
- package/dist/safe-bash/opt-in/commands/shuf/options.js +8 -0
- package/dist/safe-bash/opt-in/commands/shuf/random.js +114 -0
- package/dist/safe-bash/opt-in/commands/shuf/shuf.d.ts +3 -0
- package/dist/safe-bash/opt-in/commands/shuf/shuf.js +230 -0
- package/dist/safe-bash/opt-in/commands/shuf/usage.js +24 -0
- package/dist/safe-bash/opt-in/commands/truncate/arguments.js +186 -0
- package/dist/safe-bash/opt-in/commands/truncate/index.d.ts +9 -0
- package/dist/safe-bash/opt-in/commands/truncate/index.js +244 -0
- package/dist/safe-bash/opt-in/commands/yes/index.d.ts +11 -0
- package/dist/safe-bash/opt-in/commands/yes/index.js +167 -0
- package/dist/safe-bash/opt-in/commands/yq/arguments.js +177 -0
- package/dist/safe-bash/opt-in/commands/yq/evaluate.js +564 -0
- package/dist/safe-bash/opt-in/commands/yq/expression.js +183 -0
- package/dist/safe-bash/opt-in/commands/yq/inplace.js +65 -0
- package/dist/safe-bash/opt-in/commands/yq/mike.d.ts +9 -0
- package/dist/safe-bash/opt-in/commands/yq/mike.js +192 -0
- package/dist/safe-bash/opt-in/commands/yq/native-encoder.js +165 -0
- package/dist/safe-bash/opt-in/commands/yq/native-work.d.ts +44 -0
- package/dist/safe-bash/opt-in/commands/yq/native-work.js +188 -0
- package/dist/safe-bash/opt-in/commands/yq/nodes.js +621 -0
- package/dist/safe-bash/opt-in/entrypoints/arrays.d.ts +1 -0
- package/dist/safe-bash/opt-in/entrypoints/arrays.js +1 -0
- package/dist/safe-bash/opt-in/entrypoints/cmp.d.ts +2 -0
- package/dist/safe-bash/opt-in/entrypoints/cmp.js +1 -0
- package/dist/safe-bash/opt-in/entrypoints/dd.d.ts +2 -0
- package/dist/safe-bash/opt-in/entrypoints/dd.js +1 -0
- package/dist/safe-bash/opt-in/entrypoints/devices.d.ts +2 -0
- package/dist/safe-bash/opt-in/entrypoints/devices.js +1 -0
- package/dist/safe-bash/opt-in/entrypoints/install.d.ts +2 -0
- package/dist/safe-bash/opt-in/entrypoints/install.js +1 -0
- package/dist/safe-bash/opt-in/entrypoints/jobs.d.ts +1 -0
- package/dist/safe-bash/opt-in/entrypoints/jobs.js +1 -0
- package/dist/safe-bash/opt-in/entrypoints/mapfile.d.ts +1 -0
- package/dist/safe-bash/opt-in/entrypoints/mapfile.js +1 -0
- package/dist/safe-bash/opt-in/entrypoints/read.d.ts +2 -0
- package/dist/safe-bash/opt-in/entrypoints/read.js +1 -0
- package/dist/safe-bash/opt-in/entrypoints/shuf.d.ts +2 -0
- package/dist/safe-bash/opt-in/entrypoints/shuf.js +1 -0
- package/dist/safe-bash/opt-in/entrypoints/trap.d.ts +2 -0
- package/dist/safe-bash/opt-in/entrypoints/trap.js +1 -0
- package/dist/safe-bash/opt-in/entrypoints/truncate.d.ts +2 -0
- package/dist/safe-bash/opt-in/entrypoints/truncate.js +1 -0
- package/dist/safe-bash/opt-in/entrypoints/yes.d.ts +2 -0
- package/dist/safe-bash/opt-in/entrypoints/yes.js +1 -0
- package/dist/safe-bash/opt-in/entrypoints/yq.d.ts +3 -0
- package/dist/safe-bash/opt-in/entrypoints/yq.js +1 -0
- package/dist/safe-bash/opt-in/fs/devices/index.d.ts +8 -0
- package/dist/safe-bash/opt-in/fs/devices/index.js +292 -0
- package/dist/safe-bash/opt-in/optional.d.ts +28 -0
- package/dist/safe-bash/opt-in/optional.js +14 -0
- package/dist/safe-bash/opt-in/shell/extensions/arrays/index.d.ts +2 -0
- package/dist/safe-bash/opt-in/shell/extensions/arrays/index.js +4 -0
- package/dist/safe-bash/opt-in/shell/extensions/jobs/index.d.ts +2 -0
- package/dist/safe-bash/opt-in/shell/extensions/jobs/index.js +291 -0
- package/dist/safe-bash/opt-in/shell/extensions/jobs/state.js +374 -0
- package/dist/safe-bash/opt-in/shell/extensions/mapfile/index.d.ts +24 -0
- package/dist/safe-bash/opt-in/shell/extensions/mapfile/index.js +338 -0
- package/dist/safe-bash/opt-in/shell/extensions/read/index.d.ts +5 -0
- package/dist/safe-bash/opt-in/shell/extensions/read/index.js +351 -0
- package/dist/safe-bash/opt-in/shell/extensions/trap/index.d.ts +9 -0
- package/dist/safe-bash/opt-in/shell/extensions/trap/index.js +210 -0
- package/dist/safe-bash/optional-host.d.ts +5 -0
- package/dist/safe-bash/optional-host.d.ts.map +1 -0
- package/dist/safe-bash/optional-host.js +3 -0
- package/dist/safe-bash/optional-host.js.map +1 -0
- package/dist/safe-bash/shell/arrays/bindings.d.ts +15 -5
- package/dist/safe-bash/shell/arrays/bindings.d.ts.map +1 -1
- package/dist/safe-bash/shell/arrays/bindings.js +131 -23
- package/dist/safe-bash/shell/arrays/bindings.js.map +1 -1
- package/dist/safe-bash/shell/arrays/ledger.d.ts +1 -0
- package/dist/safe-bash/shell/arrays/ledger.d.ts.map +1 -1
- package/dist/safe-bash/shell/arrays/ledger.js +19 -0
- package/dist/safe-bash/shell/arrays/ledger.js.map +1 -1
- package/dist/safe-bash/shell/arrays/state.d.ts.map +1 -1
- package/dist/safe-bash/shell/arrays/state.js +3 -1
- package/dist/safe-bash/shell/arrays/state.js.map +1 -1
- package/dist/safe-bash/shell/arrays/syntax.d.ts +4 -1
- package/dist/safe-bash/shell/arrays/syntax.d.ts.map +1 -1
- package/dist/safe-bash/shell/arrays/syntax.js +3 -3
- package/dist/safe-bash/shell/arrays/syntax.js.map +1 -1
- package/dist/safe-bash/shell/conditional.js +1 -1
- package/dist/safe-bash/shell/descriptors.d.ts +31 -0
- package/dist/safe-bash/shell/descriptors.d.ts.map +1 -0
- package/dist/safe-bash/shell/descriptors.js +234 -0
- package/dist/safe-bash/shell/descriptors.js.map +1 -0
- package/dist/safe-bash/shell/diagnostic-name-ranges.d.ts +2 -0
- package/dist/safe-bash/shell/diagnostic-name-ranges.d.ts.map +1 -0
- package/dist/safe-bash/shell/diagnostic-name-ranges.js +717 -0
- package/dist/safe-bash/shell/diagnostic-name-ranges.js.map +1 -0
- package/dist/safe-bash/shell/diagnostic-name.d.ts +3 -0
- package/dist/safe-bash/shell/diagnostic-name.d.ts.map +1 -0
- package/dist/safe-bash/shell/diagnostic-name.js +89 -0
- package/dist/safe-bash/shell/diagnostic-name.js.map +1 -0
- package/dist/safe-bash/shell/display.js +1 -1
- package/dist/safe-bash/shell/display.js.map +1 -1
- package/dist/safe-bash/shell/extensions.d.ts +188 -0
- package/dist/safe-bash/shell/extensions.d.ts.map +1 -0
- package/dist/safe-bash/shell/extensions.js +141 -0
- package/dist/safe-bash/shell/extensions.js.map +1 -0
- package/dist/safe-bash/shell/input.d.ts +66 -14
- package/dist/safe-bash/shell/input.d.ts.map +1 -1
- package/dist/safe-bash/shell/input.js +947 -173
- package/dist/safe-bash/shell/input.js.map +1 -1
- package/dist/safe-bash/shell/parser.d.ts +38 -6
- package/dist/safe-bash/shell/parser.d.ts.map +1 -1
- package/dist/safe-bash/shell/parser.js +339 -52
- package/dist/safe-bash/shell/parser.js.map +1 -1
- package/dist/safe-bash/shell/runtime.d.ts +92 -20
- package/dist/safe-bash/shell/runtime.d.ts.map +1 -1
- package/dist/safe-bash/shell/runtime.js +2547 -689
- package/dist/safe-bash/shell/runtime.js.map +1 -1
- package/dist/safe-bash/shell/shell.d.ts.map +1 -1
- package/dist/safe-bash/shell/shell.js +52 -21
- package/dist/safe-bash/shell/shell.js.map +1 -1
- package/dist/safe-bash/shell/types.d.ts +4 -0
- package/dist/safe-bash/shell/types.d.ts.map +1 -1
- package/dist/safe-bash/shell/types.js.map +1 -1
- package/package.json +99 -5
- package/dist/safe-bash/chunks/chunk-4DBWBEU7.js +0 -194
- package/dist/safe-bash/chunks/chunk-4DBWBEU7.js.map +0 -7
- package/dist/safe-bash/chunks/chunk-CXMIIXJA.js +0 -178
- package/dist/safe-bash/chunks/chunk-CXMIIXJA.js.map +0 -7
- package/dist/safe-bash/chunks/chunk-HHJSJWUD.js.map +0 -7
- /package/dist/safe-bash/chunks/{bz2-B2RXT4EX.js.map → bz2-ACU4EOVE.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-RNKTWFEM.js.map → chunk-CDBQXRWL.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-AFH57PPL.js.map → chunk-IEKESMO4.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-DPJWEGIX.js.map → chunk-JLBIUYT3.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-PVJJFCGA.js.map → chunk-M3GPCYSP.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-2KL6W6NB.js.map → chunk-O2EVBRKF.js.map} +0 -0
- /package/dist/safe-bash/chunks/{chunk-C7QNJ3D4.js.map → chunk-WYTI64IU.js.map} +0 -0
- /package/dist/safe-bash/chunks/{xz-AVXFDXW4.js.map → xz-U4QDTPZL.js.map} +0 -0
- /package/dist/safe-bash/chunks/{zstd-R6RPHJYO.js.map → zstd-OG5RPYXO.js.map} +0 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { commandRuntimeIdentity } from "@poe-platform/safe-bash/contracts/command";
|
|
2
|
+
import { FsError } from "@poe-platform/safe-bash/contracts/errors";
|
|
3
|
+
import { concatShellValues, shellValueByteLength, shellValueBytes, shellValueFromBytes, shellValueText } from "@poe-platform/safe-bash/contracts/value";
|
|
4
|
+
import { yieldTurn } from "@poe-platform/safe-bash/contracts/yield";
|
|
5
|
+
export class MapfileArgumentError extends Error {
|
|
6
|
+
detail;
|
|
7
|
+
status;
|
|
8
|
+
usage;
|
|
9
|
+
constructor(detail, status, usage = false) {
|
|
10
|
+
super(shellValueText(detail));
|
|
11
|
+
this.detail = detail;
|
|
12
|
+
this.status = status;
|
|
13
|
+
this.usage = usage;
|
|
14
|
+
this.name = "MapfileArgumentError";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function decimal(text, maximum) {
|
|
18
|
+
let start = 0;
|
|
19
|
+
let end = text.length;
|
|
20
|
+
while (start < end && " \t\n\r\v\f".includes(text[start]))
|
|
21
|
+
start++;
|
|
22
|
+
while (end > start && " \t\n\r\v\f".includes(text[end - 1]))
|
|
23
|
+
end--;
|
|
24
|
+
const beginning = start;
|
|
25
|
+
if (text[start] === "+" || text[start] === "-")
|
|
26
|
+
start++;
|
|
27
|
+
if (start >= end)
|
|
28
|
+
return undefined;
|
|
29
|
+
for (let index = start; index < end; index++)
|
|
30
|
+
if (text[index] < "0" || text[index] > "9")
|
|
31
|
+
return undefined;
|
|
32
|
+
const value = Number(text.slice(beginning, end));
|
|
33
|
+
return Number.isInteger(value) && value >= 0 && value <= maximum ? value || 0 : undefined;
|
|
34
|
+
}
|
|
35
|
+
export async function parseMapfileArguments(args, selectDescriptor) {
|
|
36
|
+
const options = { array: "MAPFILE", clear: true, count: 0, delimiter: 10, descriptor: 0, origin: 0, quantum: 5000, skip: 0, trim: false };
|
|
37
|
+
let offset = 0;
|
|
38
|
+
while (offset < args.length) {
|
|
39
|
+
const argument = args[offset];
|
|
40
|
+
const bytes = shellValueBytes(argument);
|
|
41
|
+
const text = shellValueText(argument);
|
|
42
|
+
if (text === "--help")
|
|
43
|
+
return "help";
|
|
44
|
+
if (text === "--") {
|
|
45
|
+
offset++;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
if (bytes[0] !== 45 || bytes.length === 1)
|
|
49
|
+
break;
|
|
50
|
+
offset++;
|
|
51
|
+
for (let index = 1; index < bytes.length; index++) {
|
|
52
|
+
const flag = String.fromCharCode(bytes[index]);
|
|
53
|
+
if (flag === "t") {
|
|
54
|
+
options.trim = true;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (!"dnOsuCc".includes(flag))
|
|
58
|
+
throw new MapfileArgumentError(concatShellValues(["-", bytes[index] < 128 ? flag : shellValueFromBytes(bytes.subarray(index, index + 1)), ": invalid option"]), 2, true);
|
|
59
|
+
let value;
|
|
60
|
+
if (index + 1 < bytes.length)
|
|
61
|
+
value = typeof argument === "string" ? argument.slice(index + 1) : shellValueFromBytes(bytes.subarray(index + 1));
|
|
62
|
+
else if (offset < args.length)
|
|
63
|
+
value = args[offset++];
|
|
64
|
+
else
|
|
65
|
+
throw new MapfileArgumentError(`-${flag}: option requires an argument`, 2, true);
|
|
66
|
+
if (flag === "d")
|
|
67
|
+
options.delimiter = shellValueBytes(value)[0] ?? 0;
|
|
68
|
+
else if (flag === "C")
|
|
69
|
+
options.callback = value;
|
|
70
|
+
else {
|
|
71
|
+
const number = decimal(shellValueText(value), flag === "u" ? 2147483647 : 4294967295);
|
|
72
|
+
if (number === undefined || flag === "c" && number === 0) {
|
|
73
|
+
const detail = flag === "u" ? "file descriptor specification" : flag === "O" ? "array origin" : flag === "c" ? "callback quantum" : "line count";
|
|
74
|
+
throw new MapfileArgumentError(concatShellValues([value, `: invalid ${detail}`]), 1);
|
|
75
|
+
}
|
|
76
|
+
if (flag === "u") {
|
|
77
|
+
options.descriptor = number;
|
|
78
|
+
await selectDescriptor(number);
|
|
79
|
+
}
|
|
80
|
+
else if (flag === "n")
|
|
81
|
+
options.count = number;
|
|
82
|
+
else if (flag === "O") {
|
|
83
|
+
options.origin = number;
|
|
84
|
+
options.clear = false;
|
|
85
|
+
}
|
|
86
|
+
else if (flag === "s")
|
|
87
|
+
options.skip = number;
|
|
88
|
+
else
|
|
89
|
+
options.quantum = number;
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const name = args[offset];
|
|
95
|
+
if (name !== undefined) {
|
|
96
|
+
const bytes = shellValueBytes(name);
|
|
97
|
+
if (!bytes.length)
|
|
98
|
+
throw new MapfileArgumentError("empty array variable name", 2);
|
|
99
|
+
for (let index = 0; index < bytes.length; index++) {
|
|
100
|
+
const byte = bytes[index];
|
|
101
|
+
if (byte !== 95 && !(byte >= 65 && byte <= 90) && !(byte >= 97 && byte <= 122) && !(index > 0 && byte >= 48 && byte <= 57))
|
|
102
|
+
throw new MapfileArgumentError(concatShellValues(["`", name, "': not a valid identifier"]), 1);
|
|
103
|
+
}
|
|
104
|
+
options.array = shellValueText(name);
|
|
105
|
+
}
|
|
106
|
+
return options;
|
|
107
|
+
}
|
|
108
|
+
const synopsis = "[-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]";
|
|
109
|
+
const help = [
|
|
110
|
+
" Read lines from the standard input into an indexed array variable.",
|
|
111
|
+
" ",
|
|
112
|
+
" Read lines from the standard input into the indexed array variable ARRAY, or",
|
|
113
|
+
" from file descriptor FD if the -u option is supplied. The variable MAPFILE",
|
|
114
|
+
" is the default ARRAY.",
|
|
115
|
+
" ",
|
|
116
|
+
" Options:",
|
|
117
|
+
" -d delim\tUse DELIM to terminate lines, instead of newline",
|
|
118
|
+
" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are copied",
|
|
119
|
+
" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default index is 0",
|
|
120
|
+
" -s count\tDiscard the first COUNT lines read",
|
|
121
|
+
" -t\tRemove a trailing DELIM from each line read (default newline)",
|
|
122
|
+
" -u fd\tRead lines from file descriptor FD instead of the standard input",
|
|
123
|
+
" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read",
|
|
124
|
+
" -c quantum\tSpecify the number of lines read between each call to",
|
|
125
|
+
" \t\t\tCALLBACK",
|
|
126
|
+
" ",
|
|
127
|
+
" Arguments:",
|
|
128
|
+
" ARRAY\tArray variable name to use for file data",
|
|
129
|
+
" ",
|
|
130
|
+
" If -C is supplied without -c, the default quantum is 5000. When",
|
|
131
|
+
" CALLBACK is evaluated, it is supplied the index of the next array",
|
|
132
|
+
" element to be assigned and the line to be assigned to that element",
|
|
133
|
+
" as additional arguments.",
|
|
134
|
+
" ",
|
|
135
|
+
" If not supplied with an explicit origin, mapfile will clear ARRAY before",
|
|
136
|
+
" assigning to it.",
|
|
137
|
+
" ",
|
|
138
|
+
" Exit Status:",
|
|
139
|
+
" Returns success unless an invalid option is given or ARRAY is readonly or",
|
|
140
|
+
" not an indexed array.",
|
|
141
|
+
"",
|
|
142
|
+
].join("\n");
|
|
143
|
+
async function callbackSource(callback, index, line, signal) {
|
|
144
|
+
let quotes = 0;
|
|
145
|
+
for (let offset = 0; offset < line.length; offset++) {
|
|
146
|
+
if (offset % 4096 === 0)
|
|
147
|
+
await yieldTurn(signal);
|
|
148
|
+
if (line[offset] === 39)
|
|
149
|
+
quotes++;
|
|
150
|
+
}
|
|
151
|
+
const quoted = new Uint8Array(line.length + quotes * 3 + 2);
|
|
152
|
+
let offset = 0;
|
|
153
|
+
quoted[offset++] = 39;
|
|
154
|
+
for (let position = 0; position < line.length; position++) {
|
|
155
|
+
if (position % 4096 === 0)
|
|
156
|
+
await yieldTurn(signal);
|
|
157
|
+
const byte = line[position];
|
|
158
|
+
if (byte === 39) {
|
|
159
|
+
quoted[offset++] = 39;
|
|
160
|
+
quoted[offset++] = 92;
|
|
161
|
+
quoted[offset++] = 39;
|
|
162
|
+
}
|
|
163
|
+
quoted[offset++] = byte;
|
|
164
|
+
}
|
|
165
|
+
quoted[offset] = 39;
|
|
166
|
+
const separator = ` ${index | 0} `;
|
|
167
|
+
const callbackLength = shellValueByteLength(callback);
|
|
168
|
+
const capacity = callbackLength + quoted.length + 10 + 3;
|
|
169
|
+
const remaining = capacity - 1 - callbackLength - separator.length;
|
|
170
|
+
return concatShellValues([callback, separator, shellValueFromBytes(quoted.subarray(0, remaining))]);
|
|
171
|
+
}
|
|
172
|
+
async function execute(context) {
|
|
173
|
+
const inputOwner = {};
|
|
174
|
+
let writer;
|
|
175
|
+
let record;
|
|
176
|
+
let closed = false;
|
|
177
|
+
let completion;
|
|
178
|
+
const operation = {};
|
|
179
|
+
const check = () => { context.signal.throwIfAborted(); if (closed)
|
|
180
|
+
throw new Error("Mapfile invocation is closed"); };
|
|
181
|
+
const retire = async () => {
|
|
182
|
+
const results = await Promise.allSettled([
|
|
183
|
+
Promise.resolve().then(() => record?.release()),
|
|
184
|
+
Promise.resolve().then(() => writer?.close()),
|
|
185
|
+
Promise.resolve().then(() => inputOwner.input?.release()),
|
|
186
|
+
]);
|
|
187
|
+
for (const result of results)
|
|
188
|
+
if (result.status === "rejected")
|
|
189
|
+
throw result.reason;
|
|
190
|
+
};
|
|
191
|
+
const close = () => {
|
|
192
|
+
closed = true;
|
|
193
|
+
return completion ??= (async () => {
|
|
194
|
+
let failure;
|
|
195
|
+
try {
|
|
196
|
+
await retire();
|
|
197
|
+
}
|
|
198
|
+
catch (reason) {
|
|
199
|
+
failure = { reason };
|
|
200
|
+
}
|
|
201
|
+
await Promise.allSettled([operation.work]);
|
|
202
|
+
try {
|
|
203
|
+
await retire();
|
|
204
|
+
}
|
|
205
|
+
catch (reason) {
|
|
206
|
+
failure ??= { reason };
|
|
207
|
+
}
|
|
208
|
+
if (failure)
|
|
209
|
+
throw failure.reason;
|
|
210
|
+
})();
|
|
211
|
+
};
|
|
212
|
+
context.registerCleanup(close);
|
|
213
|
+
const validateDescriptor = async (descriptor) => {
|
|
214
|
+
check();
|
|
215
|
+
try {
|
|
216
|
+
context.input.validateOpen(descriptor);
|
|
217
|
+
}
|
|
218
|
+
catch (error) {
|
|
219
|
+
context.signal.throwIfAborted();
|
|
220
|
+
if (error instanceof FsError && error.code === "EBADF")
|
|
221
|
+
throw new MapfileArgumentError(`${descriptor}: invalid file descriptor: Bad file descriptor`, 1);
|
|
222
|
+
throw error;
|
|
223
|
+
}
|
|
224
|
+
check();
|
|
225
|
+
};
|
|
226
|
+
const work = Promise.resolve().then(async () => {
|
|
227
|
+
try {
|
|
228
|
+
check();
|
|
229
|
+
const options = await parseMapfileArguments(context.argumentValues, validateDescriptor);
|
|
230
|
+
check();
|
|
231
|
+
if (options === "help") {
|
|
232
|
+
const body = context.command === "readarray" ? " Read lines from a file into an array variable.\n \n A synonym for `mapfile'.\n" : help;
|
|
233
|
+
await context.stdout.write(new TextEncoder().encode(`${context.command}: ${context.command} ${synopsis}\n${body}`));
|
|
234
|
+
return 2;
|
|
235
|
+
}
|
|
236
|
+
if (context.bindings.describe(options.array).readonly) {
|
|
237
|
+
await context.diagnostic(`${options.array}: readonly variable`);
|
|
238
|
+
return 1;
|
|
239
|
+
}
|
|
240
|
+
writer = await context.bindings.openIndexed(options.array, { clear: options.clear });
|
|
241
|
+
check();
|
|
242
|
+
try {
|
|
243
|
+
inputOwner.input = context.input.borrow(options.descriptor);
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
context.signal.throwIfAborted();
|
|
247
|
+
if (error instanceof FsError && error.code === "EBADF")
|
|
248
|
+
return 0;
|
|
249
|
+
throw error;
|
|
250
|
+
}
|
|
251
|
+
check();
|
|
252
|
+
let reads = 0;
|
|
253
|
+
const read = async () => {
|
|
254
|
+
if (++reads % 128 === 0)
|
|
255
|
+
await yieldTurn(context.signal);
|
|
256
|
+
check();
|
|
257
|
+
let incoming;
|
|
258
|
+
try {
|
|
259
|
+
incoming = await inputOwner.input.record({ delimiter: options.delimiter });
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
context.signal.throwIfAborted();
|
|
263
|
+
if (error instanceof FsError)
|
|
264
|
+
return false;
|
|
265
|
+
throw error;
|
|
266
|
+
}
|
|
267
|
+
record = incoming;
|
|
268
|
+
check();
|
|
269
|
+
return incoming.reason !== "eof" || shellValueByteLength(incoming.shellValue) !== 0;
|
|
270
|
+
};
|
|
271
|
+
const release = async () => { await record?.release(); record = undefined; };
|
|
272
|
+
for (let skipped = 0; skipped < options.skip; skipped++) {
|
|
273
|
+
if (!await read())
|
|
274
|
+
return 0;
|
|
275
|
+
await release();
|
|
276
|
+
}
|
|
277
|
+
let index = options.origin;
|
|
278
|
+
let count = 1;
|
|
279
|
+
while (await read()) {
|
|
280
|
+
const bytes = shellValueBytes(record.shellValue);
|
|
281
|
+
const nul = bytes.indexOf(0);
|
|
282
|
+
let length = nul < 0 ? bytes.length : nul;
|
|
283
|
+
if (options.trim && length && bytes[length - 1] === options.delimiter)
|
|
284
|
+
length--;
|
|
285
|
+
const line = bytes.subarray(0, length);
|
|
286
|
+
if (options.callback !== undefined && count !== 0 && count % options.quantum === 0) {
|
|
287
|
+
const source = await callbackSource(options.callback, index, line, context.signal);
|
|
288
|
+
check();
|
|
289
|
+
await context.evaluate(source, { name: "stdin" });
|
|
290
|
+
check();
|
|
291
|
+
}
|
|
292
|
+
await writer.set(index, shellValueFromBytes(line));
|
|
293
|
+
check();
|
|
294
|
+
await release();
|
|
295
|
+
count = (count + 1) >>> 0;
|
|
296
|
+
if (options.count && count > options.count)
|
|
297
|
+
break;
|
|
298
|
+
index = (index + 1) >>> 0;
|
|
299
|
+
}
|
|
300
|
+
return 0;
|
|
301
|
+
}
|
|
302
|
+
catch (error) {
|
|
303
|
+
context.signal.throwIfAborted();
|
|
304
|
+
if (!(error instanceof MapfileArgumentError))
|
|
305
|
+
throw error;
|
|
306
|
+
check();
|
|
307
|
+
await context.diagnostic(concatShellValues([`${context.command}: `, error.detail]));
|
|
308
|
+
if (error.usage)
|
|
309
|
+
await context.stderr.write(new TextEncoder().encode(`${context.command}: usage: ${context.command} ${synopsis}\n`));
|
|
310
|
+
return error.status;
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
operation.work = work;
|
|
314
|
+
let result = 1;
|
|
315
|
+
let failure;
|
|
316
|
+
try {
|
|
317
|
+
result = await work;
|
|
318
|
+
}
|
|
319
|
+
catch (reason) {
|
|
320
|
+
failure = { reason };
|
|
321
|
+
}
|
|
322
|
+
try {
|
|
323
|
+
await close();
|
|
324
|
+
}
|
|
325
|
+
catch (reason) {
|
|
326
|
+
failure ??= { reason };
|
|
327
|
+
}
|
|
328
|
+
context.signal.throwIfAborted();
|
|
329
|
+
if (failure)
|
|
330
|
+
throw failure.reason;
|
|
331
|
+
return result;
|
|
332
|
+
}
|
|
333
|
+
export function mapfileExtension(options = {}) {
|
|
334
|
+
const { replace = false } = options;
|
|
335
|
+
if (typeof replace !== "boolean")
|
|
336
|
+
throw new TypeError("mapfile replace must be boolean");
|
|
337
|
+
return { name: "mapfile", runtimeIdentity: commandRuntimeIdentity, syntax: { arrayKeys: true }, create: () => ({ builtins: [{ name: "mapfile", execute, replace }, { name: "readarray", execute, replace }] }) };
|
|
338
|
+
}
|