@poe-platform/safe-bash 0.1.809 → 0.1.811
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/audio-ast/flac-source.d.ts +13 -0
- package/dist/audio-ast/index.d.ts +2 -1
- package/dist/audio-ast/index.js +254 -179
- package/dist/audio-ast/wav-source.d.ts +7 -1
- package/dist/image-ast/index.js +1 -1
- package/dist/json-ast/backed-json-parser.d.ts +12 -1
- package/dist/json-ast/index.d.ts +1 -1
- package/dist/office-xml/index.d.ts +1 -0
- package/dist/office-xml/retained-xml-edits.d.ts +22 -0
- package/dist/pdf-ast/cos/mutable-object-store.d.ts +3 -0
- package/dist/pdf-ast/cos/qpdf-json-document.d.ts +43 -0
- package/dist/pdf-ast/cos/qpdf-json-values.d.ts +7 -0
- package/dist/pdf-ast/index.d.ts +1 -0
- package/dist/pdf-ast/index.js +653 -87
- package/dist/pdf-ast/retained-document.d.ts +5 -1
- package/dist/safe-bash/audio-ast.browser.js +2 -1
- package/dist/safe-bash/chunks/{chunk-RQCK77SC.js → chunk-BUYRKFW2.js} +9 -36
- package/dist/safe-bash/chunks/{chunk-SOFBGDXG.js → chunk-HHSOUC3Z.js} +32 -0
- package/dist/safe-bash/chunks/{chunk-WAZEELYB.js → chunk-TPG55BAQ.js} +10 -7
- package/dist/safe-bash/command-chunks/biff-3EFLKBAH-NYWZOYQS.js +4942 -0
- package/dist/safe-bash/command-chunks/{chunk-HEHGHIE2.js → chunk-22MOB45U.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-6DEWZMOL.js → chunk-2CORNDGF.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-62ZAHKFS.js → chunk-2VCKUNDZ.js} +130 -14
- package/dist/safe-bash/command-chunks/{chunk-6UHGIWFX.js → chunk-2ZFLMWOX.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-HONWGFDA.js → chunk-33YCKZZX.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-AXWPJRY6.js → chunk-36XGIPOG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-32ADKP5E.js → chunk-456PHA3L.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-UJXP3T6R.js → chunk-4CKFNXRN.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-5L6GHFRW.js → chunk-554Z6IKP.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ORZRWT62.js → chunk-56NYSX65.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-53JP3S6H.js → chunk-5HPU7D36.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-NB7JO7FE.js → chunk-5LI2DLNZ.js} +26 -26
- package/dist/safe-bash/command-chunks/{chunk-YJJBGN7U.js → chunk-5MB64DWR.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-3ZWBBS6U.js → chunk-5OO2P27R.js} +340 -34
- package/dist/safe-bash/command-chunks/{chunk-IC5GJI7E.js → chunk-5Q22ZLNC.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-YO3V5RLY.js → chunk-6CCQI6XZ.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-EO2IVGV7.js → chunk-6M6TM5Z5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-Z54Z3KRN.js → chunk-6QBMND4A.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-INX4JMQ6.js → chunk-6VPQ3CDZ.js} +5 -5
- package/dist/safe-bash/command-chunks/chunk-72C3TZ2U.js +826 -0
- package/dist/safe-bash/command-chunks/{chunk-VGXVN3BX.js → chunk-7GKKMNL6.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-TZJC67W3.js → chunk-7PVHO47B.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-CM3C7AXJ.js → chunk-A2CLZMQZ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ASR27KHW.js → chunk-A5FZBR7X.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-DMDHE5KC.js → chunk-AHA6IWAJ.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-PTZ55XXN.js → chunk-APEWTWCC.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-YUVH6CE4.js → chunk-ATTWQVR2.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-JON5DB3Z.js → chunk-B5LDP7AA.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-CHJL6JMU.js → chunk-COKYZUBW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-KCTV4NVX.js → chunk-CRV2Q3PB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-V3WXPCKN.js → chunk-CV7M2QJU.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-D7XBUF76.js → chunk-D2ASPM7R.js} +109 -23
- package/dist/safe-bash/command-chunks/{chunk-VPDSQPSN.js → chunk-DM2CPMB4.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-3DTDMEOP.js → chunk-EAGIJ4VW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WFDG3N5R.js → chunk-ECDEPKKW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-JW6CMBF2.js → chunk-EHSM5ZQS.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-WIOH7ZQN.js → chunk-ENT3IV2G.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-5IE4LJGB.js → chunk-EUT24Y5Z.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-COKZFXHG.js → chunk-FIIAYCWS.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-MWVFP2HY.js → chunk-GEM47B2P.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-OQCJGUI6.js → chunk-HARUYHH7.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-EHL6B34L.js → chunk-HDJVJTCK.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-JMM3MNAY.js → chunk-HKATEVAP.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-NVBUC644.js → chunk-HKGNBH7Z.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-VWY3EAVQ.js → chunk-HTVIYLVB.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-Z4QJMDK3.js → chunk-IT7TAC3F.js} +16 -16
- package/dist/safe-bash/command-chunks/{chunk-EWS4KYJE.js → chunk-JFYWVQ4V.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-ZCX63QWA.js → chunk-JOCFI7TG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-F5WTH4O4.js → chunk-JQVHUSDD.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-O4VJEGL6.js → chunk-K5GB2YMN.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-27C3NT5V.js → chunk-KB7DUBVL.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-4DZ32PI7.js → chunk-KCOJA7EM.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-6OKH4X67.js → chunk-KJ4XXZIL.js} +273 -10
- package/dist/safe-bash/command-chunks/{chunk-GLVD3JJG.js → chunk-KL3OIBKB.js} +4712 -4654
- package/dist/safe-bash/command-chunks/{chunk-U6QHTC5J.js → chunk-L5MCW6CM.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-LVL3A7YE.js → chunk-LCZDBW55.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-DJVRDUCA.js → chunk-LXLLA4PM.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-K7AGAS3K.js → chunk-M7QE2MN7.js} +6 -6
- package/dist/safe-bash/command-chunks/chunk-MGBHGZEX.js +12 -0
- package/dist/safe-bash/command-chunks/{chunk-SWT6ILF2.js → chunk-MPUHH2KR.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-DC3OJLRB.js → chunk-NQDIT667.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-LWZVDDJA.js → chunk-NUGQQDGE.js} +5 -1
- package/dist/safe-bash/command-chunks/{chunk-MFLQZLFR.js → chunk-OA75SGN2.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-5LATYOF7.js → chunk-OEJM666F.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-AF25YYIO.js → chunk-PMAM4N33.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-4557HE3J.js → chunk-PMWW7KSB.js} +161 -42
- package/dist/safe-bash/command-chunks/{chunk-KMMAJ6H6.js → chunk-PNGDJA6M.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-62BHPSKJ.js → chunk-Q6S57NOQ.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-KJ3PEDI2.js → chunk-Q73EMLLZ.js} +146 -4
- package/dist/safe-bash/command-chunks/{chunk-FXKBM5KJ.js → chunk-QC5RMGSA.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-UQ6UIZMM.js → chunk-QD7ZRDUN.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-JHUYZZGV.js → chunk-QYMEASQ6.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-3GY5VDIX.js → chunk-QZZ73J2O.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-S2CYIGWH.js → chunk-R6EGGK5M.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-7AVN3OBH.js → chunk-RHYJVTJO.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-EWGDSO6U.js → chunk-RID6VYS3.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-MMBRBANA.js → chunk-RNSKXOG3.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-D3ZRZTY5.js → chunk-RQIQ75W5.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-DWKQPLRT.js → chunk-RRL3Y562.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-JW3KIZU6.js → chunk-RUXY7GN5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-NXCMXD74.js → chunk-S6R3IB36.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-XUPKFHAQ.js → chunk-SDTPO2VV.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-PIAGKRFW.js → chunk-SPLOIABU.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-KELMIFVV.js → chunk-TI52LKLL.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WLTJDNSQ.js → chunk-TVH4JORU.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-6XVMWFHD.js → chunk-TW73OXPR.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-SFO43CID.js → chunk-UAXSE3XE.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-K35BSUHO.js → chunk-UYWSIIUX.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-JJQ72P3V.js → chunk-VCML4T5D.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-DCD32BEY.js → chunk-VU3EQF7F.js} +91 -53
- package/dist/safe-bash/command-chunks/{chunk-2E2YEDVB.js → chunk-W5YSINXC.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-EYNT4OEJ.js → chunk-WGG6G2KG.js} +7 -7
- package/dist/safe-bash/command-chunks/chunk-WH3TIOTS.js +326 -0
- package/dist/safe-bash/command-chunks/{chunk-DVQBZXMQ.js → chunk-WJCN2IXI.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-45FI2IPY.js → chunk-WQ6ABTJU.js} +3 -6
- package/dist/safe-bash/command-chunks/{chunk-XBZ4ZWGL.js → chunk-WVMHRNXZ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-7GXUCQI4.js → chunk-WXRYDALR.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-S4IIOSRA.js → chunk-X7FA7ZD5.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-SFCERNHU.js → chunk-XPD636C4.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-HYDWQLJ3.js → chunk-XRVKWGVQ.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-3UJWHRK4.js → chunk-XVP6V5K3.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-KTI3BULE.js → chunk-XZ2FWFNV.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-QK3CHRGL.js → chunk-Y4EYCZFT.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-GTWVMFBK.js → chunk-YORJDX4V.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-H6F5SN2N.js → chunk-YSMNXMAO.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-GKYCV6BU.js → chunk-YSY6R6AS.js} +493 -183
- package/dist/safe-bash/command-chunks/{chunk-SE5SJ4JT.js → chunk-Z2JW6M2D.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-5HGEXQVD.js → chunk-ZHRGYR7B.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-HQYFRQ5W.js → chunk-ZIIO6GRY.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-NTRZMQZP.js → chunk-ZMHEGDU2.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-EYBXHGA6.js → chunk-ZXR6LXV5.js} +2 -2
- package/dist/safe-bash/command-chunks/{command-engine-P5DFM4OU.js → command-engine-BEWABZ75.js} +10 -3
- package/dist/safe-bash/command-chunks/{engine-RU4OFLPO-CPLFYD67.js → engine-AXXFTGCL-QBQNBI6K.js} +1 -1
- package/dist/safe-bash/command-chunks/pdf-XHHFTOT4-UJJYOYJ2.js +573 -0
- package/dist/safe-bash/commands/audio/index.browser.js +2 -14
- package/dist/safe-bash/commands/diff-patch/index.js +0 -5
- package/dist/safe-bash/commands/diff3/index.js +0 -2
- package/dist/safe-bash/commands/ffprobe/index.browser.js +2 -5
- package/dist/safe-bash/commands/pandoc/index.browser.js +3 -1
- package/dist/safe-bash/commands/text.js +10 -1
- package/dist/safe-bash/core.d.ts +2 -2
- package/dist/safe-bash/core.js +2 -2
- package/dist/safe-bash/full-core.browser.js +18 -22
- package/dist/safe-bash/lazy-optional.d.ts +9 -0
- package/dist/safe-bash/lazy-optional.js +24 -0
- package/dist/safe-bash/plugins/index.browser.js +5 -3
- package/dist/safe-bash/plugins/index.js +3 -1
- package/dist/safe-bash/plugins/portable-commands.d.ts +1 -1
- package/dist/safe-bash/plugins/portable-commands.js +5 -3
- package/dist/safe-bash/registry-entry.browser.js +1 -1
- package/dist/safe-bash-command-apply-patch/apply.js +2 -2
- package/dist/safe-bash-command-apply-patch/index.js +2 -2
- package/dist/safe-bash-command-apply-patch/parser.d.ts +20 -1
- package/dist/safe-bash-command-apply-patch/parser.js +1 -1
- package/dist/safe-bash-command-diff/index.js +0 -2
- package/dist/safe-bash-command-diff3/index.js +830 -56
- package/dist/safe-bash-command-ffmpeg/index.js +1 -1
- package/dist/safe-bash-command-ffprobe/index.js +3 -2
- package/dist/safe-bash-command-ffprobe/media.js +3 -2
- package/dist/safe-bash-command-ffprobe/options.d.ts +15 -0
- package/dist/safe-bash-command-ffprobe/options.js +7 -0
- package/dist/safe-bash-command-html-to-markdown/index.js +75 -21
- package/dist/safe-bash-command-media/index.js +2 -2
- package/dist/safe-bash-command-media/plugin.js +1 -1
- package/dist/safe-bash-command-media/remote.js +2 -2
- package/dist/safe-bash-command-pandoc/command.js +8 -8
- package/dist/safe-bash-command-pandoc/execution.d.ts +2 -2
- package/dist/safe-bash-command-pandoc/index.d.ts +1 -1
- package/dist/safe-bash-command-pandoc/index.js +37 -37
- package/dist/safe-bash-command-pandoc/lua-filters.js +2 -2
- package/dist/safe-bash-command-pandoc/types.d.ts +17 -2
- package/dist/safe-bash-command-patch/index.js +2 -2
- package/dist/safe-bash-command-patch/patch-publication.d.ts +2 -2
- package/dist/safe-bash-command-patch/patch-publication.js +1 -1
- package/dist/safe-bash-command-patch/patch.js +2 -2
- package/dist/safe-bash-command-pdftk/index.js +616 -265
- package/dist/safe-bash-command-pptx/engine.js +1 -1
- package/dist/safe-bash-command-qpdf/index.js +115 -9
- package/dist/safe-bash-command-soffice/index.js +1 -1
- package/dist/safe-bash-command-ssconvert/index.js +2 -2
- package/dist/safe-bash-command-xmllint/index.js +137 -30
- package/dist/safe-bash-command-xq/index.js +45 -29
- package/dist/safe-bash-compression-engine/bounded-codec.js +2 -2
- package/dist/safe-bash-compression-engine/codec-loader.js +1 -1
- package/dist/safe-bash-compression-engine/files.js +5 -5
- package/dist/safe-bash-compression-engine/index.js +4 -4
- package/dist/safe-bash-compression-engine/operand.js +5 -5
- package/dist/safe-bash-compression-engine/stream.js +4 -4
- package/dist/safe-bash-compression-engine/zstd-decode.js +3 -3
- package/dist/safe-bash-media-engine/imagemagick.d.ts +2 -0
- package/dist/safe-bash-media-engine/index.js +162 -72
- package/dist/safe-bash-network-engine/body.d.ts +1 -0
- package/dist/safe-bash-network-engine/body.js +1 -1
- package/dist/safe-bash-network-engine/transfer.js +11 -3
- package/dist/safe-bash-presentation-engine/accessibility.js +30 -30
- package/dist/safe-bash-presentation-engine/animation-editing.js +15 -15
- package/dist/safe-bash-presentation-engine/animations.js +15 -15
- package/dist/safe-bash-presentation-engine/backgrounds.js +16 -16
- package/dist/safe-bash-presentation-engine/bytes.js +3 -3
- package/dist/safe-bash-presentation-engine/chart-editing.js +33 -33
- package/dist/safe-bash-presentation-engine/chart-object-operations.js +24 -24
- package/dist/safe-bash-presentation-engine/charts.js +30 -30
- package/dist/safe-bash-presentation-engine/command-placeholder.js +55 -54
- package/dist/safe-bash-presentation-engine/comments.js +16 -16
- package/dist/safe-bash-presentation-engine/connector-operations.js +31 -31
- package/dist/safe-bash-presentation-engine/connectors.js +28 -28
- package/dist/safe-bash-presentation-engine/content-types.js +4 -4
- package/dist/safe-bash-presentation-engine/creation.js +6 -6
- package/dist/safe-bash-presentation-engine/diff.js +31 -31
- package/dist/safe-bash-presentation-engine/drawing-format.js +19 -19
- package/dist/safe-bash-presentation-engine/drawing-operations.js +30 -30
- package/dist/safe-bash-presentation-engine/drawing-schema.js +20 -20
- package/dist/safe-bash-presentation-engine/equations.js +16 -16
- package/dist/safe-bash-presentation-engine/errors.js +2 -2
- package/dist/safe-bash-presentation-engine/fields.js +16 -16
- package/dist/safe-bash-presentation-engine/font-metrics.js +3 -3
- package/dist/safe-bash-presentation-engine/image-extraction.js +19 -19
- package/dist/safe-bash-presentation-engine/image-formatting.js +31 -31
- package/dist/safe-bash-presentation-engine/image-insertion.js +17 -17
- package/dist/safe-bash-presentation-engine/image-replacement.js +20 -20
- package/dist/safe-bash-presentation-engine/image-value.js +4 -4
- package/dist/safe-bash-presentation-engine/images.js +18 -18
- package/dist/safe-bash-presentation-engine/index.d.ts +2 -2
- package/dist/safe-bash-presentation-engine/index.js +100 -93
- package/dist/safe-bash-presentation-engine/layouts.js +15 -15
- package/dist/safe-bash-presentation-engine/length.js +3 -3
- package/dist/safe-bash-presentation-engine/links.js +15 -15
- package/dist/safe-bash-presentation-engine/masters.js +14 -14
- package/dist/safe-bash-presentation-engine/media-editing.js +23 -23
- package/dist/safe-bash-presentation-engine/media-extraction.js +16 -16
- package/dist/safe-bash-presentation-engine/media.js +15 -15
- package/dist/safe-bash-presentation-engine/memberships.js +14 -14
- package/dist/safe-bash-presentation-engine/notes.js +15 -15
- package/dist/safe-bash-presentation-engine/ole-enum.js +4 -4
- package/dist/safe-bash-presentation-engine/ole-insertion.js +19 -19
- package/dist/safe-bash-presentation-engine/opaque-objects.js +9 -9
- package/dist/safe-bash-presentation-engine/package-reader.js +5 -5
- package/dist/safe-bash-presentation-engine/package-tools.js +15 -15
- package/dist/safe-bash-presentation-engine/package-uri.js +3 -3
- package/dist/safe-bash-presentation-engine/package-writer.js +4 -4
- package/dist/safe-bash-presentation-engine/presentation-model.js +54 -53
- package/dist/safe-bash-presentation-engine/presentation-settings.js +13 -13
- package/dist/safe-bash-presentation-engine/properties.js +15 -15
- package/dist/safe-bash-presentation-engine/relationships.js +4 -4
- package/dist/safe-bash-presentation-engine/resource-limits.js +1 -1
- package/dist/safe-bash-presentation-engine/retained-inspection.js +12 -12
- package/dist/safe-bash-presentation-engine/retained-package.js +4 -4
- package/dist/safe-bash-presentation-engine/retained-slide-settings.d.ts +15 -0
- package/dist/safe-bash-presentation-engine/retained-text.js +19 -19
- package/dist/safe-bash-presentation-engine/retained-xml-parts.d.ts +26 -0
- package/dist/safe-bash-presentation-engine/sanitize.js +16 -16
- package/dist/safe-bash-presentation-engine/selectors.js +10 -10
- package/dist/safe-bash-presentation-engine/shape-groups.js +30 -30
- package/dist/safe-bash-presentation-engine/shape-operations.js +29 -29
- package/dist/safe-bash-presentation-engine/shape-path-operations.js +31 -31
- package/dist/safe-bash-presentation-engine/shape-paths.js +15 -15
- package/dist/safe-bash-presentation-engine/shape-presets.js +3 -3
- package/dist/safe-bash-presentation-engine/shape-selection.js +30 -30
- package/dist/safe-bash-presentation-engine/shape-transforms.js +17 -17
- package/dist/safe-bash-presentation-engine/shapes.js +26 -26
- package/dist/safe-bash-presentation-engine/slide-copy.js +16 -16
- package/dist/safe-bash-presentation-engine/slide-import.js +17 -17
- package/dist/safe-bash-presentation-engine/slide-merge-split.js +19 -19
- package/dist/safe-bash-presentation-engine/slide-model.js +42 -42
- package/dist/safe-bash-presentation-engine/slide-removal.js +17 -17
- package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +9 -9
- package/dist/safe-bash-presentation-engine/slides.d.ts +2 -0
- package/dist/safe-bash-presentation-engine/slides.js +21 -16
- package/dist/safe-bash-presentation-engine/table-operations.js +32 -32
- package/dist/safe-bash-presentation-engine/table-spans.js +31 -31
- package/dist/safe-bash-presentation-engine/tables.js +30 -30
- package/dist/safe-bash-presentation-engine/tags.js +15 -15
- package/dist/safe-bash-presentation-engine/template-bindings.js +32 -32
- package/dist/safe-bash-presentation-engine/template-repeat.js +39 -39
- package/dist/safe-bash-presentation-engine/text-fitting.js +26 -26
- package/dist/safe-bash-presentation-engine/text-frames.js +26 -26
- package/dist/safe-bash-presentation-engine/text-paragraphs.js +26 -26
- package/dist/safe-bash-presentation-engine/text-reading.js +11 -11
- package/dist/safe-bash-presentation-engine/text-replacement.js +16 -16
- package/dist/safe-bash-presentation-engine/text-runs.js +19 -19
- package/dist/safe-bash-presentation-engine/themes.js +15 -15
- package/dist/safe-bash-presentation-engine/transitions.js +15 -15
- package/dist/safe-bash-presentation-engine/validation.js +9 -9
- package/dist/safe-bash-presentation-engine/xml-parts.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/xml-parts.js +19 -13
- package/dist/safe-bash-presentation-engine/xml-view.js +3 -3
- package/dist/safe-bash-presentation-engine/xml.js +3 -3
- package/dist/safe-bash-xml-engine/document.js +1 -1
- package/dist/safe-bash-xml-engine/index.js +1 -1
- package/dist/safe-bash-xml-engine/json.d.ts +1 -0
- package/dist/safe-bash-xml-engine/json.js +203 -0
- package/dist/safe-bash-xml-engine/stored-json.d.ts +5 -0
- package/dist/spreadsheet-engine/rendering/print/bidi-runs.d.ts +5 -0
- package/dist/spreadsheet-engine/rendering/print/bidi-runs.js +35 -0
- package/dist/spreadsheet-engine/rendering/print/control-bidi.d.ts +8 -0
- package/dist/spreadsheet-engine/rendering/print/control-bidi.js +80 -0
- package/dist/spreadsheet-engine/rendering/print/tab-layout.d.ts +11 -0
- package/dist/spreadsheet-engine/rendering/print/tab-layout.js +15 -0
- package/dist/spreadsheet-engine/rendering/print/text-lines.d.ts +2 -2
- package/dist/spreadsheet-engine/rendering/print/text-lines.js +3 -3
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.d.ts +5 -1
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.js +151 -57
- package/dist/spreadsheet-format-xls/biff-encryption.d.ts +1 -1
- package/dist/spreadsheet-format-xls/biff-encryption.js +8 -3
- package/dist/spreadsheet-format-xls/biff-property-bytes.d.ts +4 -1
- package/dist/spreadsheet-format-xls/biff-property-bytes.js +3 -3
- package/dist/spreadsheet-format-xls/biff-range.js +1 -1
- package/dist/spreadsheet-format-xls/biff.js +11 -3
- package/package.json +6 -2
- package/dist/safe-bash/chunks/chunk-I2A5ZCPD.js +0 -17
- package/dist/safe-bash/chunks/chunk-PQTT2EZP.js +0 -8
- package/dist/safe-bash/command-chunks/biff-DS263V2K-2GP4GZT7.js +0 -4868
- package/dist/safe-bash/command-chunks/chunk-6ZFYWT3U.js +0 -581
- package/dist/safe-bash/command-chunks/chunk-S244SWDH.js +0 -153
- package/dist/safe-bash/command-chunks/pdf-T7AWYZGQ-KNAYJ7YF.js +0 -552
- /package/dist/safe-bash/command-chunks/{chunk-EMMSXKEJ.js → chunk-4Q4R3VZU.js} +0 -0
|
@@ -1,581 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PatchPublication
|
|
3
|
-
} from "./chunk-S244SWDH.js";
|
|
4
|
-
import {
|
|
5
|
-
unwrapPatch
|
|
6
|
-
} from "./chunk-JKLOBSMP.js";
|
|
7
|
-
import {
|
|
8
|
-
parsePatch
|
|
9
|
-
} from "./chunk-2VLAXKTS.js";
|
|
10
|
-
import {
|
|
11
|
-
applyHunks,
|
|
12
|
-
reversePatch
|
|
13
|
-
} from "./chunk-MOZD7RUY.js";
|
|
14
|
-
import {
|
|
15
|
-
authorizeOutputs,
|
|
16
|
-
authorizePaths,
|
|
17
|
-
backupName,
|
|
18
|
-
candidateStat,
|
|
19
|
-
ensureParents,
|
|
20
|
-
pruneDirectories,
|
|
21
|
-
pruneParents,
|
|
22
|
-
regular,
|
|
23
|
-
rejectName,
|
|
24
|
-
selectTarget
|
|
25
|
-
} from "./chunk-OQNX2OOS.js";
|
|
26
|
-
import {
|
|
27
|
-
safeTarget
|
|
28
|
-
} from "./chunk-AJEQUVDN.js";
|
|
29
|
-
import {
|
|
30
|
-
rejectText
|
|
31
|
-
} from "./chunk-JYTESTBS.js";
|
|
32
|
-
|
|
33
|
-
// packages/safe-bash-command-patch/src/patch.ts
|
|
34
|
-
import { FsError, dirname, resolvePath, writeBytes } from "../../safe-bash-contracts/index.js";
|
|
35
|
-
import { publicDiagnosticMessage } from "../../safe-bash-contracts/diagnostics.js";
|
|
36
|
-
import { Budget, ToolError, definition, host, inspect, integer } from "../../safe-bash-diff-engine/shared.js";
|
|
37
|
-
import { encodeBytes } from "../../safe-bash-io-engine/byte-encoding.js";
|
|
38
|
-
function flags(args) {
|
|
39
|
-
const result = { input: "-", reverse: false, dryRun: false, atomic: false, quiet: false, force: false, backup: true, fuzz: 2, ignoreWhitespace: false, removeEmpty: false };
|
|
40
|
-
const operands = [];
|
|
41
|
-
const select = (format) => {
|
|
42
|
-
result.format = format;
|
|
43
|
-
};
|
|
44
|
-
const versionControl = (parameter) => {
|
|
45
|
-
if (["simple", "never"].includes(parameter)) result.versionControl = "simple";
|
|
46
|
-
else if (["numbered", "t"].includes(parameter)) result.versionControl = "numbered";
|
|
47
|
-
else if (["existing", "nil"].includes(parameter)) result.versionControl = "existing";
|
|
48
|
-
else throw new ToolError(`invalid version control: ${parameter}`);
|
|
49
|
-
};
|
|
50
|
-
let literal = false;
|
|
51
|
-
let backupSelected = false;
|
|
52
|
-
for (let index = 0; index < args.length; index++) {
|
|
53
|
-
const arg = args[index];
|
|
54
|
-
const value = (attached, name) => {
|
|
55
|
-
const next = attached ?? args[++index];
|
|
56
|
-
if (next === void 0) throw new ToolError(`${name} requires an argument`);
|
|
57
|
-
return next;
|
|
58
|
-
};
|
|
59
|
-
if (literal || arg === "-" || !arg.startsWith("-")) operands.push(arg);
|
|
60
|
-
else if (arg === "--") literal = true;
|
|
61
|
-
else if (arg === "--dry-run") result.dryRun = true;
|
|
62
|
-
else if (arg === "--atomic") result.atomic = true;
|
|
63
|
-
else if (arg === "--quiet" || arg === "--silent") {
|
|
64
|
-
result.quiet = true;
|
|
65
|
-
result.verbose = false;
|
|
66
|
-
} else if (arg === "--force") result.force = true;
|
|
67
|
-
else if (arg === "--batch") continue;
|
|
68
|
-
else if (arg === "--binary") continue;
|
|
69
|
-
else if (arg === "--posix") result.posix = true;
|
|
70
|
-
else if (arg === "--verbose") {
|
|
71
|
-
result.verbose = true;
|
|
72
|
-
result.quiet = false;
|
|
73
|
-
} else if (arg === "--set-time") result.setTime ??= "local";
|
|
74
|
-
else if (arg === "--set-utc") result.setTime = "utc";
|
|
75
|
-
else if (arg === "--merge" || arg.startsWith("--merge=")) {
|
|
76
|
-
const style = arg.includes("=") ? arg.slice(arg.indexOf("=") + 1) : "merge";
|
|
77
|
-
if (style !== "merge" && style !== "diff3") throw new ToolError(`invalid merge style: ${style}`);
|
|
78
|
-
result.merge = style;
|
|
79
|
-
} else if (arg === "--backup") result.alwaysBackup = true;
|
|
80
|
-
else if (arg === "--forward") result.forward = true;
|
|
81
|
-
else if (arg === "--no-backup-if-mismatch") {
|
|
82
|
-
result.backup = false;
|
|
83
|
-
backupSelected = true;
|
|
84
|
-
} else if (arg === "--backup-if-mismatch") {
|
|
85
|
-
result.backup = true;
|
|
86
|
-
backupSelected = true;
|
|
87
|
-
} else if (arg === "--reverse") result.reverse = true;
|
|
88
|
-
else if (arg === "--remove-empty-files") result.removeEmpty = true;
|
|
89
|
-
else if (arg === "--ignore-whitespace" || arg === "--ignore-white-space") result.ignoreWhitespace = true;
|
|
90
|
-
else if (arg === "--unified") select("unified");
|
|
91
|
-
else if (arg === "--context") select("context");
|
|
92
|
-
else if (arg === "--normal") select("normal");
|
|
93
|
-
else if (["--strip", "--input", "--fuzz", "--reject-file", "--output", "--directory", "--get", "--suffix", "--prefix", "--basename-prefix", "--version-control", "--ifdef", "--quoting-style", "--reject-format", "--read-only"].includes(arg.split("=")[0])) {
|
|
94
|
-
const [name] = arg.split("=");
|
|
95
|
-
const parameter = value(arg.includes("=") ? arg.slice(arg.indexOf("=") + 1) : void 0, name);
|
|
96
|
-
if (name === "--ifdef") result.ifdef = parameter;
|
|
97
|
-
else if (name === "--quoting-style") {
|
|
98
|
-
if (!["literal", "shell", "shell-always", "shell-escape", "shell-escape-always", "c", "escape", "locale", "clocale"].includes(parameter)) throw new ToolError(`invalid quoting style: ${parameter}`);
|
|
99
|
-
result.quotingStyle = parameter;
|
|
100
|
-
} else if (name === "--reject-format") {
|
|
101
|
-
if (parameter !== "unified" && parameter !== "context") throw new ToolError(`invalid reject format: ${parameter}`);
|
|
102
|
-
result.rejectFormat = parameter;
|
|
103
|
-
} else if (name === "--read-only") {
|
|
104
|
-
if (!["ignore", "warn", "fail"].includes(parameter)) throw new ToolError(`invalid read-only behavior: ${parameter}`);
|
|
105
|
-
result.readOnly = parameter;
|
|
106
|
-
} else if (name === "--strip") result.strip = integer(parameter, "strip count");
|
|
107
|
-
else if (name === "--fuzz") result.fuzz = integer(parameter, "fuzz");
|
|
108
|
-
else if (name === "--reject-file") result.reject = parameter;
|
|
109
|
-
else if (name === "--output") result.output = parameter;
|
|
110
|
-
else if (name === "--directory") result.directory = parameter;
|
|
111
|
-
else if (name === "--suffix") result.suffix = parameter;
|
|
112
|
-
else if (name === "--prefix") result.prefix = parameter;
|
|
113
|
-
else if (name === "--basename-prefix") result.basenamePrefix = parameter;
|
|
114
|
-
else if (name === "--version-control") versionControl(parameter);
|
|
115
|
-
else if (name === "--get") {
|
|
116
|
-
if (parameter !== "0") throw new ToolError("version-control acquisition is unsupported; use --get=0");
|
|
117
|
-
} else result.input = parameter;
|
|
118
|
-
} else if (arg.startsWith("--")) throw new ToolError(`unsupported option: ${arg}`);
|
|
119
|
-
else for (let offset = 1; offset < arg.length; offset++) {
|
|
120
|
-
const flag = arg[offset];
|
|
121
|
-
if (flag === "R") result.reverse = true;
|
|
122
|
-
else if (flag === "s") {
|
|
123
|
-
result.quiet = true;
|
|
124
|
-
result.verbose = false;
|
|
125
|
-
} else if (flag === "f") result.force = true;
|
|
126
|
-
else if (flag === "t") continue;
|
|
127
|
-
else if (flag === "T") result.setTime ??= "local";
|
|
128
|
-
else if (flag === "Z") result.setTime = "utc";
|
|
129
|
-
else if (flag === "b") result.alwaysBackup = true;
|
|
130
|
-
else if (flag === "N") result.forward = true;
|
|
131
|
-
else if (flag === "E") result.removeEmpty = true;
|
|
132
|
-
else if (flag === "l") result.ignoreWhitespace = true;
|
|
133
|
-
else if (flag === "u") select("unified");
|
|
134
|
-
else if (flag === "c") select("context");
|
|
135
|
-
else if (flag === "n") select("normal");
|
|
136
|
-
else if (["p", "i", "F", "r", "o", "d", "g", "z", "B", "Y", "V", "D"].includes(flag)) {
|
|
137
|
-
const parameter = value(arg.slice(offset + 1) || void 0, `-${flag}`);
|
|
138
|
-
if (flag === "D") result.ifdef = parameter;
|
|
139
|
-
else if (flag === "p") result.strip = integer(parameter, "strip count");
|
|
140
|
-
else if (flag === "F") result.fuzz = integer(parameter, "fuzz");
|
|
141
|
-
else if (flag === "r") result.reject = parameter;
|
|
142
|
-
else if (flag === "o") result.output = parameter;
|
|
143
|
-
else if (flag === "d") result.directory = parameter;
|
|
144
|
-
else if (flag === "z") result.suffix = parameter;
|
|
145
|
-
else if (flag === "B") result.prefix = parameter;
|
|
146
|
-
else if (flag === "Y") result.basenamePrefix = parameter;
|
|
147
|
-
else if (flag === "V") versionControl(parameter);
|
|
148
|
-
else if (flag === "g") {
|
|
149
|
-
if (parameter !== "0") throw new ToolError("version-control acquisition is unsupported; use -g0");
|
|
150
|
-
} else result.input = parameter;
|
|
151
|
-
break;
|
|
152
|
-
} else throw new ToolError(`unsupported option: -${flag}`);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (operands.length > 2) throw new ToolError("expected at most a target file and a patch input file");
|
|
156
|
-
if (operands.length) result.target = operands[0];
|
|
157
|
-
if (operands.length === 2) result.input = operands[1];
|
|
158
|
-
if (!result.input || result.input.includes("\0")) throw new ToolError("invalid patch input path");
|
|
159
|
-
for (const path of [result.output, result.directory]) if (path !== void 0 && (!path || path.includes("\0"))) throw new ToolError("invalid patch option path");
|
|
160
|
-
if (result.ifdef !== void 0 && (!result.ifdef || [...result.ifdef].some((c) => !"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_".includes(c)))) throw new ToolError("invalid ifdef symbol");
|
|
161
|
-
if (result.merge) result.fuzz = 0;
|
|
162
|
-
if (result.posix && !backupSelected) result.backup = false;
|
|
163
|
-
return result;
|
|
164
|
-
}
|
|
165
|
-
async function applyContent(sourcePatch, current, exists, options, budget) {
|
|
166
|
-
let reversed = options.reverse;
|
|
167
|
-
let patch = reversed ? reversePatch(sourcePatch) : sourcePatch;
|
|
168
|
-
const emptyOld = () => patch.hunks.every((hunk) => hunk.oldCount === 0 && hunk.oldStart === 0);
|
|
169
|
-
const creation = () => patch.oldPath === "/dev/null" || emptyOld() && (patch.oldEpoch || !exists);
|
|
170
|
-
let autoReversed = false;
|
|
171
|
-
let reverseMismatch = false;
|
|
172
|
-
const declaredCreation = patch.oldPath === "/dev/null" || patch.oldEpoch && emptyOld();
|
|
173
|
-
const declaredDeletion = patch.newPath === "/dev/null" || patch.newEpoch && patch.hunks.every((hunk) => hunk.newCount === 0);
|
|
174
|
-
if (!options.force && (declaredCreation && current !== "" || declaredDeletion && !exists)) {
|
|
175
|
-
patch = reversePatch(patch);
|
|
176
|
-
reversed = !reversed;
|
|
177
|
-
autoReversed = true;
|
|
178
|
-
}
|
|
179
|
-
if (!creation() && !exists) return void 0;
|
|
180
|
-
let outcomes = [];
|
|
181
|
-
let result = await applyHunks(current, patch, options.fuzz, budget, options.ignoreWhitespace, {
|
|
182
|
-
partial: true,
|
|
183
|
-
outcomes,
|
|
184
|
-
...options.ifdef === void 0 ? {} : { ifdef: options.ifdef },
|
|
185
|
-
...options.merge === void 0 ? {} : { merge: options.merge },
|
|
186
|
-
rejectAll: creation() && current !== ""
|
|
187
|
-
});
|
|
188
|
-
if (!options.merge && !options.force && !autoReversed && (outcomes[0]?.failed || outcomes[0]?.fuzz)) {
|
|
189
|
-
const opposite = reversePatch(patch);
|
|
190
|
-
const probe = [];
|
|
191
|
-
const reverseFuzz = outcomes[0].failed ? options.fuzz : outcomes[0].fuzz - 1;
|
|
192
|
-
await applyHunks(current, { ...opposite, hunks: opposite.hunks.slice(0, 1) }, reverseFuzz, budget, options.ignoreWhitespace, { partial: true, outcomes: probe });
|
|
193
|
-
if (!probe[0]?.failed) {
|
|
194
|
-
patch = opposite;
|
|
195
|
-
reversed = !reversed;
|
|
196
|
-
autoReversed = true;
|
|
197
|
-
reverseMismatch = true;
|
|
198
|
-
outcomes = [];
|
|
199
|
-
result = await applyHunks(current, patch, options.fuzz, budget, options.ignoreWhitespace, {
|
|
200
|
-
partial: true,
|
|
201
|
-
outcomes,
|
|
202
|
-
...options.ifdef === void 0 ? {} : { ifdef: options.ifdef },
|
|
203
|
-
...options.merge === void 0 ? {} : { merge: options.merge },
|
|
204
|
-
rejectAll: creation() && current !== ""
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
const deletion = patch.newPath === "/dev/null" || patch.newEpoch && patch.hunks.every((hunk) => hunk.newCount === 0 && hunk.newStart === 0);
|
|
209
|
-
if (autoReversed && options.forward) return { result: current, outcomes: [], reversed, autoReversed, reverseMismatch, deletion: false, skipped: true };
|
|
210
|
-
return { result, outcomes, reversed, autoReversed, reverseMismatch, deletion };
|
|
211
|
-
}
|
|
212
|
-
async function unchanged(item, budget) {
|
|
213
|
-
if (item.sourcePath !== void 0) {
|
|
214
|
-
const source = await inspect(budget, item.sourcePath);
|
|
215
|
-
regular(source, item.sourcePath);
|
|
216
|
-
if (source === void 0 !== (item.sourceOriginal === void 0) || source && await budget.read(item.sourcePath) !== item.sourceOriginal) throw new ToolError(`target changed during preflight: ${item.sourcePath}`, 1);
|
|
217
|
-
}
|
|
218
|
-
const stat = await inspect(budget, item.path);
|
|
219
|
-
regular(stat, item.path);
|
|
220
|
-
if (stat === void 0 !== (item.original === void 0) || item.original !== void 0 && await budget.read(item.path) !== item.original) {
|
|
221
|
-
throw new ToolError(`target changed during preflight: ${item.path}`, 1);
|
|
222
|
-
}
|
|
223
|
-
for (const path of [item.backupPath, item.rejectPath]) {
|
|
224
|
-
if (path !== void 0) regular(await inspect(budget, path), path);
|
|
225
|
-
}
|
|
226
|
-
for (const parent of item.parents) await inspect(budget, parent);
|
|
227
|
-
}
|
|
228
|
-
async function publish(item, budget, rejects, publication) {
|
|
229
|
-
const context = budget.context;
|
|
230
|
-
await unchanged(item, budget);
|
|
231
|
-
const write = async (path, text, append = false, createParents = true, mode, mtimeMs) => {
|
|
232
|
-
if (createParents) await ensureParents(path, budget);
|
|
233
|
-
else if ((await inspect(budget, dirname(path)))?.type !== "directory") throw new ToolError(`reject parent does not exist: ${dirname(path)}`);
|
|
234
|
-
const stat = await inspect(budget, path);
|
|
235
|
-
regular(stat, path);
|
|
236
|
-
const capabilities = await host(context, async () => await context.fs.capabilitiesFor?.(path, { signal: context.signal, create: true }) ?? context.fs.capabilities);
|
|
237
|
-
if (capabilities?.atomicStagingAncestry !== true && !(publication.trusted && capabilities?.trustedOwnedStaging === true)) throw new ToolError("filesystem does not support race-safe patch publication");
|
|
238
|
-
const publicationMode = capabilities?.permissions === false ? void 0 : mode ?? (stat ? stat.mode & 4095 : void 0);
|
|
239
|
-
if (append && stat) text = await budget.read(path) + text;
|
|
240
|
-
await publication.write(path, text, stat, publicationMode, mtimeMs);
|
|
241
|
-
};
|
|
242
|
-
if (item.backup !== void 0 && item.backupPath !== void 0) await write(item.backupPath, item.backup, false, true, item.backupMode);
|
|
243
|
-
if (item.remove) {
|
|
244
|
-
if (item.original !== void 0) {
|
|
245
|
-
const expected = await inspect(budget, item.path);
|
|
246
|
-
regular(expected, item.path);
|
|
247
|
-
if (!expected) throw new ToolError(`target changed during publication: ${item.path}`, 1);
|
|
248
|
-
await publication.remove(item.path, expected);
|
|
249
|
-
}
|
|
250
|
-
} else if (!item.skipWrite) {
|
|
251
|
-
await write(item.path, item.result, false, true, void 0, item.mtimeMs);
|
|
252
|
-
}
|
|
253
|
-
if (item.rejectPath !== void 0 && item.reject !== void 0) {
|
|
254
|
-
await write(item.rejectPath, item.reject, rejects.has(item.rejectPath), false);
|
|
255
|
-
rejects.add(item.rejectPath);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
async function run(context, budget) {
|
|
259
|
-
const options = flags(context.args);
|
|
260
|
-
if (options.directory !== void 0) {
|
|
261
|
-
const cwd = resolvePath(context.cwd, options.directory);
|
|
262
|
-
if ((await inspect(budget, cwd))?.type !== "directory") throw new ToolError(`not a directory: ${options.directory}`);
|
|
263
|
-
context = { ...context, cwd };
|
|
264
|
-
budget = new Budget(context, Object.fromEntries(Object.entries(budget.limits).filter(([, value]) => Number.isFinite(value))));
|
|
265
|
-
}
|
|
266
|
-
let publication = new PatchPublication(context);
|
|
267
|
-
if (!options.dryRun) {
|
|
268
|
-
const fs = context.fs;
|
|
269
|
-
const capabilities = await host(context, async () => await fs.capabilitiesFor?.(context.cwd, { signal: context.signal }) ?? fs.capabilities);
|
|
270
|
-
if (capabilities.readOnly === true) throw new FsError("EROFS", { syscall: "patch", path: context.cwd });
|
|
271
|
-
const trusted = capabilities.atomicStagingAncestry !== true && capabilities.trustedOwnedStaging === true;
|
|
272
|
-
if ((trusted ? !fs.prepareDirectory || !fs.removeFileConditional : !fs.confineExtraction || capabilities.atomicStagingAncestry !== true) || !fs.createStagedFile || !fs.publishStagedFile || !fs.removeStagedFile) {
|
|
273
|
-
throw new ToolError("filesystem does not support race-safe patch publication");
|
|
274
|
-
}
|
|
275
|
-
publication = new PatchPublication(context, trusted);
|
|
276
|
-
await publication.capture(`${context.cwd === "/" ? "" : context.cwd}/.patch-admission`);
|
|
277
|
-
const confined = trusted ? fs : await host(context, () => fs.confineExtraction([context.cwd], { signal: context.signal }));
|
|
278
|
-
context = { ...context, fs: new Proxy(fs, {
|
|
279
|
-
get(target, property) {
|
|
280
|
-
if (trusted && property === "mkdir") return (path) => publication.mkdir(path);
|
|
281
|
-
if (property === "rmdir") return (path) => publication.prune(path);
|
|
282
|
-
const selected = ["mkdir", "rm"].includes(String(property)) ? confined : target;
|
|
283
|
-
const value = Reflect.get(selected, property, selected);
|
|
284
|
-
return typeof value === "function" ? value.bind(selected) : value;
|
|
285
|
-
}
|
|
286
|
-
}) };
|
|
287
|
-
budget = new Budget(context, Object.fromEntries(Object.entries(budget.limits).filter(([, value]) => Number.isFinite(value))));
|
|
288
|
-
}
|
|
289
|
-
const output = options.output === void 0 ? void 0 : safeTarget(options.output, 0, true);
|
|
290
|
-
if (options.output !== void 0 && output === void 0) throw new ToolError("/dev/null is not an output file");
|
|
291
|
-
const outputPath = output === void 0 ? void 0 : resolvePath(context.cwd, output);
|
|
292
|
-
const explicit = options.target === void 0 ? void 0 : safeTarget(options.target, 0, true);
|
|
293
|
-
if (options.target !== void 0 && explicit === void 0) throw new ToolError("/dev/null is not an explicit target");
|
|
294
|
-
if (options.input !== "-") {
|
|
295
|
-
const stat = await inspect(budget, options.input);
|
|
296
|
-
if (stat?.type !== "file") throw new ToolError("patch input must be a regular file");
|
|
297
|
-
}
|
|
298
|
-
const input = await budget.read(options.input === "-" ? "-" : resolvePath(context.cwd, options.input));
|
|
299
|
-
const progress = options.atomic ? void 0 : {};
|
|
300
|
-
const sections = await parsePatch(await unwrapPatch(input, budget), budget, options.format, explicit, progress);
|
|
301
|
-
const parsed = options.format === "normal" ? sections : sections.filter((patch) => !patch.unlocated);
|
|
302
|
-
if (sections.length && !parsed.length) throw new ToolError("no identifiable patch; normal input requires a target, Index header, or -n");
|
|
303
|
-
const reject = options.reject === void 0 || options.reject === "-" ? options.reject : safeTarget(options.reject, 0, true);
|
|
304
|
-
if (options.reject !== void 0 && reject === void 0) throw new ToolError("/dev/null is not a reject file; use -r -");
|
|
305
|
-
const paths = {
|
|
306
|
-
strip: options.strip,
|
|
307
|
-
explicit,
|
|
308
|
-
reject,
|
|
309
|
-
posix: options.posix,
|
|
310
|
-
input: options.input === "-" ? void 0 : resolvePath(context.cwd, options.input)
|
|
311
|
-
};
|
|
312
|
-
const preview = /* @__PURE__ */ new Map();
|
|
313
|
-
const previewParents = /* @__PURE__ */ new Set();
|
|
314
|
-
const authorized = await authorizePaths(parsed, paths, budget, !options.dryRun || options.atomic ? {
|
|
315
|
-
reverse: options.atomic && options.reverse,
|
|
316
|
-
exists: async (path) => preview.has(path) ? preview.get(path) !== void 0 : previewParents.has(path) || await candidateStat(path, budget) !== void 0,
|
|
317
|
-
advance: async (item) => {
|
|
318
|
-
const path = resolvePath(context.cwd, item.selected);
|
|
319
|
-
const current = preview.has(path) ? preview.get(path) : await inspect(budget, path) ? await budget.read(path) : void 0;
|
|
320
|
-
const applied = await applyContent(item.patch, current ?? "", current !== void 0, options, budget);
|
|
321
|
-
if (!applied) return;
|
|
322
|
-
const remove = options.ifdef === void 0 && applied.result === "" && (!options.posix && applied.deletion || options.removeEmpty);
|
|
323
|
-
preview.set(path, remove ? void 0 : applied.result);
|
|
324
|
-
if (!remove) for (let parent = dirname(path); parent !== "/"; parent = dirname(parent)) previewParents.add(parent);
|
|
325
|
-
}
|
|
326
|
-
} : void 0);
|
|
327
|
-
const targets = new Set(authorized.flatMap((item) => item.selected === void 0 ? [] : [resolvePath(context.cwd, item.selected)]));
|
|
328
|
-
if (outputPath !== void 0) await authorizeOutputs([outputPath], targets, paths.input, budget);
|
|
329
|
-
const staged = /* @__PURE__ */ new Map();
|
|
330
|
-
const stagedParents = /* @__PURE__ */ new Set();
|
|
331
|
-
const touched = /* @__PURE__ */ new Set();
|
|
332
|
-
const rejects = /* @__PURE__ */ new Set();
|
|
333
|
-
const backupPaths = /* @__PURE__ */ new Set();
|
|
334
|
-
const rejectPaths = /* @__PURE__ */ new Set();
|
|
335
|
-
const parents = /* @__PURE__ */ new Set();
|
|
336
|
-
const messages = [];
|
|
337
|
-
let exitCode = 0;
|
|
338
|
-
let committed = 0;
|
|
339
|
-
let publishing = false;
|
|
340
|
-
let activePath;
|
|
341
|
-
let outputContents = "";
|
|
342
|
-
const status = async (text) => {
|
|
343
|
-
if (!text) return;
|
|
344
|
-
budget.output(text);
|
|
345
|
-
if (options.atomic) messages.push(text);
|
|
346
|
-
else await writeBytes(context.stdout, encodeBytes(text), context.signal);
|
|
347
|
-
};
|
|
348
|
-
const applySection = async (authorizedPatch) => {
|
|
349
|
-
const sourcePatch = authorizedPatch.patch;
|
|
350
|
-
if (sourcePatch.unlocated) {
|
|
351
|
-
if (options.atomic) throw new ToolError("no file to patch; provide a target or Index header", 1);
|
|
352
|
-
await status(`No file to patch. Skipping patch.
|
|
353
|
-
${sourcePatch.hunks.length} out of ${sourcePatch.hunks.length} hunks ignored
|
|
354
|
-
`);
|
|
355
|
-
exitCode = 1;
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
const name = await selectTarget(authorizedPatch, async (path2) => options.atomic && staged.has(path2) ? !staged.get(path2).remove : options.atomic && stagedParents.has(path2) || await candidateStat(path2, budget) !== void 0, budget);
|
|
359
|
-
const path = resolvePath(context.cwd, name);
|
|
360
|
-
activePath = path;
|
|
361
|
-
const pruning = pruneParents(name, context.cwd).filter((parent) => parent !== context.cwd);
|
|
362
|
-
if (!options.dryRun) await publication.capture(path, pruning);
|
|
363
|
-
if (path === paths.input || backupPaths.has(path) || rejectPaths.has(path)) throw new ToolError(`patch target aliases input or an earlier output: ${path}`);
|
|
364
|
-
targets.add(path);
|
|
365
|
-
const prior = options.atomic ? staged.get(path) : void 0;
|
|
366
|
-
const stat = await inspect(budget, path);
|
|
367
|
-
regular(stat, path);
|
|
368
|
-
if (stat && options.readOnly !== "ignore") {
|
|
369
|
-
const capabilities = await host(context, async () => await context.fs.capabilitiesFor?.(path, { signal: context.signal }) ?? context.fs.capabilities);
|
|
370
|
-
if (capabilities?.permissions !== false && !(stat.mode & 146)) {
|
|
371
|
-
const refuse = options.readOnly === "fail";
|
|
372
|
-
await status(`File ${name} is read-only; ${refuse ? "refusing to patch" : "trying to patch anyway"}
|
|
373
|
-
`);
|
|
374
|
-
if (refuse) {
|
|
375
|
-
if (options.atomic) throw new ToolError(`read-only target: ${name}`, 1);
|
|
376
|
-
const destination = rejectName(name, paths);
|
|
377
|
-
const rejectPath2 = options.dryRun || destination === void 0 ? void 0 : resolvePath(context.cwd, destination);
|
|
378
|
-
if (rejectPath2 !== void 0) {
|
|
379
|
-
await authorizeOutputs([rejectPath2], targets, paths.input, budget);
|
|
380
|
-
if (backupPaths.has(rejectPath2)) throw new ToolError("reject path aliases another section's backup");
|
|
381
|
-
const patch = options.reverse ? reversePatch(sourcePatch) : sourcePatch;
|
|
382
|
-
const outcomes2 = patch.hunks.map((hunk, index) => ({
|
|
383
|
-
hunk,
|
|
384
|
-
index: index + 1,
|
|
385
|
-
failed: true,
|
|
386
|
-
misordered: false,
|
|
387
|
-
line: hunk.oldStart,
|
|
388
|
-
outputOffset: 0,
|
|
389
|
-
offset: 0,
|
|
390
|
-
fuzz: 0
|
|
391
|
-
}));
|
|
392
|
-
const reject2 = await rejectText(sourcePatch, outcomes2, authorizedPatch.oldName, authorizedPatch.newName, authorizedPatch.indexName, options.reverse, budget, options.rejectFormat);
|
|
393
|
-
const original2 = await budget.read(path);
|
|
394
|
-
publishing = true;
|
|
395
|
-
await publish({ path, original: original2, result: original2, remove: false, skipWrite: true, rejectPath: rejectPath2, reject: reject2, parents: [] }, budget, rejects, publication);
|
|
396
|
-
committed++;
|
|
397
|
-
publishing = false;
|
|
398
|
-
rejectPaths.add(rejectPath2);
|
|
399
|
-
}
|
|
400
|
-
await status(`${sourcePatch.hunks.length} out of ${sourcePatch.hunks.length} ${sourcePatch.hunks.length === 1 ? "hunk" : "hunks"} ignored${rejectPath2 === void 0 ? "" : ` -- saving rejects to file ${destination}`}
|
|
401
|
-
`);
|
|
402
|
-
exitCode = 1;
|
|
403
|
-
return;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
const exists = prior ? !prior.remove : stat !== void 0;
|
|
408
|
-
const original = prior ? prior.original : stat ? await budget.read(path) : void 0;
|
|
409
|
-
const current = prior ? prior.remove ? "" : prior.result : original ?? "";
|
|
410
|
-
if (options.posix && !exists) {
|
|
411
|
-
await status(`No file to patch. Skipping patch.
|
|
412
|
-
${sourcePatch.hunks.length} out of ${sourcePatch.hunks.length} hunks ignored
|
|
413
|
-
`);
|
|
414
|
-
exitCode = 1;
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
417
|
-
const applied = await applyContent(sourcePatch, current, exists, options, budget);
|
|
418
|
-
if (!applied) {
|
|
419
|
-
if (options.atomic) throw new ToolError(`patch target does not exist: ${path}`, 1);
|
|
420
|
-
await status(`No file to patch. Skipping patch ${name}.
|
|
421
|
-
${sourcePatch.hunks.length} out of ${sourcePatch.hunks.length} hunks ignored
|
|
422
|
-
`);
|
|
423
|
-
exitCode = 1;
|
|
424
|
-
return;
|
|
425
|
-
}
|
|
426
|
-
const { result, outcomes, reversed, autoReversed, reverseMismatch, deletion } = applied;
|
|
427
|
-
if (applied.skipped) {
|
|
428
|
-
await status(`Reversed (or previously applied) patch detected! Skipping patch.
|
|
429
|
-
${sourcePatch.hunks.length} out of ${sourcePatch.hunks.length} hunks ignored
|
|
430
|
-
`);
|
|
431
|
-
exitCode = 1;
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
const failed = outcomes.filter((outcome) => outcome.failed);
|
|
435
|
-
const conflict = failed.length > 0 || deletion && result !== "";
|
|
436
|
-
if (options.atomic && conflict) throw new ToolError(failed.length ? `hunk ${failed[0].index} does not match ${name}` : `deletion patch leaves content: ${name}`, 1);
|
|
437
|
-
if (conflict) exitCode = 1;
|
|
438
|
-
const mismatch = reverseMismatch || outcomes.some((outcome) => outcome.failed || outcome.offset !== 0 || outcome.fuzz !== 0);
|
|
439
|
-
const backup = !options.dryRun && (options.alwaysBackup || options.backup && mismatch) && !touched.has(path) ? original ?? "" : void 0;
|
|
440
|
-
const backupPath = backup === void 0 ? prior?.backupPath : await backupName(path, budget, options);
|
|
441
|
-
const rejectDestination = rejectName(name, paths);
|
|
442
|
-
const rejectPath = !options.dryRun && !options.merge && failed.length && rejectDestination !== void 0 ? resolvePath(context.cwd, rejectDestination) : void 0;
|
|
443
|
-
const rejected = rejectPath === void 0 ? void 0 : await rejectText(sourcePatch, outcomes, authorizedPatch.oldName, authorizedPatch.newName, authorizedPatch.indexName, reversed, budget, options.rejectFormat);
|
|
444
|
-
await authorizeOutputs([outputPath, backupPath, rejectPath], targets, paths.input, budget);
|
|
445
|
-
if (backupPath !== void 0 && rejectPaths.has(backupPath) || rejectPath !== void 0 && backupPaths.has(rejectPath)) {
|
|
446
|
-
throw new ToolError("reject path aliases another section's backup");
|
|
447
|
-
}
|
|
448
|
-
if (backupPath !== void 0) backupPaths.add(backupPath);
|
|
449
|
-
if (rejectPath !== void 0) rejectPaths.add(rejectPath);
|
|
450
|
-
const remove = options.ifdef === void 0 && outputPath === void 0 && result === "" && (!options.posix && deletion || options.removeEmpty);
|
|
451
|
-
const outputPrior = outputPath === void 0 ? void 0 : staged.get(outputPath);
|
|
452
|
-
const outputOriginal = outputPath === void 0 ? original : outputPrior ? outputPrior.original : await inspect(budget, outputPath) ? await budget.read(outputPath) : void 0;
|
|
453
|
-
if (outputPath !== void 0) outputContents += result;
|
|
454
|
-
let mtimeMs;
|
|
455
|
-
let timeMessage = "";
|
|
456
|
-
if (options.setTime) {
|
|
457
|
-
const oldTime = patchTimestamp(reversed ? sourcePatch.newHeader : sourcePatch.oldHeader, options.setTime);
|
|
458
|
-
const newTime = patchTimestamp(reversed ? sourcePatch.oldHeader : sourcePatch.newHeader, options.setTime);
|
|
459
|
-
if (newTime !== void 0) {
|
|
460
|
-
if (!options.force && stat && oldTime !== void 0 && oldTime !== stat.mtimeMs) timeMessage = `Not setting time of file ${name} (time mismatch)
|
|
461
|
-
`;
|
|
462
|
-
else if (!options.force && mismatch) timeMessage = `Not setting time of file ${name} (contents mismatch)
|
|
463
|
-
`;
|
|
464
|
-
else {
|
|
465
|
-
if (!options.dryRun && !context.fs.utimes) throw new ToolError("filesystem does not support setting timestamps");
|
|
466
|
-
mtimeMs = newTime;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
const item = {
|
|
471
|
-
path: outputPath ?? path,
|
|
472
|
-
original: outputOriginal,
|
|
473
|
-
result: outputPath === void 0 ? result : outputContents,
|
|
474
|
-
remove,
|
|
475
|
-
...outputPath === void 0 ? {} : { sourcePath: path, ...original === void 0 ? {} : { sourceOriginal: original } },
|
|
476
|
-
...backup === void 0 ? prior?.backup === void 0 ? {} : { backup: prior.backup } : { backup },
|
|
477
|
-
...backupPath === void 0 ? {} : { backupPath },
|
|
478
|
-
...prior?.backupMode !== void 0 ? { backupMode: prior.backupMode } : backup !== void 0 && stat ? { backupMode: stat.mode & 4095 } : {},
|
|
479
|
-
...mtimeMs === void 0 ? {} : { mtimeMs },
|
|
480
|
-
...rejectPath === void 0 ? {} : { rejectPath, reject: rejected },
|
|
481
|
-
parents: remove ? pruning : []
|
|
482
|
-
};
|
|
483
|
-
const displayName = quotePatchName(name, options.quotingStyle);
|
|
484
|
-
let message = options.quiet ? "" : `${options.dryRun ? "checking" : "patching"} file ${output === void 0 ? displayName : `${quotePatchName(output, options.quotingStyle)} (read from ${displayName})`}
|
|
485
|
-
`;
|
|
486
|
-
if (options.verbose) {
|
|
487
|
-
const format = sourcePatch.format ?? "unified";
|
|
488
|
-
const headers = sourcePatch.oldHeader === void 0 ? "" : `|${format === "context" ? "***" : "---"} ${sourcePatch.oldHeader}
|
|
489
|
-
|${format === "context" ? "---" : "+++"} ${sourcePatch.newHeader}
|
|
490
|
-
`;
|
|
491
|
-
message = `Hmm... Looks like a ${format} diff to me...
|
|
492
|
-
The text leading up to this was:
|
|
493
|
-
--------------------------
|
|
494
|
-
${headers}--------------------------
|
|
495
|
-
` + message;
|
|
496
|
-
}
|
|
497
|
-
if (autoReversed) message += "Reversed (or previously applied) patch detected! Assuming -R.\n";
|
|
498
|
-
for (const outcome of outcomes) {
|
|
499
|
-
if (outcome.misordered) message += "misordered hunks! output would be garbled\n";
|
|
500
|
-
if (options.quiet) continue;
|
|
501
|
-
if (outcome.failed && options.merge) message += `Hunk #${outcome.index} NOT MERGED at ${outcome.mergeRange?.[0] ?? outcome.line}-${outcome.mergeRange?.[1] ?? outcome.line}.
|
|
502
|
-
`;
|
|
503
|
-
else if (outcome.failed) message += `Hunk #${outcome.index} FAILED at ${outcome.line}.
|
|
504
|
-
`;
|
|
505
|
-
else if (options.verbose || outcome.offset || outcome.fuzz) message += `Hunk #${outcome.index} succeeded at ${outcome.line}${outcome.fuzz ? ` with fuzz ${outcome.fuzz}` : ""}${outcome.offset ? ` (offset ${outcome.offset} ${outcome.offset === 1 ? "line" : "lines"})` : ""}.
|
|
506
|
-
`;
|
|
507
|
-
}
|
|
508
|
-
if (failed.length && !options.merge) message += `${failed.length} out of ${outcomes.length} ${outcomes.length === 1 ? "hunk" : "hunks"} FAILED${options.dryRun || rejectPath === void 0 ? "" : ` -- saving rejects to file ${rejectDestination}`}
|
|
509
|
-
`;
|
|
510
|
-
if (deletion && result !== "") message += `Not deleting file ${name} as content differs from patch
|
|
511
|
-
`;
|
|
512
|
-
message += timeMessage;
|
|
513
|
-
budget.output(result);
|
|
514
|
-
if (backup !== void 0) budget.output(backup);
|
|
515
|
-
await status(message);
|
|
516
|
-
touched.add(path);
|
|
517
|
-
if (options.atomic) {
|
|
518
|
-
staged.set(item.path, item);
|
|
519
|
-
if (!remove) for (let parent = dirname(path); parent !== "/"; parent = dirname(parent)) stagedParents.add(parent);
|
|
520
|
-
} else if (!options.dryRun) {
|
|
521
|
-
publishing = true;
|
|
522
|
-
await publish(item, budget, rejects, publication);
|
|
523
|
-
committed++;
|
|
524
|
-
publishing = false;
|
|
525
|
-
for (const parent of item.parents) parents.add(parent);
|
|
526
|
-
}
|
|
527
|
-
};
|
|
528
|
-
for (const authorizedPatch of options.atomic && options.reverse ? authorized.slice().reverse() : authorized) {
|
|
529
|
-
activePath = authorizedPatch.selected === void 0 ? void 0 : resolvePath(context.cwd, authorizedPatch.selected);
|
|
530
|
-
try {
|
|
531
|
-
await applySection(authorizedPatch);
|
|
532
|
-
} catch (error) {
|
|
533
|
-
context.signal.throwIfAborted();
|
|
534
|
-
if (committed === 0 && !publishing) throw error;
|
|
535
|
-
throw new ToolError(`commit stopped; ${committed}/${authorized.length} files committed; failing operation may have side effects; path ${activePath}: ${publicDiagnosticMessage(error, budget.context.onInternalError)}`);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
if (options.atomic && !options.dryRun) {
|
|
539
|
-
const prepared = [...staged.values()].filter((item) => !(item.remove && item.original === void 0));
|
|
540
|
-
for (const item of prepared) await unchanged(item, budget);
|
|
541
|
-
for (const item of prepared) {
|
|
542
|
-
try {
|
|
543
|
-
await publish(item, budget, rejects, publication);
|
|
544
|
-
committed++;
|
|
545
|
-
} catch (error) {
|
|
546
|
-
context.signal.throwIfAborted();
|
|
547
|
-
throw new ToolError(`commit stopped; ${committed}/${prepared.length} files committed; failing operation may have side effects; path ${item.path}: ${publicDiagnosticMessage(error, budget.context.onInternalError)}`);
|
|
548
|
-
}
|
|
549
|
-
for (const parent of item.parents) parents.add(parent);
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
if (!options.dryRun) await pruneDirectories(parents, budget);
|
|
553
|
-
if (options.verbose) await status("done\n");
|
|
554
|
-
if (options.atomic && (!options.quiet || messages.length)) await writeBytes(context.stdout, encodeBytes(messages.join("")), context.signal);
|
|
555
|
-
if (progress?.error) throw progress.error;
|
|
556
|
-
return exitCode;
|
|
557
|
-
}
|
|
558
|
-
function patchCommand(options = {}) {
|
|
559
|
-
return definition("patch", options, run);
|
|
560
|
-
}
|
|
561
|
-
function patchTimestamp(header, zone) {
|
|
562
|
-
const separator = header?.indexOf(" ") ?? -1;
|
|
563
|
-
if (separator < 0) return void 0;
|
|
564
|
-
let text = header.slice(separator + 1).trim();
|
|
565
|
-
const parts = text.split(" ").filter(Boolean);
|
|
566
|
-
if (zone === "utc" && parts.length === 2) text += " +0000";
|
|
567
|
-
const time = Date.parse(text);
|
|
568
|
-
return Number.isFinite(time) ? time : void 0;
|
|
569
|
-
}
|
|
570
|
-
function quotePatchName(name, style = "shell") {
|
|
571
|
-
const safe = [...name].every((c) => "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_./-".includes(c));
|
|
572
|
-
if (style === "literal" || safe && !["shell-always", "shell-escape-always", "c", "locale", "clocale"].includes(style)) return name;
|
|
573
|
-
if (style === "c" || style === "clocale") return JSON.stringify(name);
|
|
574
|
-
if (style === "locale") return `\u2018${name}\u2019`;
|
|
575
|
-
if (style === "escape") return JSON.stringify(name).slice(1, -1);
|
|
576
|
-
return `'${name.replaceAll("'", "'\\''")}'`;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
export {
|
|
580
|
-
patchCommand
|
|
581
|
-
};
|