just-bash 3.3.0 → 3.4.0
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/CHANGELOG.md +6 -0
- package/dist/bin/chunks/{awk2-7UZLEPVX.js → awk2-DZN2ZRSE.js} +1 -1
- package/dist/bin/{shell/chunks/base64-W6FVFNXJ.js → chunks/base64-TP4NUOEB.js} +1 -1
- package/dist/bin/chunks/{cat-5YECZSFQ.js → cat-A3REFE6L.js} +1 -1
- package/dist/bin/{shell/chunks/chmod-45TMYSW2.js → chunks/chmod-PHPDPTZD.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-DSZQ22OX.js → chunks/chunk-35BSNGJK.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-BWRQ5HYX.js → chunks/chunk-3DCUOX7D.js} +1 -1
- package/dist/bin/chunks/{chunk-OKU677H3.js → chunk-57BWX3A3.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-XAAXPEOP.js → chunks/chunk-62NF3462.js} +1 -1
- package/dist/bin/chunks/{chunk-3OYRDLJJ.js → chunk-6KTOOQK6.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-IJIJAQBT.js → chunks/chunk-6WNZWDBA.js} +1 -1
- package/dist/bin/chunks/{chunk-QK6BXSHU.js → chunk-7NMBLWZ5.js} +1 -1
- package/dist/bin/chunks/{chunk-W4U4QOZF.js → chunk-BPMGKB5E.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-NGD6G5ZG.js → chunks/chunk-BXDEO6VY.js} +1 -1
- package/dist/bin/chunks/{chunk-ZXIW4JPL.js → chunk-DX5LO7JF.js} +1 -1
- package/dist/bin/chunks/{chunk-SSK3N7FN.js → chunk-EJIZDPMG.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-PQPFDJFF.js → chunks/chunk-FC5CC5UP.js} +1 -1
- package/dist/bin/chunks/chunk-FE6GSISP.js +22 -0
- package/dist/bin/{shell/chunks/chunk-VTAIIBJT.js → chunks/chunk-GE5ERIO2.js} +1 -1
- package/dist/bin/chunks/{chunk-KXWWWQZK.js → chunk-GGPUS2B4.js} +1 -1
- package/dist/bin/chunks/{chunk-WWOUFMMY.js → chunk-IHS3YLRI.js} +1 -1
- package/dist/bin/chunks/{chunk-TROO33BG.js → chunk-KHS7PCAP.js} +2 -2
- package/dist/bin/chunks/chunk-KP2UH5CJ.js +22 -0
- package/dist/bin/chunks/{chunk-B7RRNV3A.js → chunk-MLJZPRDV.js} +1 -1
- package/dist/bin/chunks/{chunk-USMDLXMM.js → chunk-MOCKUJD6.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-TPU3OX2A.js → chunks/chunk-NFYXRUSI.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-IAAPXDHN.js → chunks/chunk-NWBQ75GZ.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-D5G3L4PR.js → chunks/chunk-O5R7J45W.js} +1 -1
- package/dist/bin/chunks/{chunk-7I6MNC5I.js → chunk-OD2SHTFL.js} +1 -1
- package/dist/bin/chunks/{chunk-BNYIXXC2.js → chunk-ODCVIRIN.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-NJ67YJRE.js → chunks/chunk-ODPB5AH7.js} +1 -1
- package/dist/bin/chunks/chunk-QUWWWM4E.js +276 -0
- package/dist/bin/chunks/{chunk-XAVWLYZR.js → chunk-ROFYAVPF.js} +1 -1
- package/dist/bin/chunks/chunk-SHAOH2UJ.js +5 -0
- package/dist/bin/chunks/{chunk-PKWK3LQM.js → chunk-SOKKZSUV.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-WSLBBXPJ.js → chunks/chunk-TIYIKCEZ.js} +1 -1
- package/dist/bin/chunks/{chunk-4SQKKW2M.js → chunk-TKBTWIXO.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-VY2K25J4.js → chunks/chunk-TOTKK2XI.js} +1 -1
- package/dist/bin/chunks/{chunk-X63MJBLH.js → chunk-TY77F4UM.js} +1 -1
- package/dist/bin/chunks/{chunk-CB4SODHK.js → chunk-XBX7KFWK.js} +19 -19
- package/dist/bin/{shell/chunks/chunk-GEUCQ4AB.js → chunks/chunk-XG7YUZ3R.js} +1 -1
- package/dist/bin/chunks/chunk-YABXNPH6.js +65 -0
- package/dist/bin/chunks/{chunk-6UK23ZFT.js → chunk-YB3A42T5.js} +1 -1
- package/dist/bin/chunks/{chunk-MZM7RVYU.js → chunk-YBTJPT3R.js} +1 -1
- package/dist/bin/chunks/{chunk-X5VUGFUL.js → chunk-Z7QCL4IA.js} +1 -1
- package/dist/bin/{shell/chunks/expr-56X7LYOS.js → chunks/expr-FAB3XEIB.js} +1 -1
- package/dist/bin/{shell/chunks/file-SQSOBJLR.js → chunks/file-ZHL2YACR.js} +1 -1
- package/dist/bin/chunks/{find-XY2NTAT5.js → find-6DH6TRDN.js} +1 -1
- package/dist/bin/chunks/{flag-coverage-EB3DK32J.js → flag-coverage-SPPGTKG3.js} +1 -1
- package/dist/bin/{shell/chunks/grep-73YHJEX4.js → chunks/grep-FBVRTH4M.js} +1 -1
- package/dist/bin/chunks/{gzip-DJSFJOY6.js → gzip-AWQGRTSF.js} +1 -1
- package/dist/bin/chunks/{head-KPRH4HKC.js → head-A7CPWX7R.js} +1 -1
- package/dist/bin/{shell/chunks/html-to-markdown-WUBAMB4O.js → chunks/html-to-markdown-EMODJ24M.js} +1 -1
- package/dist/bin/chunks/{jq-AO5GTPN4.js → jq-DXL4NMI5.js} +1 -1
- package/dist/bin/chunks/{js-exec-4KNUPGHA.js → js-exec-BFLXGNPQ.js} +1 -1
- package/dist/bin/chunks/{ls-FTHYNINH.js → ls-R6DAGGBH.js} +1 -1
- package/dist/bin/{shell/chunks/od-A7CW5RMS.js → chunks/od-ZPR6FUOW.js} +1 -1
- package/dist/bin/{shell/chunks/paste-YJLYVJMP.js → chunks/paste-RQKXCKQO.js} +1 -1
- package/dist/bin/chunks/{python3-N252MJV6.js → python3-WKVKCO33.js} +1 -1
- package/dist/bin/{shell/chunks/rg-OGGL3RIE.js → chunks/rg-34TWIR7N.js} +1 -1
- package/dist/bin/{shell/chunks/sed-QJ2LNV2N.js → chunks/sed-SW74NKGU.js} +1 -1
- package/dist/bin/chunks/{sleep-FUDWGDCE.js → sleep-J2AVORMB.js} +1 -1
- package/dist/bin/{shell/chunks/split-7IYQYKOW.js → chunks/split-EDDYGW4A.js} +1 -1
- package/dist/bin/chunks/{sqlite3-FEUFATVW.js → sqlite3-AZ27WWV7.js} +1 -1
- package/dist/bin/{shell/chunks/stat-Y5D3VPLG.js → chunks/stat-XNGV2W6W.js} +1 -1
- package/dist/bin/chunks/{tail-QISQLA3I.js → tail-H2WOZSEI.js} +1 -1
- package/dist/bin/chunks/{tar-TB2XWXF6.js → tar-MZP7QXR4.js} +1 -1
- package/dist/bin/{shell/chunks/timeout-TDOV6JDA.js → chunks/timeout-GH6S72QX.js} +1 -1
- package/dist/bin/chunks/{tr-AR6EK7JH.js → tr-RVCBERJ4.js} +1 -1
- package/dist/bin/chunks/undici-CKF2L2IP.js +141 -0
- package/dist/bin/chunks/{xan-Q52EBQYW.js → xan-BSNJF6SH.js} +1 -1
- package/dist/bin/chunks/{xan-view-QGKWT354.js → xan-view-H3LNQ72O.js} +1 -1
- package/dist/bin/chunks/{yq-UA5NX5RT.js → yq-GNMXK6OP.js} +1 -1
- package/dist/bin/just-bash.js +332 -332
- package/dist/bin/shell/chunks/{awk2-7UZLEPVX.js → awk2-DZN2ZRSE.js} +1 -1
- package/dist/bin/{chunks/base64-W6FVFNXJ.js → shell/chunks/base64-TP4NUOEB.js} +1 -1
- package/dist/bin/shell/chunks/{cat-5YECZSFQ.js → cat-A3REFE6L.js} +1 -1
- package/dist/bin/{chunks/chmod-45TMYSW2.js → shell/chunks/chmod-PHPDPTZD.js} +1 -1
- package/dist/bin/{chunks/chunk-DSZQ22OX.js → shell/chunks/chunk-35BSNGJK.js} +1 -1
- package/dist/bin/{chunks/chunk-BWRQ5HYX.js → shell/chunks/chunk-3DCUOX7D.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-OKU677H3.js → chunk-57BWX3A3.js} +1 -1
- package/dist/bin/{chunks/chunk-XAAXPEOP.js → shell/chunks/chunk-62NF3462.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-3OYRDLJJ.js → chunk-6KTOOQK6.js} +1 -1
- package/dist/bin/{chunks/chunk-IJIJAQBT.js → shell/chunks/chunk-6WNZWDBA.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-QK6BXSHU.js → chunk-7NMBLWZ5.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-W4U4QOZF.js → chunk-BPMGKB5E.js} +1 -1
- package/dist/bin/{chunks/chunk-NGD6G5ZG.js → shell/chunks/chunk-BXDEO6VY.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-ZXIW4JPL.js → chunk-DX5LO7JF.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-SSK3N7FN.js → chunk-EJIZDPMG.js} +1 -1
- package/dist/bin/{chunks/chunk-PQPFDJFF.js → shell/chunks/chunk-FC5CC5UP.js} +1 -1
- package/dist/bin/shell/chunks/chunk-FE6GSISP.js +22 -0
- package/dist/bin/{chunks/chunk-VTAIIBJT.js → shell/chunks/chunk-GE5ERIO2.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-KXWWWQZK.js → chunk-GGPUS2B4.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-WWOUFMMY.js → chunk-IHS3YLRI.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-TROO33BG.js → chunk-KHS7PCAP.js} +2 -2
- package/dist/bin/shell/chunks/chunk-KP2UH5CJ.js +22 -0
- package/dist/bin/shell/chunks/{chunk-B7RRNV3A.js → chunk-MLJZPRDV.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-USMDLXMM.js → chunk-MOCKUJD6.js} +1 -1
- package/dist/bin/{chunks/chunk-TPU3OX2A.js → shell/chunks/chunk-NFYXRUSI.js} +1 -1
- package/dist/bin/{chunks/chunk-IAAPXDHN.js → shell/chunks/chunk-NWBQ75GZ.js} +1 -1
- package/dist/bin/{chunks/chunk-D5G3L4PR.js → shell/chunks/chunk-O5R7J45W.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-7I6MNC5I.js → chunk-OD2SHTFL.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-BNYIXXC2.js → chunk-ODCVIRIN.js} +1 -1
- package/dist/bin/{chunks/chunk-NJ67YJRE.js → shell/chunks/chunk-ODPB5AH7.js} +1 -1
- package/dist/bin/shell/chunks/chunk-QUWWWM4E.js +276 -0
- package/dist/bin/shell/chunks/{chunk-XAVWLYZR.js → chunk-ROFYAVPF.js} +1 -1
- package/dist/bin/shell/chunks/chunk-SHAOH2UJ.js +5 -0
- package/dist/bin/shell/chunks/{chunk-PKWK3LQM.js → chunk-SOKKZSUV.js} +1 -1
- package/dist/bin/{chunks/chunk-WSLBBXPJ.js → shell/chunks/chunk-TIYIKCEZ.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-4SQKKW2M.js → chunk-TKBTWIXO.js} +1 -1
- package/dist/bin/{chunks/chunk-VY2K25J4.js → shell/chunks/chunk-TOTKK2XI.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-X63MJBLH.js → chunk-TY77F4UM.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-CB4SODHK.js → chunk-XBX7KFWK.js} +19 -19
- package/dist/bin/{chunks/chunk-GEUCQ4AB.js → shell/chunks/chunk-XG7YUZ3R.js} +1 -1
- package/dist/bin/shell/chunks/chunk-YABXNPH6.js +65 -0
- package/dist/bin/shell/chunks/{chunk-6UK23ZFT.js → chunk-YB3A42T5.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-MZM7RVYU.js → chunk-YBTJPT3R.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-X5VUGFUL.js → chunk-Z7QCL4IA.js} +1 -1
- package/dist/bin/{chunks/expr-56X7LYOS.js → shell/chunks/expr-FAB3XEIB.js} +1 -1
- package/dist/bin/{chunks/file-SQSOBJLR.js → shell/chunks/file-ZHL2YACR.js} +1 -1
- package/dist/bin/shell/chunks/{find-XY2NTAT5.js → find-6DH6TRDN.js} +1 -1
- package/dist/bin/shell/chunks/{flag-coverage-EB3DK32J.js → flag-coverage-SPPGTKG3.js} +1 -1
- package/dist/bin/{chunks/grep-73YHJEX4.js → shell/chunks/grep-FBVRTH4M.js} +1 -1
- package/dist/bin/shell/chunks/{gzip-DJSFJOY6.js → gzip-AWQGRTSF.js} +1 -1
- package/dist/bin/shell/chunks/{head-KPRH4HKC.js → head-A7CPWX7R.js} +1 -1
- package/dist/bin/{chunks/html-to-markdown-WUBAMB4O.js → shell/chunks/html-to-markdown-EMODJ24M.js} +1 -1
- package/dist/bin/shell/chunks/{jq-AO5GTPN4.js → jq-DXL4NMI5.js} +1 -1
- package/dist/bin/shell/chunks/{js-exec-4KNUPGHA.js → js-exec-BFLXGNPQ.js} +1 -1
- package/dist/bin/shell/chunks/{ls-FTHYNINH.js → ls-R6DAGGBH.js} +1 -1
- package/dist/bin/{chunks/od-A7CW5RMS.js → shell/chunks/od-ZPR6FUOW.js} +1 -1
- package/dist/bin/{chunks/paste-YJLYVJMP.js → shell/chunks/paste-RQKXCKQO.js} +1 -1
- package/dist/bin/shell/chunks/{python3-N252MJV6.js → python3-WKVKCO33.js} +1 -1
- package/dist/bin/{chunks/rg-OGGL3RIE.js → shell/chunks/rg-34TWIR7N.js} +1 -1
- package/dist/bin/{chunks/sed-QJ2LNV2N.js → shell/chunks/sed-SW74NKGU.js} +1 -1
- package/dist/bin/shell/chunks/{sleep-FUDWGDCE.js → sleep-J2AVORMB.js} +1 -1
- package/dist/bin/{chunks/split-7IYQYKOW.js → shell/chunks/split-EDDYGW4A.js} +1 -1
- package/dist/bin/shell/chunks/{sqlite3-FEUFATVW.js → sqlite3-AZ27WWV7.js} +1 -1
- package/dist/bin/{chunks/stat-Y5D3VPLG.js → shell/chunks/stat-XNGV2W6W.js} +1 -1
- package/dist/bin/shell/chunks/{tail-QISQLA3I.js → tail-H2WOZSEI.js} +1 -1
- package/dist/bin/shell/chunks/{tar-TB2XWXF6.js → tar-MZP7QXR4.js} +1 -1
- package/dist/bin/{chunks/timeout-TDOV6JDA.js → shell/chunks/timeout-GH6S72QX.js} +1 -1
- package/dist/bin/shell/chunks/{tr-AR6EK7JH.js → tr-RVCBERJ4.js} +1 -1
- package/dist/bin/shell/chunks/undici-CKF2L2IP.js +141 -0
- package/dist/bin/shell/chunks/{xan-Q52EBQYW.js → xan-BSNJF6SH.js} +1 -1
- package/dist/bin/shell/chunks/{xan-view-QGKWT354.js → xan-view-H3LNQ72O.js} +1 -1
- package/dist/bin/shell/chunks/{yq-UA5NX5RT.js → yq-GNMXK6OP.js} +1 -1
- package/dist/bin/shell/shell.js +259 -259
- package/dist/bundle/browser.js +525 -525
- package/dist/bundle/chunks/{awk2-IPNBFNH2.js → awk2-IDCJYLV2.js} +1 -1
- package/dist/bundle/chunks/{base64-OXGTKKDA.js → base64-3XQZ3ADB.js} +1 -1
- package/dist/bundle/chunks/{cat-636HYSH4.js → cat-XWS72C47.js} +1 -1
- package/dist/bundle/chunks/{chmod-4CIOYX5Q.js → chmod-6FVWFWKL.js} +1 -1
- package/dist/bundle/chunks/{chunk-6IUGGJ2Y.js → chunk-264HW33U.js} +1 -1
- package/dist/bundle/chunks/{chunk-LGLR6TFP.js → chunk-2TLWENMK.js} +1 -1
- package/dist/bundle/chunks/{chunk-FBXMKFE2.js → chunk-4HMWZAP7.js} +1 -1
- package/dist/bundle/chunks/{chunk-EAQUR2NP.js → chunk-4MPKG4PJ.js} +1 -1
- package/dist/bundle/chunks/{chunk-LJRVJXUI.js → chunk-4X2R47I5.js} +1 -1
- package/dist/bundle/chunks/{chunk-J5G3ZBEK.js → chunk-5GI2HJYO.js} +1 -1
- package/dist/bundle/chunks/{chunk-PJWSSENQ.js → chunk-6D2ZCRTO.js} +1 -1
- package/dist/bundle/chunks/chunk-6RK4AAB7.js +21 -0
- package/dist/bundle/chunks/{chunk-H3PXMIY3.js → chunk-73DVPW3C.js} +1 -1
- package/dist/bundle/chunks/{chunk-3ZBJCAAR.js → chunk-CA7HMEGG.js} +1 -1
- package/dist/bundle/chunks/{chunk-SELXJ5KQ.js → chunk-CVMQI27W.js} +1 -1
- package/dist/bundle/chunks/{chunk-ORDZCFFT.js → chunk-CYCUGNN7.js} +1 -1
- package/dist/bundle/chunks/{chunk-UB6T3UHL.js → chunk-ENMIHC6G.js} +1 -1
- package/dist/bundle/chunks/{chunk-FHFPWM4W.js → chunk-EVJMYTCY.js} +2 -2
- package/dist/bundle/chunks/{chunk-JYQ6MII2.js → chunk-EZFSCUSP.js} +1 -1
- package/dist/bundle/chunks/{chunk-E3D4WVAH.js → chunk-FFNWVPYL.js} +1 -1
- package/dist/bundle/chunks/{chunk-MF4F4ZPP.js → chunk-GP3D65AC.js} +1 -1
- package/dist/bundle/chunks/{chunk-IHGFM3FN.js → chunk-HZYCWAEC.js} +1 -1
- package/dist/bundle/chunks/{chunk-QTLI5LUD.js → chunk-JQL34RLH.js} +1 -1
- package/dist/bundle/chunks/{chunk-JCPCQREJ.js → chunk-KBXRZGTY.js} +1 -1
- package/dist/bundle/chunks/{chunk-CN3HTJTZ.js → chunk-KESUKNUF.js} +1 -1
- package/dist/bundle/chunks/{chunk-XVL654YD.js → chunk-KVG5FR5F.js} +19 -19
- package/dist/bundle/chunks/{chunk-KKVPMNSS.js → chunk-LDCENVG4.js} +1 -1
- package/dist/bundle/chunks/chunk-M7DIEMEN.js +275 -0
- package/dist/bundle/chunks/{chunk-MAWVZWRK.js → chunk-MMSRUX6V.js} +1 -1
- package/dist/bundle/chunks/{chunk-INHMNORI.js → chunk-MP3NNO6W.js} +1 -1
- package/dist/bundle/chunks/{chunk-AI5LSBJC.js → chunk-QKQP2SCP.js} +1 -1
- package/dist/bundle/chunks/{chunk-OTYP7VVT.js → chunk-QNXJ5FEA.js} +1 -1
- package/dist/bundle/chunks/{chunk-K3XJ2WT4.js → chunk-QXYDKHGI.js} +1 -1
- package/dist/bundle/chunks/chunk-RT7ROXPF.js +4 -0
- package/dist/bundle/chunks/{chunk-LTCWFMCI.js → chunk-TUNYNC46.js} +1 -1
- package/dist/bundle/chunks/{chunk-FC5NW7U4.js → chunk-UGU4ZDZA.js} +1 -1
- package/dist/bundle/chunks/{chunk-D3W7DTI6.js → chunk-VPJHPG6G.js} +1 -1
- package/dist/bundle/chunks/{chunk-5HXWWNWH.js → chunk-VQCA62JK.js} +1 -1
- package/dist/bundle/chunks/{chunk-NNH4ERNJ.js → chunk-W4IV5QW4.js} +1 -1
- package/dist/bundle/chunks/{chunk-3DHFIWMM.js → chunk-XJWBSZIU.js} +1 -1
- package/dist/bundle/chunks/{chunk-VOSNSQE2.js → chunk-XOBSBDA5.js} +1 -1
- package/dist/bundle/chunks/chunk-XW6UBSKO.js +64 -0
- package/dist/bundle/chunks/{chunk-UK4BO5W3.js → chunk-XZZSXYTK.js} +1 -1
- package/dist/bundle/chunks/{expr-SHRJJ4PX.js → expr-VKQHAJNO.js} +1 -1
- package/dist/bundle/chunks/{file-YC4YEI4P.js → file-WGI2QYXG.js} +1 -1
- package/dist/bundle/chunks/{find-DWWMZFO5.js → find-PM3TD7V4.js} +1 -1
- package/dist/bundle/chunks/{flag-coverage-UV7GI2DF.js → flag-coverage-6LWPOTGE.js} +1 -1
- package/dist/bundle/chunks/{grep-UDCQDUQK.js → grep-SAEHL7UZ.js} +1 -1
- package/dist/bundle/chunks/{gzip-BTI6CWY4.js → gzip-2SHFSHNB.js} +1 -1
- package/dist/bundle/chunks/{head-UCOA3VQC.js → head-RMKV5HCV.js} +1 -1
- package/dist/bundle/chunks/{html-to-markdown-NUF6QEX4.js → html-to-markdown-GEKF6U7Z.js} +1 -1
- package/dist/bundle/chunks/{jq-B5324QOX.js → jq-MW2VEOCW.js} +1 -1
- package/dist/bundle/chunks/{js-exec-PNUEDFT5.js → js-exec-J4DLDAWY.js} +1 -1
- package/dist/bundle/chunks/{od-YXD2NNIU.js → od-26HTHXXM.js} +1 -1
- package/dist/bundle/chunks/{paste-ZU3EODNI.js → paste-WIDT5N6N.js} +1 -1
- package/dist/bundle/chunks/{python3-ETPBGJP3.js → python3-4Q7M5CDT.js} +1 -1
- package/dist/bundle/chunks/{rg-XCX2J2RF.js → rg-IA4UE2UF.js} +1 -1
- package/dist/bundle/chunks/{sed-TZIPJOGL.js → sed-LSWWSQ6J.js} +1 -1
- package/dist/bundle/chunks/{sleep-VPYWSKDR.js → sleep-YMKR4HFQ.js} +1 -1
- package/dist/bundle/chunks/{split-KNDNAFPT.js → split-EATPU6Q7.js} +1 -1
- package/dist/bundle/chunks/{sqlite3-ZTQJIC3G.js → sqlite3-XXXHFJGP.js} +1 -1
- package/dist/bundle/chunks/{stat-MLNSW25G.js → stat-AKB6X3TV.js} +1 -1
- package/dist/bundle/chunks/{tail-G3W6PNG3.js → tail-OEM7DTYC.js} +1 -1
- package/dist/bundle/chunks/{tar-GLX6QUHW.js → tar-26DH77YN.js} +1 -1
- package/dist/bundle/chunks/{timeout-SYQCWBMZ.js → timeout-FOKHN3GQ.js} +1 -1
- package/dist/bundle/chunks/{tr-3KPFH3J4.js → tr-VUNRKFC3.js} +1 -1
- package/dist/bundle/chunks/undici-PSPBDOYF.js +140 -0
- package/dist/bundle/chunks/{xan-EGU5VRRP.js → xan-LUEGYXLV.js} +1 -1
- package/dist/bundle/chunks/{xan-view-47P277LZ.js → xan-view-MDMZTFFI.js} +1 -1
- package/dist/bundle/chunks/{yq-FMWLA3S2.js → yq-B7E6UX7Y.js} +1 -1
- package/dist/bundle/index.cjs +885 -900
- package/dist/bundle/index.js +230 -230
- package/dist/types.d.ts +7 -0
- package/package.json +21 -21
- package/dist/bin/chunks/chunk-46CDVHZ3.js +0 -5
- package/dist/bin/chunks/chunk-D3MUBZ4P.js +0 -65
- package/dist/bin/chunks/chunk-DKIOFM35.js +0 -291
- package/dist/bin/chunks/chunk-LGERQ5TD.js +0 -22
- package/dist/bin/chunks/chunk-LNFTLSWJ.js +0 -22
- package/dist/bin/chunks/undici-JES22UVU.js +0 -141
- package/dist/bin/shell/chunks/chunk-46CDVHZ3.js +0 -5
- package/dist/bin/shell/chunks/chunk-D3MUBZ4P.js +0 -65
- package/dist/bin/shell/chunks/chunk-DKIOFM35.js +0 -291
- package/dist/bin/shell/chunks/chunk-LGERQ5TD.js +0 -22
- package/dist/bin/shell/chunks/chunk-LNFTLSWJ.js +0 -22
- package/dist/bin/shell/chunks/undici-JES22UVU.js +0 -141
- package/dist/bundle/chunks/chunk-EZDB7TGH.js +0 -290
- package/dist/bundle/chunks/chunk-T2RHALUC.js +0 -64
- package/dist/bundle/chunks/chunk-UBTKJ6MG.js +0 -4
- package/dist/bundle/chunks/chunk-Y3DGIAIG.js +0 -21
- package/dist/bundle/chunks/undici-HCLAUJT3.js +0 -140
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{d as ut}from"./chunk-CPTQXTBJ.js";import{d as Q}from"./chunk-H4BRFPKY.js";import{l as Y,m as lt}from"./chunk-LCP3IKI7.js";import{a as I}from"./chunk-CPKBPQ2C.js";import{a as ft}from"./chunk-NE4R2FVV.js";import{a as ct,b as ht}from"./chunk-MUFNRCMY.js";var tt=(i,t,e)=>{let s=i instanceof RegExp?pt(i,e):i,n=t instanceof RegExp?pt(t,e):t,r=s!==null&&n!=null&&Lt(s,n,e);return r&&{start:r[0],end:r[1],pre:e.slice(0,r[0]),body:e.slice(r[0]+s.length,r[1]),post:e.slice(r[1]+n.length)}},pt=(i,t)=>{let e=t.match(i);return e?e[0]:null},Lt=(i,t,e)=>{let s,n,r,o,a,l=e.indexOf(i),c=e.indexOf(t,l+1),u=l;if(l>=0&&c>0){if(i===t)return[l,c];for(s=[],r=e.length;u>=0&&!a;){if(u===l)s.push(u),l=e.indexOf(i,u+1);else if(s.length===1){let p=s.pop();p!==void 0&&(a=[p,c])}else n=s.pop(),n!==void 0&&n<r&&(r=n,o=c),c=e.indexOf(t,u+1);u=l<c&&l>=0?l:c}s.length&&o!==void 0&&(a=[r,o])}return a};var dt="\0SLASH"+Math.random()+"\0",gt="\0OPEN"+Math.random()+"\0",nt="\0CLOSE"+Math.random()+"\0",mt="\0COMMA"+Math.random()+"\0",yt="\0PERIOD"+Math.random()+"\0",_t=new RegExp(dt,"g"),Gt=new RegExp(gt,"g"),Bt=new RegExp(nt,"g"),Ft=new RegExp(mt,"g"),Ht=new RegExp(yt,"g"),qt=/\\\\/g,Jt=/\\{/g,Ut=/\\}/g,Xt=/\\,/g,Zt=/\\\./g,Kt=1e5,Vt=4e6;function et(i){return isNaN(i)?i.charCodeAt(0):parseInt(i,10)}function It(i){return i.replace(qt,dt).replace(Jt,gt).replace(Ut,nt).replace(Xt,mt).replace(Zt,yt)}function Yt(i){return i.replace(_t,"\\").replace(Gt,"{").replace(Bt,"}").replace(Ft,",").replace(Ht,".")}function wt(i){if(!i)return[""];let t=[],e=tt("{","}",i);if(!e)return i.split(",");let{pre:s,body:n,post:r}=e,o=s.split(",");o[o.length-1]+="{"+n+"}";let a=wt(r);return r.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}function St(i,t={}){if(!i)return[];let{max:e=Kt,maxLength:s=Vt}=t;return i.slice(0,2)==="{}"&&(i="\\{\\}"+i.slice(2)),st(It(i),e,s,!0).map(Yt)}function Qt(i){return"{"+i+"}"}function te(i){return/^-?0\d/.test(i)}function ee(i,t){return i<=t}function se(i,t){return i>=t}function H(i,t,e,s,n,r){let o=[],a=0;for(let l=0;l<i.length;l++)for(let c=0;c<e.length;c++){if(o.length>=s)return o;let u=i[l]+t+e[c];if(!(r&&!u)){if(a+u.length>n)return o;o.push(u),a+=u.length}}return o}function ne(i,t,e,s){let n=i.split(/\.\./),r=[];if(n[0]===void 0||n[1]===void 0)return r;let o=et(n[0]),a=et(n[1]),l=Math.max(n[0].length,n[1].length),c=n.length===3&&n[2]!==void 0?Math.max(Math.abs(et(n[2])),1):1,u=ee;a<o&&(c*=-1,u=se);let d=n.some(te),g=0;for(let f=o;u(f,a)&&r.length<e;f+=c){let h;if(t)h=String.fromCharCode(f),h==="\\"&&(h="");else if(h=String(f),d){let y=l-h.length;if(y>0){let m=new Array(y+1).join("0");f<0?h="-"+m+h.slice(1):h=m+h}}if(g+h.length>s)break;r.push(h),g+=h.length}return r}function st(i,t,e,s){let n=[""],r=!1,o=!0;for(;;){let a=tt("{","}",i);if(!a)return H(n,i,[""],t,e,r);let l=a.pre;if(/\$$/.test(l)){if(n=H(n,l+"{"+a.body+"}",[""],t,e,r&&!a.post.length),o=!1,!a.post.length)break;i=a.post;continue}let c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),p=c||u,d=a.body.indexOf(",")>=0;if(!p&&!d){if(a.post.match(/,(?!,).*\}/)){i=a.pre+"{"+a.body+nt+a.post,s=!0;continue}return H(n,l+"{"+a.body+"}"+a.post,[""],t,e,r)}o&&(r=s&&!p,o=!1);let g;if(p)g=ne(a.body,u,t,e);else{let f=wt(a.body);if(f.length===1&&f[0]!==void 0&&(f=st(f[0],t,e,!1).map(Qt),f.length===1)){if(n=H(n,l+f[0],[""],t,e,r&&!a.post.length),!a.post.length)break;i=a.post;continue}let h=r&&!a.post.length&&!l;for(let m=0;h&&m<n.length;m++)n[m]&&(h=!1);g=[];let y=0;t:for(let m=0;m<f.length;m++){let b=st(f[m],t,e,!1);for(let E=0;E<b.length;E++){let S=b[E];if(!(h&&!S)){if(g.length>=t||y+S.length>e)break t;g.push(S),y+=S.length}}}}if(n=H(n,l,g,t,e,r&&!a.post.length),!a.post.length)break;i=a.post}return n}var q=i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>65536)throw new TypeError("pattern is too long")};var ie={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},J=i=>i.replace(/[[\]\\-]/g,"\\$&"),re=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),bt=i=>i.join(""),$t=(i,t)=>{let e=t;if(i.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],n=[],r=e+1,o=!1,a=!1,l=!1,c=!1,u=e,p="";t:for(;r<i.length;){let h=i.charAt(r);if((h==="!"||h==="^")&&r===e+1){c=!0,r++;continue}if(h==="]"&&o&&!l){u=r+1;break}if(o=!0,h==="\\"&&!l){l=!0,r++;continue}if(h==="["&&!l){for(let[y,[m,b,E]]of Object.entries(ie))if(i.startsWith(y,r)){if(p)return["$.",!1,i.length-e,!0];r+=y.length,E?n.push(m):s.push(m),a=a||b;continue t}}if(l=!1,p){h>p?s.push(J(p)+"-"+J(h)):h===p&&s.push(J(h)),p="",r++;continue}if(i.startsWith("-]",r+1)){s.push(J(h+"-")),r+=2;continue}if(i.startsWith("-",r+1)){p=h,r+=2;continue}s.push(J(h)),r++}if(u<r)return["",!1,0,!1];if(!s.length&&!n.length)return["$.",!1,i.length-e,!0];if(n.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!c){let h=s[0].length===2?s[0].slice(-1):s[0];return[re(h),!1,u-e,!1]}let d="["+(c?"^":"")+bt(s)+"]",g="["+(c?"":"^")+bt(n)+"]";return[s.length&&n.length?"("+d+"|"+g+")":s.length?d:g,a,u-e,!0]};var k=(i,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?i.replace(/\[([^/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?i.replace(/\[([^/\\{}])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");var R,oe=new Set(["!","?","+","*","@"]),it=i=>oe.has(i),Et=i=>it(i.type),ae=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),le=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),ce=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Mt=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),he="(?!(?:^|/)\\.\\.?(?:$|/))",Z="(?!\\.)",fe=new Set(["[","."]),ue=new Set(["..","."]),pe=new Set("().*{}+?[]^$\\!"),de=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),rt="[^/]",At=rt+"*?",xt=rt+"+?",ge=0,_=class{type;#s;#n;#i=!1;#t=[];#e;#a;#c;#l=!1;#r;#o;#h=!1;id=++ge;get depth(){return(this.#e?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#s.id,parent:this.#e?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,e,s={}){this.type=t,t&&(this.#n=!0),this.#e=e,this.#s=this.#e?this.#e.#s:this,this.#r=this.#s===this?s:this.#s.#r,this.#c=this.#s===this?[]:this.#s.#c,t==="!"&&!this.#s.#l&&this.#c.push(this),this.#a=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#y(){if(this!==this.#s)throw new Error("should only call on root");if(this.#l)return this;this.toString(),this.#l=!0;let t;for(;t=this.#c.pop();){if(t.type!=="!")continue;let e=t,s=e.#e;for(;s;){for(let n=e.#a+1;!s.type&&n<s.#t.length;n++)for(let r of t.#t){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(s.#t[n])}e=s,s=e.#e}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof R&&e.#e===this))throw new Error("invalid part: "+e);this.#t.push(e)}}toJSON(){let t=this.type===null?this.#t.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#t.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#s||this.#s.#l&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#s===this)return!0;if(!this.#e?.isStart())return!1;if(this.#a===0)return!0;let t=this.#e;for(let e=0;e<this.#a;e++){let s=t.#t[e];if(!(s instanceof R&&s.type==="!"))return!1}return!0}isEnd(){if(this.#s===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();let t=this.#e?this.#e.#t.length:0;return this.#a===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new R(this.type,t);for(let s of this.#t)e.copyIn(s);return e}static#f(t,e,s,n,r){let o=n.maxExtglobRecursion??2,a=!1,l=!1,c=-1,u=!1;if(e.type===null){let h=s,y="";for(;h<t.length;){let m=t.charAt(h++);if(a||m==="\\"){a=!a,y+=m;continue}if(l){h===c+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(h===c+2&&u)&&(l=!1),y+=m;continue}else if(m==="["){l=!0,c=h,u=!1,y+=m;continue}if(!n.noext&&it(m)&&t.charAt(h)==="("&&r<=o){e.push(y),y="";let E=new R(m,e);h=R.#f(t,E,h,n,r+1),e.push(E);continue}y+=m}return e.push(y),h}let p=s+1,d=new R(null,e),g=[],f="";for(;p<t.length;){let h=t.charAt(p++);if(a||h==="\\"){a=!a,f+=h;continue}if(l){p===c+1?(h==="^"||h==="!")&&(u=!0):h==="]"&&!(p===c+2&&u)&&(l=!1),f+=h;continue}else if(h==="["){l=!0,c=p,u=!1,f+=h;continue}if(!n.noext&&it(h)&&t.charAt(p)==="("&&(r<=o||e&&e.#u(h))){let m=e&&e.#u(h)?0:1;d.push(f),f="";let b=new R(h,d);d.push(b),p=R.#f(t,b,p,n,r+m);continue}if(h==="|"){d.push(f),f="",g.push(d),d=new R(null,e);continue}if(h===")")return f===""&&e.#t.length===0&&(e.#h=!0),d.push(f),f="",e.push(...g,d),p;f+=h}return e.type=null,e.#n=void 0,e.#t=[t.substring(s-1)],p}#w(t){return this.#d(t,le)}#d(t,e=ae){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let s=t.#t[0];return!s||typeof s!="object"||s.type===null?!1:this.#u(s.type,e)}#u(t,e=ce){return!!e.get(this.type)?.includes(t)}#S(t,e){let s=t.#t[0],n=new R(null,s,this.options);n.#t.push(""),s.push(n),this.#g(t,e)}#g(t,e){let s=t.#t[0];this.#t.splice(e,1,...s.#t);for(let n of s.#t)typeof n=="object"&&(n.#e=this);this.#o=void 0}#b(t){return!!Mt.get(this.type)?.has(t)}#$(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let e=t.#t[0];return!e||typeof e!="object"||e.type===null?!1:this.#b(e.type)}#E(t){let e=Mt.get(this.type),s=t.#t[0],n=e?.get(s.type);if(!n)return!1;this.#t=s.#t;for(let r of this.#t)typeof r=="object"&&(r.#e=this);this.type=n,this.#o=void 0,this.#h=!1}static fromGlob(t,e={}){let s=new R(null,void 0,e);return R.#f(t,s,0,e,0),s}toMMPattern(){if(this!==this.#s)return this.#s.toMMPattern();let t=this.toString(),[e,s,n,r]=this.toRegExpSource();if(!(n||this.#n||this.#r.nocase&&!this.#r.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let a=(this.#r.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,a),{_src:e,_glob:t})}get options(){return this.#r}toRegExpSource(t){let e=t??!!this.#r.dot;if(this.#s===this&&(this.#p(),this.#y()),!Et(this)){let l=this.isStart()&&this.isEnd()&&!this.#t.some(g=>typeof g!="string"),c=this.#t.map(g=>{let[f,h,y,m]=typeof g=="string"?R.#M(g,this.#n,l):g.toRegExpSource(t);return this.#n=this.#n||y,this.#i=this.#i||m,f}).join(""),u="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&ue.has(this.#t[0]))){let f=fe,h=e&&f.has(c.charAt(0))||c.startsWith("\\.")&&f.has(c.charAt(2))||c.startsWith("\\.\\.")&&f.has(c.charAt(4)),y=!e&&!t&&f.has(c.charAt(0));u=h?he:y?Z:""}let p="";return this.isEnd()&&this.#s.#l&&this.#e?.type==="!"&&(p="(?:$|\\/)"),[u+c+p,k(c),this.#n=!!this.#n,this.#i]}let s=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:",r=this.#m(e);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){let l=this.toString(),c=this;return c.#t=[l],c.type=null,c.#n=void 0,[l,k(this.toString()),!1,!1]}let o=!s||t||e||!Z?"":this.#m(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let a="";if(this.type==="!"&&this.#h)a=(this.isStart()&&!e?Z:"")+xt;else{let l=this.type==="!"?"))"+(this.isStart()&&!e&&!t?Z:"")+At+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=n+r+l}return[a,k(r),this.#n=!!this.#n,this.#i]}#p(){if(Et(this)){let t=0,e=!1;do{e=!0;for(let s=0;s<this.#t.length;s++){let n=this.#t[s];typeof n=="object"&&(n.#p(),this.#d(n)?(e=!1,this.#g(n,s)):this.#w(n)?(e=!1,this.#S(n,s)):this.#$(n)&&(e=!1,this.#E(n)))}}while(!e&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#p();this.#o=void 0}#m(t){return this.#t.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,n,r,o]=e.toRegExpSource(t);return this.#i=this.#i||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#M(t,e,s=!1){let n=!1,r="",o=!1,a=!1;for(let l=0;l<t.length;l++){let c=t.charAt(l);if(n){n=!1,r+=(pe.has(c)?"\\":"")+c;continue}if(c==="*"){if(a)continue;a=!0,r+=s&&/^[*]+$/.test(t)?xt:At,e=!0;continue}else a=!1;if(c==="\\"){l===t.length-1?r+="\\\\":n=!0;continue}if(c==="["){let[u,p,d,g]=$t(t,l);if(d){r+=u,o=o||p,l+=d-1,e=e||g;continue}}if(c==="?"){r+=rt,e=!0;continue}r+=de(c)}return[r,k(t),!!e,o]}};R=_;var ot=(i,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?i.replace(/[?*()[\]{}]/g,"[$&]"):i.replace(/[?*()[\]\\{}]/g,"\\$&"):t?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&");var T=(i,t,e={})=>(q(t),!e.nocomment&&t.charAt(0)==="#"?!1:new F(t,e).match(i)),me=/^\*+([^+@!?*[(]*)$/,ye=i=>t=>!t.startsWith(".")&&t.endsWith(i),we=i=>t=>t.endsWith(i),Se=i=>(i=i.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(i)),be=i=>(i=i.toLowerCase(),t=>t.toLowerCase().endsWith(i)),$e=/^\*+\.\*+$/,Ee=i=>!i.startsWith(".")&&i.includes("."),Me=i=>i!=="."&&i!==".."&&i.includes("."),Ae=/^\.\*+$/,xe=i=>i!=="."&&i!==".."&&i.startsWith("."),Pe=/^\*+$/,Te=i=>i.length!==0&&!i.startsWith("."),ve=i=>i.length!==0&&i!=="."&&i!=="..",Ne=/^\?+([^+@!?*[(]*)?$/,Oe=([i,t=""])=>{let e=vt([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Re=([i,t=""])=>{let e=Nt([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},ze=([i,t=""])=>{let e=Nt([i]);return t?s=>e(s)&&s.endsWith(t):e},Ce=([i,t=""])=>{let e=vt([i]);return t?s=>e(s)&&s.endsWith(t):e},vt=([i])=>{let t=i.length;return e=>e.length===t&&!e.startsWith(".")},Nt=([i])=>{let t=i.length;return e=>e.length===t&&e!=="."&&e!==".."},Ot=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Pt={win32:{sep:"\\"},posix:{sep:"/"}},We=Ot==="win32"?Pt.win32.sep:Pt.posix.sep;T.sep=We;var O=Symbol("globstar **");T.GLOBSTAR=O;var De="[^/]",je=De+"*?",ke="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Le="(?:(?!(?:\\/|^)\\.).)*?",_e=(i,t={})=>e=>T(e,i,t);T.filter=_e;var C=(i,t={})=>Object.assign({},i,t),Ge=i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return T;let t=T;return Object.assign((s,n,r={})=>t(s,n,C(i,r)),{Minimatch:class extends t.Minimatch{constructor(n,r={}){super(n,C(i,r))}static defaults(n){return t.defaults(C(i,n)).Minimatch}},AST:class extends t.AST{constructor(n,r,o={}){super(n,r,C(i,o))}static fromGlob(n,r={}){return t.AST.fromGlob(n,C(i,r))}},unescape:(s,n={})=>t.unescape(s,C(i,n)),escape:(s,n={})=>t.escape(s,C(i,n)),filter:(s,n={})=>t.filter(s,C(i,n)),defaults:s=>t.defaults(C(i,s)),makeRe:(s,n={})=>t.makeRe(s,C(i,n)),braceExpand:(s,n={})=>t.braceExpand(s,C(i,n)),match:(s,n,r={})=>t.match(s,n,C(i,r)),sep:t.sep,GLOBSTAR:O})};T.defaults=Ge;var Rt=(i,t={})=>(q(i),t.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:St(i,{max:t.braceExpandMax}));T.braceExpand=Rt;var Be=(i,t={})=>new F(i,t).makeRe();T.makeRe=Be;var Fe=(i,t,e={})=>{let s=new F(t,e);return i=i.filter(n=>s.match(n)),s.options.nonull&&!i.length&&i.push(t),i};T.match=Fe;var Tt=/[?*]|[+@!]\(.*?\)|\[|\]/,He=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),F=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,e={}){q(t),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=t,this.platform=e.platform||Ot,this.isWindows=this.platform==="win32";let s="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[s]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let n=this.globParts.map((r,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=r[0]===""&&r[1]===""&&(r[2]==="?"||!Tt.test(r[2]))&&!Tt.test(r[3]),c=/^[a-z]:/i.test(r[0]);if(l)return[...r.slice(0,4),...r.slice(4).map(u=>this.parse(u))];if(c)return[r[0],...r.slice(1).map(u=>this.parse(u))]}return r.map(l=>this.parse(l))});if(this.debug(this.pattern,n),this.set=n.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s of t)for(let n=0;n<s.length;n++)s[n]==="**"&&(s[n]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let n=s;for(;e[n+1]==="**";)n++;n!==s&&e.splice(s,n-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,n)=>{let r=s[s.length-1];return n==="**"&&r==="**"?s:n===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(s.pop(),s):(s.push(n),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){let r=t[n];n===1&&r===""&&t[0]===""||(r==="."||r==="")&&(e=!0,t.splice(n,1),n--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let n=t[s-1];n&&n!=="."&&n!==".."&&n!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(n))&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let n=-1;for(;(n=s.indexOf("**",n+1))!==-1;){let o=n;for(;s[o+1]==="**";)o++;o>n&&s.splice(n+1,o-n);let a=s[n+1],l=s[n+2],c=s[n+3];if(a!==".."||!l||l==="."||l===".."||!c||c==="."||c==="..")continue;e=!0,s.splice(n,1);let u=s.slice(0);u[n]="**",t.push(u),n--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let a=s[o];o===1&&a===""&&s[0]===""||(a==="."||a==="")&&(e=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let r=0;for(;(r=s.indexOf("..",r+1))!==-1;){let o=s[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let l=r===1&&s[r+1]==="**"?["."]:[];s.splice(r-1,2,...l),s.length===0&&s.push(""),r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let n=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(n){t[e]=[],t[s]=n;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let n=0,r=0,o=[],a="";for(;n<t.length&&r<e.length;)if(t[n]===e[r])o.push(a==="b"?e[r]:t[n]),n++,r++;else if(s&&t[n]==="**"&&e[r]===t[n+1])o.push(t[n]),n++;else if(s&&e[r]==="**"&&t[n]===e[r+1])o.push(e[r]),r++;else if(t[n]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(a==="b")return!1;a="a",o.push(t[n]),n++,r++}else if(e[r]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(a==="a")return!1;a="b",o.push(e[r]),n++,r++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let n=0;n<t.length&&t.charAt(n)==="!";n++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let n=0,r=0;if(this.isWindows){let a=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),l=!a&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),u=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),p=l?3:a?0:void 0,d=u?3:c?0:void 0;if(typeof p=="number"&&typeof d=="number"){let[g,f]=[t[p],e[d]];g.toLowerCase()===f.toLowerCase()&&(e[d]=g,r=d,n=p)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),e.includes(O)?this.#s(t,e,s,n,r):this.#i(t,e,s,n,r)}#s(t,e,s,n,r){let o=e.indexOf(O,r),a=e.lastIndexOf(O),[l,c,u]=s?[e.slice(r,o),e.slice(o+1),[]]:[e.slice(r,o),e.slice(o+1,a),e.slice(a+1)];if(l.length){let b=t.slice(n,n+l.length);if(!this.#i(b,l,s,0,0))return!1;n+=l.length,r+=l.length}let p=0;if(u.length){if(u.length+n>t.length)return!1;let b=t.length-u.length;if(this.#i(t,u,s,b,0))p=u.length;else{if(t[t.length-1]!==""||n+u.length===t.length||(b--,!this.#i(t,u,s,b,0)))return!1;p=u.length+1}}if(!c.length){let b=!!p;for(let E=n;E<t.length-p;E++){let S=String(t[E]);if(b=!0,S==="."||S===".."||!this.options.dot&&S.startsWith("."))return!1}return s||b}let d=[[[],0]],g=d[0],f=0,h=[0];for(let b of c)b===O?(h.push(f),g=[[],0],d.push(g)):(g[0].push(b),f++);let y=d.length-1,m=t.length-p;for(let b of d)b[1]=m-(h[y--]+b[0].length);return!!this.#n(t,d,n,0,s,0,!!p)}#n(t,e,s,n,r,o,a){let l=e[n];if(!l){for(let p=s;p<t.length;p++){a=!0;let d=t[p];if(d==="."||d===".."||!this.options.dot&&d.startsWith("."))return!1}return a}let[c,u]=l;for(;s<=u;){if(this.#i(t.slice(0,s+c.length),c,r,s,0)&&o<this.maxGlobstarRecursion){let g=this.#n(t,e,s+c.length,n+1,r,o+1,a);if(g!==!1)return g}let d=t[s];if(d==="."||d===".."||!this.options.dot&&d.startsWith("."))return!1;s++}return r||null}#i(t,e,s,n,r){let o,a,l,c;for(o=n,a=r,c=t.length,l=e.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");let u=e[a],p=t[o];if(this.debug(e,u,p),u===!1||u===O)return!1;let d;if(typeof u=="string"?(d=p===u,this.debug("string match",u,p,d)):(d=u.test(p),this.debug("pattern match",u,p,d)),!d)return!1}if(o===c&&a===l)return!0;if(o===c)return s;if(a===l)return o===c-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return Rt(this.pattern,this.options)}parse(t){q(t);let e=this.options;if(t==="**")return O;if(t==="")return"";let s,n=null;(s=t.match(Pe))?n=e.dot?ve:Te:(s=t.match(me))?n=(e.nocase?e.dot?be:Se:e.dot?we:ye)(s[1]):(s=t.match(Ne))?n=(e.nocase?e.dot?Re:Oe:e.dot?ze:Ce)(s):(s=t.match($e))?n=e.dot?Me:Ee:(s=t.match(Ae))&&(n=xe);let r=_.fromGlob(t,this.options).toMMPattern();return n&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:n}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?je:e.dot?ke:Le,n=new Set(e.nocase?["i"]:[]),r=t.map(l=>{let c=l.map(p=>{if(p instanceof RegExp)for(let d of p.flags.split(""))n.add(d);return typeof p=="string"?He(p):p===O?O:p._src});c.forEach((p,d)=>{let g=c[d+1],f=c[d-1];p!==O||f===O||(f===void 0?g!==void 0&&g!==O?c[d+1]="(?:\\/|"+s+"\\/)?"+g:c[d]=s:g===void 0?c[d-1]=f+"(?:\\/|\\/"+s+")?":g!==O&&(c[d-1]=f+"(?:\\/|\\/"+s+"\\/)"+g,c[d+1]=O))});let u=c.filter(p=>p!==O);if(this.partial&&u.length>=1){let p=[];for(let d=1;d<=u.length;d++)p.push(u.slice(0,d).join("/"));return"(?:"+p.join("|")+")"}return u.join("/")}).join("|"),[o,a]=t.length>1?["(?:",")"]:["",""];r="^"+o+r+a+"$",this.partial&&(r="^(?:\\/|"+o+r.slice(1,-1)+a+")$"),this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...n].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let n=this.slashSplit(t);this.debug(this.pattern,"split",n);let r=this.set;this.debug(this.pattern,"set",r);let o=n[n.length-1];if(!o)for(let a=n.length-2;!o&&a>=0;a--)o=n[a];for(let a of r){let l=n;if(s.matchBase&&a.length===1&&(l=[o]),this.matchOne(l,a,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return T.defaults(t).Minimatch}};T.AST=_;T.Minimatch=F;T.escape=ot;T.unescape=k;function N(i,t,e){if(I(e)>i.limits.maxOutputSize-I(t))throw new Y(`ls: output size limit exceeded (${i.limits.maxOutputSize} bytes)`,"output_size");return t+e}function U(i,t){let e=new ut(i.limits.maxOutputSize,"ls");for(let s=0;s<t.length;s++)s>0&&e.append(`
|
|
4
|
+
`),e.append(t[s]);return t.length>0&&e.append(`
|
|
5
|
+
`),e.build()}function K(i){if(i<1024)return String(i);if(i<1024*1024){let e=i/1024;return e<10?`${e.toFixed(1)}K`:`${Math.round(e)}K`}if(i<1024*1024*1024){let e=i/1048576;return e<10?`${e.toFixed(1)}M`:`${Math.round(e)}M`}let t=i/(1024*1024*1024);return t<10?`${t.toFixed(1)}G`:`${Math.round(t)}G`}function V(i){let e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][i.getMonth()],s=String(i.getDate()).padStart(2," "),n=new Date,r=new Date(n.getTime()-4320*60*60*1e3);if(i>r){let a=String(i.getHours()).padStart(2,"0"),l=String(i.getMinutes()).padStart(2,"0");return`${e} ${s} ${a}:${l}`}let o=i.getFullYear();return`${e} ${s} ${o}`}function G(i){return i.isDirectory?"/":i.isSymbolicLink?"@":(i.mode&73)!==0?"*":""}var qe={name:"ls",summary:"list directory contents",usage:"ls [OPTION]... [FILE]...",options:["-a, --all do not ignore entries starting with .","-A, --almost-all do not list . and ..","-d, --directory list directories themselves, not their contents","-F, --classify append indicator (one of */=>@) to entries","-h, --human-readable with -l, print sizes like 1K 234M 2G etc.","-l use a long listing format","-r, --reverse reverse order while sorting","-R, --recursive list subdirectories recursively","-S sort by file size, largest first","-t sort by time, newest first","-1 list one file per line"," --help display this help and exit"]},Je={showAll:{short:"a",long:"all",type:"boolean"},showAlmostAll:{short:"A",long:"almost-all",type:"boolean"},longFormat:{short:"l",type:"boolean"},humanReadable:{short:"h",long:"human-readable",type:"boolean"},recursive:{short:"R",long:"recursive",type:"boolean"},reverse:{short:"r",long:"reverse",type:"boolean"},sortBySize:{short:"S",type:"boolean"},classifyFiles:{short:"F",long:"classify",type:"boolean"},directoryOnly:{short:"d",long:"directory",type:"boolean"},sortByTime:{short:"t",type:"boolean"},onePerLine:{short:"1",type:"boolean"}},Es={name:"ls",async execute(i,t){if(ht(i))return ct(qe);let e=ft("ls",i,Je);if(!e.ok)return e.error;let s=e.result.flags.showAll,n=e.result.flags.showAlmostAll,r=e.result.flags.longFormat,o=e.result.flags.humanReadable,a=e.result.flags.recursive,l=e.result.flags.reverse,c=e.result.flags.sortBySize,u=e.result.flags.classifyFiles,p=e.result.flags.directoryOnly,d=e.result.flags.sortByTime;e.result.flags.onePerLine;let g=e.result.positional;g.length===0&&g.push(".");let f="",h="",y=0,m=new Q({limits:t.limits,signal:t.signal,executionScope:t.executionScope,site:"ls"});for(let b=0;b<g.length;b++){let E=g[b];if(b>0&&f&&!f.endsWith(`
|
|
6
|
+
|
|
7
|
+
`)&&(f=N(t,f,`
|
|
8
|
+
`)),p){let S=t.fs.resolvePath(t.cwd,E);try{let A=await t.fs.stat(S);if(r){let D=A.isDirectory?"drwxr-xr-x":"-rw-r--r--",B=u?G(await t.fs.lstat(S)):A.isDirectory?"/":"",x=A.size??0,M=o?K(x).padStart(5):String(x).padStart(5),P=A.mtime??new Date(0),w=V(P);f=N(t,f,`${D} 1 user user ${M} ${w} ${E}${B}
|
|
9
|
+
`)}else{let D=u?G(await t.fs.lstat(S)):"";f=N(t,f,`${E}${D}
|
|
10
|
+
`)}}catch{h=N(t,h,`ls: cannot access '${E}': No such file or directory
|
|
11
|
+
`),y=2}continue}if(E.includes("*")||E.includes("?")||E.includes("[")){let S=await Ue(E,t,s,n,r,l,o,c,u,m);f=N(t,f,S.stdout),h=N(t,h,S.stderr),S.exitCode!==0&&(y=S.exitCode)}else{let S=await zt(E,t,s,n,r,a,g.length>1,l,o,c,u,!1,m,0,new Set);f=N(t,f,S.stdout),h=N(t,h,S.stderr),S.exitCode!==0&&(y=S.exitCode)}}return{stdout:f,stderr:h,exitCode:y}}};async function Ue(i,t,e,s,n,r=!1,o=!1,a=!1,l=!1,c){let u=e||s,p=t.fs.getAllPaths(),d=t.fs.resolvePath(t.cwd,"."),g=[];for(let f of p){c?.visit(f.split("/").length-1);let y=(f===d||d==="/"||f.startsWith(`${d}/`))&&f.slice(d==="/"?1:d.length+1)||f;if(T(y,i)||T(f,i)){let m=y.split("/").pop()||y;if(!u&&m.startsWith("."))continue;g.push(y||f)}}if(g.length===0)return{stdout:"",stderr:`ls: ${i}: No such file or directory
|
|
12
|
+
`,exitCode:2};if(a){let f=[];for(let h of g){let y=t.fs.resolvePath(t.cwd,h);try{let m=await t.fs.stat(y);f.push({path:h,size:m.size??0})}catch{f.push({path:h,size:0})}}f.sort((h,y)=>y.size-h.size),g.length=0,g.push(...f.map(h=>h.path))}else g.sort();if(r&&g.reverse(),n){let f=[];for(let h of g){let y=t.fs.resolvePath(t.cwd,h);try{let m=await t.fs.stat(y),b=m.isDirectory?"drwxr-xr-x":"-rw-r--r--",E=l?G(await t.fs.lstat(y)):m.isDirectory?"/":"",S=m.size??0,A=o?K(S).padStart(5):String(S).padStart(5),D=m.mtime??new Date(0),B=V(D);f.push(`${b} 1 user user ${A} ${B} ${h}${E}`)}catch{f.push(`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${h}`)}}return{stdout:U(t,f),stderr:"",exitCode:0}}if(l){let f=[];for(let h of g){let y=t.fs.resolvePath(t.cwd,h);try{let m=await t.fs.lstat(y);f.push(`${h}${G(m)}`)}catch{f.push(h)}}return{stdout:U(t,f),stderr:"",exitCode:0}}return{stdout:U(t,g),stderr:"",exitCode:0}}async function zt(i,t,e,s,n,r,o,a=!1,l=!1,c=!1,u=!1,p=!1,d=new Q({limits:t.limits,signal:t.signal,executionScope:t.executionScope,site:"ls"}),g=0,f=new Set){let h=e||s,y=t.fs.resolvePath(t.cwd,i);try{d.visit(g);let m=await t.fs.stat(y);if(!m.isDirectory){let x=u?G(await t.fs.lstat(y)):"";if(n){let M=m.size??0,P=l?K(M).padStart(5):String(M).padStart(5),w=m.mtime??new Date(0),$=V(w);return{stdout:`-rw-r--r-- 1 user user ${P} ${$} ${i}${x}
|
|
13
|
+
`,stderr:"",exitCode:0}}return{stdout:`${i}${x}
|
|
14
|
+
`,stderr:"",exitCode:0}}let b=m.identity??(m.dev!==void 0&&m.ino!==void 0?`${String(m.dev)}:${String(m.ino)}`:await t.fs.realpath(y).catch(()=>{}));if(b!==void 0&&f.has(b))return{stdout:"",stderr:`ls: ${i}: symbolic link cycle detected
|
|
15
|
+
`,exitCode:2};let E=new Set(f);b!==void 0&&E.add(b);let S=await t.fs.readdir(y);if(d.checkpoint(),h||(S=S.filter(x=>!x.startsWith("."))),c){let x=[];for(let M of S){let P=y==="/"?`/${M}`:`${y}/${M}`;try{let w=await t.fs.stat(P);x.push({name:M,size:w.size??0})}catch{x.push({name:M,size:0})}}x.sort((M,P)=>P.size-M.size),S=x.map(M=>M.name)}else S.sort();e&&(S=[".","..",...S]),a&&S.reverse();let A="",D="",B=0;if((r||o)&&(A=N(t,A,`${i}:
|
|
16
|
+
`)),n){A=N(t,A,`total ${S.length}
|
|
17
|
+
`);let x=S.filter($=>$==="."||$===".."),M=S.filter($=>$!=="."&&$!=="..");for(let $ of x)A=N(t,A,`drwxr-xr-x 1 user user 0 Jan 1 00:00 ${$}
|
|
18
|
+
`);let P=[];for(let $=0;$<M.length;$+=100){let W=M.slice($,$+100),v=await Promise.all(W.map(async z=>{let j=y==="/"?`/${z}`:`${y}/${z}`;try{let X=await t.fs.stat(j),Ct=X.isDirectory?"drwxr-xr-x":"-rw-r--r--",Wt=u?G(await t.fs.lstat(j)):X.isDirectory?"/":"",at=X.size??0,Dt=l?K(at).padStart(5):String(at).padStart(5),jt=X.mtime??new Date(0),kt=V(jt);return{name:z,line:`${Ct} 1 user user ${Dt} ${kt} ${z}${Wt}
|
|
19
|
+
`}}catch{return{name:z,line:`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${z}
|
|
20
|
+
`}}}));P.push(...v)}let w=new Map(M.map(($,W)=>[$,W]));P.sort(($,W)=>(w.get($.name)??0)-(w.get(W.name)??0));for(let{line:$}of P)A=N(t,A,$)}else if(u){let x=[],M=S.filter(w=>w!=="."&&w!==".."),P=S.filter(w=>w==="."||w==="..");for(let w of P)x.push(`${w}/`);for(let w=0;w<M.length;w+=100){let $=M.slice(w,w+100),W=await Promise.all($.map(async v=>{let z=y==="/"?`/${v}`:`${y}/${v}`;try{let j=await t.fs.lstat(z);return`${v}${G(j)}`}catch{return v}}));x.push(...W)}A=N(t,A,U(t,x))}else A=N(t,A,U(t,S));if(r){let x=S.filter(w=>w!=="."&&w!==".."),M=[];if(t.fs.readdirWithFileTypes)M=(await t.fs.readdirWithFileTypes(y)).filter($=>$.isDirectory&&x.includes($.name)).map($=>({name:$.name,isDirectory:!0}));else for(let w=0;w<x.length;w+=100){let $=x.slice(w,w+100),W=await Promise.all($.map(async v=>{let z=y==="/"?`/${v}`:`${y}/${v}`;try{let j=await t.fs.stat(z);return{name:v,isDirectory:j.isDirectory}}catch{return{name:v,isDirectory:!1}}}));M.push(...W.filter(v=>v.isDirectory))}M.sort((w,$)=>w.name.localeCompare($.name)),a&&M.reverse();let P=[];for(let w=0;w<M.length;w+=100){let $=M.slice(w,w+100),W=await Promise.all($.map(async v=>{let z=i==="."?`./${v.name}`:`${i}/${v.name}`,j=await zt(z,t,e,s,n,r,!1,a,l,c,u,!0,d,g+1,E);return{name:v.name,result:j}}));P.push(...W)}P.sort((w,$)=>w.name.localeCompare($.name)),a&&P.reverse();for(let{result:w}of P)A=N(t,A,`
|
|
21
|
+
`),A=N(t,A,w.stdout),D=N(t,D,w.stderr),w.exitCode!==0&&(B=w.exitCode)}return{stdout:A,stderr:D,exitCode:B}}catch(m){if(m instanceof Y||m instanceof lt)throw m;return{stdout:"",stderr:`ls: ${i}: No such file or directory
|
|
22
|
+
`,exitCode:2}}}var Ms={name:"ls",flags:[{flag:"-a",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-1",type:"boolean"}],needsFiles:!0};export{Es as a,Ms as b};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as k}from"./chunk-
|
|
3
|
+
import{a as k}from"./chunk-KP2UH5CJ.js";import{a as v}from"./chunk-ODCVIRIN.js";import{a as y,b,d as S}from"./chunk-CPTQXTBJ.js";import{l as h}from"./chunk-LCP3IKI7.js";import{a as w,b as $}from"./chunk-CPKBPQ2C.js";import{c as L}from"./chunk-DN2YCFOR.js";var g=class extends S{constructor(t){super(t,"xan")}};var C=L(k(),1);var V=class{ctx;site;rows=0;cells=0;constructor(t,i){this.ctx=t,this.site=i}consumeWork(t=1){this.ctx.executionScope?.consumeWork(t,this.site)}addRow(t){this.addRows(1,t)}addRows(t,i){let r=b(t,i,this.site);if(!Number.isSafeInteger(t)||t<0||!Number.isSafeInteger(i)||i<0||i>this.ctx.limits.maxArrayElements||t>Math.min(this.ctx.limits.maxCsvRows,this.ctx.limits.maxArrayElements)-this.rows||r>this.ctx.limits.maxCsvCells-this.cells)throw new h(`${this.site}: derived CSV result limit exceeded`,"array_elements");this.consumeWork(b(t,y(1,i,this.site),this.site)),this.rows+=t,this.cells+=r}};function I(){return Object.create(null)}function j(n,t,i){n[t]=i}function W(n){let t=I();for(let i of Object.keys(n)){let r=n[i];(typeof r=="string"||typeof r=="number"||typeof r=="boolean"||r===null)&&(t[i]=r)}return t}function z(n,t={}){let i=t.maxStringLength??10485760,r=t.maxArrayElements??1e5,a=t.maxRows??r,f=t.maxCells??1e7;if(w(n)>i)throw new h(`xan: CSV input size limit exceeded (${i} bytes)`,"string_length");let d=[],m=n.trim(),o=C.default.parse(m,{preview:1,skipEmptyLines:!0}).data[0]??[];if(o.length>r)throw new h(`xan: CSV column limit exceeded (${r})`,"array_elements");let p=0,s;if(C.default.parse(m,{header:!0,dynamicTyping:!0,skipEmptyLines:!0,step:(e,l)=>{let u=Object.keys(e.data);if(d.length===0&&e.meta.fields){if(e.meta.fields.length>r){s=new h(`xan: CSV column limit exceeded (${r})`,"array_elements"),l.abort();return}o=[...e.meta.fields]}if(d.length>=a||u.length>f-p){s=new h(d.length>=a?`xan: CSV row limit exceeded (${a})`:`xan: CSV cell limit exceeded (${f})`,"array_elements"),l.abort();return}p+=u.length,d.push(W(e.data))}}),s)throw s;return{headers:o,data:d}}function H(n,t={}){let i=t.maxStringLength??10485760,r=t.maxArrayElements??1e5,a=t.maxRows??r,f=t.maxCells??1e7;if(w(n)>i)throw new h(`xan: CSV input size limit exceeded (${i} bytes)`,"string_length");let d=[],m=0,c;if(C.default.parse(n.trim(),{header:!1,dynamicTyping:!1,skipEmptyLines:!0,step:(o,p)=>{let s=o.data;if(d.length>=a||s.length>r||s.length>f-m){c=new h(d.length>=a?`xan: CSV row limit exceeded (${a})`:s.length>r?`xan: CSV column limit exceeded (${r})`:`xan: CSV cell limit exceeded (${f})`,"array_elements"),p.abort();return}m+=s.length,d.push(s)}}),c)throw c;return d}function P(n,t,i){return E(t.length,n.length,(r,a)=>t[r][n[a]],i,n)}function q(n,t,i){return E(t.length,n.length,(r,a)=>t[r][n[a]],i)}function G(n,t,i){return E(n.length,void 0,(r,a)=>n[r][a],t,i,r=>n[r].length)}function E(n,t,i,r,a,f=()=>t??0){let d=r?.limits.maxOutputSize??Number.MAX_SAFE_INTEGER,m=new S(d,"xan CSV output",r?()=>new h(`xan: output size limit exceeded (${d} bytes)`,"output_size"):void 0),c=p=>{let s=p==null?"":String(p),e=0;for(let x=0;x<s.length;x++)s.charCodeAt(x)===34&&e++;let l=e>0||s.includes("\r")||s.includes(`
|
|
4
4
|
`)||s.includes(",")||s.includes("\uFEFF")||s.startsWith(" ")||s.endsWith(" ");m.reserve(y(w(s),y(e,l?2:0,"xan CSV output"),"xan CSV output"));let u=e>0?s.replace(/"/g,'""'):s;m.append(l?`"${u}"`:u)},o=(p,s)=>{for(let e=0;e<s;e++)e>0&&m.append(","),c(i(p,e));m.append(`
|
|
5
5
|
`)};if(a){for(let p=0;p<a.length;p++)p>0&&m.append(","),c(a[p]);m.append(`
|
|
6
6
|
`)}for(let p=0;p<n;p++)r?.executionScope?.throwIfAborted("xan CSV output"),o(p,t??f(p));return m.build()}async function R(n,t){let i=n.find(d=>!d.startsWith("-")),r;if(!i||i==="-")r=$(t.stdin);else try{let d=t.fs.resolvePath(t.cwd,i);r=await t.fs.readFile(d)}catch(d){return v(d),{headers:[],data:[],error:{stdout:"",stderr:`xan: ${i}: No such file or directory
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{f as Y}from"./chunk-WDV2ECOC.js";import{a as K}from"./chunk-3MRB66F4.js";import{a as P,b as J,c as D}from"./chunk-
|
|
3
|
+
import{f as Y}from"./chunk-WDV2ECOC.js";import{a as K}from"./chunk-3MRB66F4.js";import{a as P,b as J,c as D}from"./chunk-ROFYAVPF.js";import{a as W}from"./chunk-XBX7KFWK.js";import{a as N}from"./chunk-ODCVIRIN.js";import{d as V}from"./chunk-CPTQXTBJ.js";import{d as Z}from"./chunk-H4BRFPKY.js";import{l as M}from"./chunk-LCP3IKI7.js";import{a as G,b as T,e as _}from"./chunk-CPKBPQ2C.js";import{a as q,b as H,c as O}from"./chunk-MUFNRCMY.js";var X=Y({js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}}),A=class{types;constructor(){this.types=new Map(Object.entries(X).map(([t,s])=>[t,{extensions:[...s.extensions],globs:[...s.globs]}]))}addType(t){let s=t.indexOf(":");if(s===-1)return;let n=t.slice(0,s),r=t.slice(s+1);if(r.startsWith("include:")){let i=r.slice(8),l=this.types.get(i);if(l){let o=this.types.get(n)||{extensions:[],globs:[]};o.extensions.push(...l.extensions),o.globs.push(...l.globs),this.types.set(n,o)}}else{let i=this.types.get(n)||{extensions:[],globs:[]};if(r.startsWith("*.")&&!r.slice(2).includes("*")){let l=r.slice(1);i.extensions.includes(l)||i.extensions.push(l)}else i.globs.includes(r)||i.globs.push(r);this.types.set(n,i)}}clearType(t){let s=this.types.get(t);s&&(s.extensions=[],s.globs=[])}getType(t){return this.types.get(t)}getAllTypes(){return this.types}matchesType(t,s){let n=t.toLowerCase();for(let r of s){if(r==="all"){if(this.matchesAnyType(t))return!0;continue}let i=this.types.get(r);if(i){for(let l of i.extensions)if(n.endsWith(l))return!0;for(let l of i.globs)if(l.includes("*")){let o=l.replace(/\./g,"\\.").replace(/\*/g,".*");if(W(`^${o}$`,"i").test(t))return!0}else if(n===l.toLowerCase())return!0}}return!1}matchesAnyType(t){let s=t.toLowerCase();for(let n of this.types.values()){for(let r of n.extensions)if(s.endsWith(r))return!0;for(let r of n.globs)if(r.includes("*")){let i=r.replace(/\./g,"\\.").replace(/\*/g,".*");if(W(`^${i}$`,"i").test(t))return!0}else if(s===r.toLowerCase())return!0}return!1}};function Q(){let e=[];for(let[t,s]of Object.entries(X).sort()){let n=[];for(let r of s.extensions)n.push(`*${r}`);for(let r of s.globs)n.push(r);e.push(`${t}: ${n.join(", ")}`)}return`${e.join(`
|
|
4
4
|
`)}
|
|
5
5
|
`}function ee(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:"--",quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:"path",json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:256,maxFilesize:512*1024*1024,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}function ue(e){let t=e.match(/^(\d+)([KMG])?$/i);if(!t)return 0;let s=parseInt(t[1],10);switch((t[2]||"").toUpperCase()){case"K":return s*1024;case"M":return s*1024*1024;case"G":return s*1024*1024*1024;default:return s}}function fe(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:`rg: invalid --max-filesize value: ${e}
|
|
6
6
|
`,exitCode:1}}function he(e,t){return!/^\d+$/.test(t)||!Number.isSafeInteger(Number(t))?{stdout:"",stderr:`rg: invalid --${e} value: ${t}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as l,b as n,d as s}from"./chunk-
|
|
3
|
+
import{a as l,b as n,d as s}from"./chunk-35BSNGJK.js";import{a,b as i}from"./chunk-MUFNRCMY.js";var m={name:"tail",summary:"output the last part of files",usage:"tail [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the last NUM bytes","-n, --lines=NUM print the last NUM lines (default 10)","-n +NUM print starting from line NUM","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},d={name:"tail",async execute(t,r){if(i(t))return a(m);let e=l(t,"tail");if(!e.ok)return e.error;let{lines:o,bytes:p,fromLine:f}=e.options;return n(r,e.options,"tail",u=>s(u,o,p,f??!1))}},c={name:"tail",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0};export{d as a,c as b};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k,k as ie,l as ae}from"./chunk-
|
|
3
|
+
import{a as $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k,k as ie,l as ae}from"./chunk-GE5ERIO2.js";import{b as V,d as Qe}from"./chunk-O5R7J45W.js";import{d as Ge,f as Xe,g as oe}from"./chunk-WDV2ECOC.js";import{a as Z}from"./chunk-XBX7KFWK.js";import{b as Ye}from"./chunk-O74FSWB4.js";import{a as q}from"./chunk-ODCVIRIN.js";import{a as W,c as se,d as re}from"./chunk-CPTQXTBJ.js";import{l as E}from"./chunk-LCP3IKI7.js";import{a as K,b as Y}from"./chunk-CPKBPQ2C.js";import{a as J,b as ne}from"./chunk-MUFNRCMY.js";var G=class{input;pos=0;tokens=[];maxSourceLength;maxTokens;constructor(t,n={}){this.input=t,this.maxSourceLength=n.maxSourceLength??1024*1024,this.maxTokens=n.maxTokens??1e5}tokenize(){if(this.input.length>this.maxSourceLength)throw new E(`xan: expression length limit exceeded (${this.maxSourceLength})`,"string_length");for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length));){let t=this.nextToken();t&&(this.assertTokenCapacity(),this.tokens.push(t))}return this.assertTokenCapacity(),this.tokens.push({type:"eof",value:"",pos:this.pos}),this.tokens}assertTokenCapacity(){if(this.tokens.length>=this.maxTokens)throw new E(`xan: expression token limit exceeded (${this.maxTokens})`,"array_elements")}skipWhitespace(){for(;this.pos<this.input.length;){let t=this.input[this.pos];if(t===" "||t===" "||t===`
|
|
4
4
|
`||t==="\r")this.pos++;else if(t==="#")for(;this.pos<this.input.length&&this.input[this.pos]!==`
|
|
5
5
|
`;)this.pos++;else break}}nextToken(){let t=this.pos,n=this.input[this.pos];if(n>="0"&&n<="9")return this.readNumber();if(n==='"'||n==="'"||n==="`")return this.readString(n);if(n==="b"&&this.pos+1<this.input.length){let o=this.input[this.pos+1];if(o==='"'||o==="'"||o==="`")return this.pos++,this.readString(o)}if(n==="/"){let o=this.tokens[this.tokens.length-1];return o&&(o.type==="int"||o.type==="float"||o.type==="string"||o.type==="ident"||o.type===")"||o.type==="]")?this.input[this.pos+1]==="/"?(this.pos+=2,{type:"//",value:"//",pos:t}):(this.pos++,{type:"/",value:"/",pos:t}):this.readRegex()}if(this.match("not in"))return{type:"not in",value:"not in",pos:t};if(this.match("=>"))return{type:"=>",value:"=>",pos:t};if(this.match("**"))return{type:"**",value:"**",pos:t};if(this.match("++"))return{type:"++",value:"++",pos:t};if(this.match("//"))return{type:"//",value:"//",pos:t};if(this.match("=="))return{type:"==",value:"==",pos:t};if(this.match("!="))return{type:"!=",value:"!=",pos:t};if(this.match("<="))return{type:"<=",value:"<=",pos:t};if(this.match(">="))return{type:">=",value:">=",pos:t};if(this.match("&&"))return{type:"&&",value:"&&",pos:t};if(this.match("||"))return{type:"||",value:"||",pos:t};let r=new Map([["(","("],[")",")"],["[","["],["]","]"],["{","{"],["}","}"],[",",","],[":",":"],[";",";"],["+","+"],["-","-"],["*","*"],["%","%"],["<","<"],[">",">"],["!","!"],[".","."],["|","|"],["=","="]]).get(n);if(r!==void 0)return this.pos++,{type:r,value:n,pos:t};if(this.isIdentStart(n))return this.readIdentifier();throw new Error(`Unexpected character '${n}' at position ${this.pos}`)}match(t){if(this.input.slice(this.pos,this.pos+t.length)===t){if(/^[a-zA-Z]/.test(t)){let n=this.input[this.pos+t.length];if(n&&this.isIdentChar(n))return!1}return this.pos+=t.length,!0}return!1}isIdentStart(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="_"}isIdentChar(t){return this.isIdentStart(t)||t>="0"&&t<="9"}readNumber(){let t=this.pos,n=!1,s=!1;for(;this.pos<this.input.length;){let o=this.input[this.pos];if(o>="0"&&o<="9")this.pos++;else if(o==="_")this.pos++;else if(o==="."&&!n&&!s)n=!0,this.pos++;else if((o==="e"||o==="E")&&!s)s=!0,n=!0,this.pos++,this.pos<this.input.length&&(this.input[this.pos]==="+"||this.input[this.pos]==="-")&&this.pos++;else break}let r=this.input.slice(t,this.pos).replace(/_/g,"");return{type:n?"float":"int",value:r,pos:t}}readString(t){let n=this.pos;this.pos++;let s="";for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r===t)return this.pos++,{type:"string",value:s,pos:n};if(r==="\\"){if(this.pos++,this.pos<this.input.length){let o=this.input[this.pos];switch(o){case"n":s+=`
|
|
6
6
|
`;break;case"r":s+="\r";break;case"t":s+=" ";break;case"\\":s+="\\";break;case'"':s+='"';break;case"'":s+="'";break;case"`":s+="`";break;case"0":s+="\0";break;default:s+=o}this.pos++}}else s+=r,this.pos++}throw new Error(`Unterminated string starting at position ${n}`)}readRegex(){let t=this.pos;this.pos++;let n="",s="";for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r==="/"){for(this.pos++;this.pos<this.input.length&&this.input[this.pos]==="i";)s+=this.input[this.pos],this.pos++;return{type:"regex",value:n+(s?`/${s}`:""),pos:t}}r==="\\"?(n+=r,this.pos++,this.pos<this.input.length&&(n+=this.input[this.pos],this.pos++)):(n+=r,this.pos++)}throw new Error(`Unterminated regex starting at position ${t}`)}readIdentifier(){let t=this.pos;for(;this.pos<this.input.length&&this.isIdentChar(this.input[this.pos]);)this.pos++;let n=!1;this.pos<this.input.length&&this.input[this.pos]==="?"&&(n=!0,this.pos++);let s=this.input.slice(t,n?this.pos-1:this.pos);n&&(s+="?");let r=new Map([["true","true"],["false","false"],["null","null"],["and","and"],["or","or"],["eq","eq"],["ne","ne"],["lt","lt"],["le","le"],["gt","gt"],["ge","ge"],["in","in"],["as","as"],["_","_"]]),o=s.replace(/\?$/,""),i=r.get(o);return i!==void 0&&!n?{type:i,value:o,pos:t}:{type:"ident",value:s,pos:t}}};function z(e){return{maxSourceLength:e.limits.maxStringLength,maxTokens:e.limits.maxQueryTokens,maxAstNodes:e.limits.maxQueryElements,maxOperations:e.limits.maxJqIterations,maxDepth:e.limits.maxQueryDepth}}var D={PIPE:1,OR:2,AND:3,EQUALITY:4,COMPARISON:5,ADDITIVE:6,MULTIPLICATIVE:7,POWER:8,UNARY:9,POSTFIX:10},ee=class{pos=0;tokens;depth=0;operations=0;astNodes=0;limits;constructor(t,n={}){this.tokens=t,this.limits={maxSourceLength:n.maxSourceLength??1024*1024,maxTokens:n.maxTokens??1e5,maxDepth:n.maxDepth??100,maxOperations:n.maxOperations??1e5,maxAstNodes:n.maxAstNodes??1e5};let s=0;for(let r of t)this.useOperation(),r.type==="("||r.type==="["||r.type==="{"?(s++,s>this.limits.maxDepth&&this.throwDepthLimit()):(r.type===")"||r.type==="]"||r.type==="}")&&(s=Math.max(0,s-1))}parse(){let t=this.parseExpr(0);if(this.peek().type!=="eof")throw new Error(`Unexpected token: ${this.peek().value}`);return t}parseExpr(t){return this.withDepth(()=>this.parseExprInner(t))}parseExprInner(t){let n=this.parsePrefix();for(;;){let s=this.peek(),r=this.getInfixPrec(s.type);if(r<t)break;n=this.parseInfix(n,r)}return n}useOperation(t=1){if(t>this.limits.maxOperations-this.operations)throw new E(`xan: expression parser operation limit exceeded (${this.limits.maxOperations})`,"iterations");this.operations+=t}withDepth(t){this.depth>=this.limits.maxDepth&&this.throwDepthLimit(),this.depth++;try{return t()}finally{this.depth--}}throwDepthLimit(){throw new E(`xan: expression parser depth limit exceeded (${this.limits.maxDepth})`,"recursion")}addAstNode(){if(this.astNodes>=this.limits.maxAstNodes)throw new E(`xan: expression AST node limit exceeded (${this.limits.maxAstNodes})`,"array_elements");this.astNodes++}parsePrefix(){let t=this.peek();switch(t.type){case"int":return this.advance(),{type:"int",value:Number.parseInt(t.value,10)};case"float":return this.advance(),{type:"float",value:Number.parseFloat(t.value)};case"string":return this.advance(),{type:"string",value:t.value};case"regex":{this.advance();let n=t.value.split("/"),s=n.length>1?n[n.length-1]:"";return{type:"regex",pattern:n.slice(0,-1).join("/")||t.value,caseInsensitive:s.includes("i")}}case"true":return this.advance(),{type:"bool",value:!0};case"false":return this.advance(),{type:"bool",value:!1};case"null":return this.advance(),{type:"null"};case"_":return this.advance(),{type:"underscore"};case"ident":{let n=t.value,s=n.endsWith("?"),r=s?n.slice(0,-1):n;if(this.advance(),this.peek().type==="(")return this.parseFunctionCall(r);if(this.peek().type==="=>"){this.advance();let o=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:[r],body:o},[r])}return{type:"identifier",name:r,unsure:s}}case"(":{this.advance();let n=this.pos;if(this.peek().type===")"){if(this.advance(),this.peek().type==="=>"){this.advance();let r=this.parseExpr(0);return{type:"lambda",params:[],body:r}}throw new Error("Empty parentheses not allowed")}if(this.peek().type==="ident"){let r=[this.peek().value];this.advance();let o=!0;for(;this.peek().type===",";)if(this.advance(),this.peek().type==="ident")r.push(this.peek().value),this.advance();else{o=!1;break}if(o&&this.peek().type===")"&&this.peekAt(1).type==="=>"){this.advance(),this.advance();let i=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:r,body:i},r)}this.pos=n}let s=this.parseExpr(0);return this.expect(")"),s}case"[":return this.parseList();case"{":return this.parseMap();case"-":{this.advance();let n=this.parseExpr(D.UNARY);return n.type==="int"?{type:"int",value:-n.value}:n.type==="float"?{type:"float",value:-n.value}:{type:"func",name:"neg",args:[{expr:n}]}}case"!":return this.advance(),{type:"func",name:"not",args:[{expr:this.parseExpr(D.UNARY)}]};default:throw new Error(`Unexpected token: ${t.type} (${t.value})`)}}parseFunctionCall(t){this.expect("(");let n=[];if(this.peek().type!==")")do{n.length>0&&this.peek().type===","&&this.advance();let s;if(this.peek().type==="ident"){let o=this.peek().value,i=this.pos+1;i<this.tokens.length&&this.tokens[i].type==="="&&(s=o,this.advance(),this.advance())}let r=this.parseExpr(0);n.push({name:s,expr:r})}while(this.peek().type===",");return this.expect(")"),{type:"func",name:t.toLowerCase(),args:n}}parseList(){this.expect("[");let t=[];if(this.peek().type!=="]")do t.length>0&&this.peek().type===","&&this.advance(),t.push(this.parseExpr(0));while(this.peek().type===",");return this.expect("]"),{type:"list",elements:t}}parseMap(){this.expect("{");let t=[];if(this.peek().type!=="}")do{t.length>0&&this.peek().type===","&&this.advance();let n;if(this.peek().type==="ident")n=this.peek().value,this.advance();else if(this.peek().type==="string")n=this.peek().value,this.advance();else throw new Error(`Expected map key, got ${this.peek().type}`);this.expect(":");let s=this.parseExpr(0);t.push({key:n,value:s})}while(this.peek().type===",");return this.expect("}"),{type:"map",entries:t}}parseInfix(t,n){let s=this.peek(),o=new Map([["+","add"],["-","sub"],["*","mul"],["/","div"],["//","idiv"],["%","mod"],["**","pow"],["++","concat"],["==","=="],["!=","!="],["<","<"],["<=","<="],[">",">"],[">=",">="],["eq","eq"],["ne","ne"],["lt","lt"],["le","le"],["gt","gt"],["ge","ge"],["&&","and"],["and","and"],["||","or"],["or","or"]]).get(s.type);if(o!==void 0){this.advance();let i=this.parseExpr(n+(this.isRightAssoc(s.type)?0:1));return{type:"func",name:o,args:[{expr:t},{expr:i}]}}if(s.type==="|"){this.advance();let i=this.parseExpr(n);return this.handlePipe(t,i)}if(s.type===".")return this.advance(),this.handleDot(t);if(s.type==="[")return this.advance(),this.handleIndexing(t);if(s.type==="in")return this.advance(),{type:"func",name:"contains",args:[{expr:this.parseExpr(n+1)},{expr:t}]};if(s.type==="not in")return this.advance(),{type:"func",name:"not",args:[{expr:{type:"func",name:"contains",args:[{expr:this.parseExpr(n+1)},{expr:t}]}}]};throw new Error(`Unexpected infix token: ${s.type}`)}handlePipe(t,n){if(n.type==="identifier")return{type:"func",name:n.name,args:[{expr:t}]};if(n.type==="func"){let s=this.countUnderscores(n);return s===0?n:s===1?this.fillUnderscore(n,t):{type:"pipeline",exprs:[t,n]}}return this.countUnderscores(n)===1?this.fillUnderscore(n,t):n}handleDot(t){let n=this.peek();if(n.type==="ident"){let s=n.value;if(this.advance(),this.peek().type==="("){let r=this.parseFunctionCall(s);return r.type==="func"&&r.args.unshift({expr:t}),r}return{type:"func",name:"get",args:[{expr:t},{expr:{type:"string",value:s}}]}}if(n.type==="int"){let s=Number.parseInt(n.value,10);return this.advance(),{type:"func",name:"get",args:[{expr:t},{expr:{type:"int",value:s}}]}}if(n.type==="string"){let s=n.value;return this.advance(),{type:"func",name:"get",args:[{expr:t},{expr:{type:"string",value:s}}]}}throw new Error(`Expected identifier, number, or string after dot, got ${n.type}`)}handleIndexing(t){if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:t}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:t},{expr:{type:"int",value:0}},{expr:s}]}}let n=this.parseExpr(0);if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:t},{expr:n}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:t},{expr:n},{expr:s}]}}return this.expect("]"),{type:"func",name:"get",args:[{expr:t},{expr:n}]}}countUnderscores(t){let n=[t],s=0;for(;n.length>0;){this.useOperation();let r=n.pop();if(!r)break;if(r.type==="underscore")s++;else if(r.type==="func")for(let o of r.args)n.push(o.expr);else if(r.type==="list")n.push(...r.elements);else if(r.type==="map")for(let o of r.entries)n.push(o.value);if(n.length>this.limits.maxAstNodes)throw new E(`xan: expression AST node limit exceeded (${this.limits.maxAstNodes})`,"array_elements")}return s}fillUnderscore(t,n){return this.withDepth(()=>this.fillUnderscoreInner(t,n))}fillUnderscoreInner(t,n){return this.useOperation(),t.type==="underscore"?n:t.type==="func"?{...t,args:t.args.map(s=>({...s,expr:this.fillUnderscore(s.expr,n)}))}:t.type==="list"?{...t,elements:t.elements.map(s=>this.fillUnderscore(s,n))}:t.type==="map"?{...t,entries:t.entries.map(s=>({...s,value:this.fillUnderscore(s.value,n)}))}:t}bindLambdaArgs(t,n){return{...t,body:this.bindLambdaArgsInExpr(t.body,n)}}bindLambdaArgsInExpr(t,n){return this.withDepth(()=>this.bindLambdaArgsInExprInner(t,n))}bindLambdaArgsInExprInner(t,n){return this.useOperation(),t.type==="identifier"&&n.includes(t.name)?{type:"lambdaBinding",name:t.name}:t.type==="func"?{...t,args:t.args.map(s=>({...s,expr:this.bindLambdaArgsInExpr(s.expr,n)}))}:t.type==="list"?{...t,elements:t.elements.map(s=>this.bindLambdaArgsInExpr(s,n))}:t.type==="map"?{...t,entries:t.entries.map(s=>({...s,value:this.bindLambdaArgsInExpr(s.value,n)}))}:t}getInfixPrec(t){switch(t){case"|":return D.PIPE;case"||":case"or":return D.OR;case"&&":case"and":return D.AND;case"==":case"!=":case"eq":case"ne":return D.EQUALITY;case"<":case"<=":case">":case">=":case"lt":case"le":case"gt":case"ge":case"in":case"not in":return D.COMPARISON;case"+":case"-":case"++":return D.ADDITIVE;case"*":case"/":case"//":case"%":return D.MULTIPLICATIVE;case"**":return D.POWER;case".":case"[":return D.POSTFIX;default:return-1}}isRightAssoc(t){return t==="**"}peek(){return this.tokens[this.pos]||{type:"eof",value:"",pos:0}}peekAt(t){return this.tokens[this.pos+t]||{type:"eof",value:"",pos:0}}advance(){return this.useOperation(),this.addAstNode(),this.tokens[this.pos++]}expect(t){let n=this.peek();if(n.type!==t)throw new Error(`Expected ${t}, got ${n.type}`);return this.advance()}};function X(e,t={}){let n=[],r=new G(e,{maxSourceLength:t.maxSourceLength,maxTokens:t.maxTokens}).tokenize(),o=0,i=()=>r[o]||{type:"eof",value:"",pos:0},p=()=>r[o++];for(;i().type!=="eof";){if(i().type===","&&n.length>0){p();continue}let h=[],m=0,c=o;for(;i().type!=="eof";){let l=i();if((l.type===","||l.type==="as")&&m===0)break;(l.type==="("||l.type==="["||l.type==="{")&&m++,(l.type===")"||l.type==="]"||l.type==="}")&&m--,h.push(p())}h.push({type:"eof",value:"",pos:0});let d=new ee(h,t).parse(),u;if(i().type==="as")if(p(),i().type==="("){p();let l=[];for(;i().type!==")"&&i().type!=="eof";)if((i().type==="ident"||i().type==="string")&&(l.push(i().value),p()),i().type===",")p();else if(i().type!==")"&&i().type!=="eof")throw new Error(`Expected tuple alias, got ${i().type}`);if(i().type!==")")throw new Error("Expected ')' after tuple alias");p(),u=l}else if(i().type==="ident"||i().type==="string")u=i().value,p();else throw new Error(`Expected name after 'as', got ${i().type}`);else u=e.slice(r[c].pos,r[o-1]?.pos||e.length).trim(),d.type==="identifier"&&(u=d.name);n.push({expr:d,name:u})}return n}function B(e,t={}){let s=new G(e,{maxSourceLength:t.maxSourceLength,maxTokens:t.maxTokens}).tokenize();return new ee(s,t).parse()}function R(e,t){return t.length===0?O(e,[]):t.length===1?{type:"Pipe",left:t[0],right:O(e,[])}:{type:"Pipe",left:t[0],right:O(e,t.slice(1))}}var le={add:e=>L("+",e[0],e[1]),sub:e=>L("-",e[0],e[1]),mul:e=>L("*",e[0],e[1]),div:e=>L("/",e[0],e[1]),mod:e=>L("%",e[0],e[1]),idiv:e=>O("floor",[L("/",e[0],e[1])]),pow:e=>R("pow",e),neg:e=>({type:"UnaryOp",op:"-",operand:e[0]}),"==":e=>L("==",e[0],e[1]),"!=":e=>L("!=",e[0],e[1]),"<":e=>L("<",e[0],e[1]),"<=":e=>L("<=",e[0],e[1]),">":e=>L(">",e[0],e[1]),">=":e=>L(">=",e[0],e[1]),eq:e=>L("==",M(e[0]),M(e[1])),ne:e=>L("!=",M(e[0]),M(e[1])),lt:e=>L("<",M(e[0]),M(e[1])),le:e=>L("<=",M(e[0]),M(e[1])),gt:e=>L(">",M(e[0]),M(e[1])),ge:e=>L(">=",M(e[0]),M(e[1])),and:e=>L("and",e[0],e[1]),or:e=>L("or",e[0],e[1]),not:e=>({type:"UnaryOp",op:"not",operand:e[0]}),len:e=>R("length",e),length:e=>R("length",e),upper:e=>R("ascii_upcase",e),lower:e=>R("ascii_downcase",e),trim:e=>R("trim",e),ltrim:e=>e.length===0?O("ltrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:O("ltrimstr",[{type:"Literal",value:" "}])},rtrim:e=>e.length===0?O("rtrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:O("rtrimstr",[{type:"Literal",value:" "}])},split:e=>R("split",e),join:e=>e.length===1?O("join",[{type:"Literal",value:""}]):R("join",e),concat:e=>L("+",e[0],e[1]),startswith:e=>R("startswith",e),endswith:e=>R("endswith",e),contains:e=>R("contains",e),replace:e=>R("gsub",e),substr:e=>e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:L("+",e[1],e[2])},abs:e=>R("fabs",e),floor:e=>R("floor",e),ceil:e=>R("ceil",e),round:e=>R("round",e),sqrt:e=>R("sqrt",e),log:e=>R("log",e),log10:e=>R("log10",e),log2:e=>R("log2",e),exp:e=>R("exp",e),sin:e=>R("sin",e),cos:e=>R("cos",e),tan:e=>R("tan",e),asin:e=>R("asin",e),acos:e=>R("acos",e),atan:e=>R("atan",e),min:e=>R("min",e),max:e=>R("max",e),first:e=>e.length===0?{type:"Index",index:{type:"Literal",value:0}}:{type:"Index",index:{type:"Literal",value:0},base:e[0]},last:e=>e.length===0?{type:"Index",index:{type:"Literal",value:-1}}:{type:"Index",index:{type:"Literal",value:-1},base:e[0]},get:e=>e.length===1?{type:"Index",index:e[0]}:{type:"Index",index:e[1],base:e[0]},slice:e=>e.length===1?{type:"Slice",base:e[0]}:e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:e[2]},keys:"keys",values:"values",entries:e=>O("to_entries",e),from_entries:"from_entries",reverse:"reverse",sort:"sort",sort_by:"sort_by",group_by:"group_by",unique:"unique",unique_by:"unique_by",flatten:"flatten",map:e=>({type:"Pipe",left:e[0],right:{type:"Array",elements:e[1]}}),select:e=>O("select",e),empty:()=>O("empty",[]),count:()=>O("length",[]),sum:e=>e.length===0?O("add",[]):{type:"Pipe",left:{type:"Array",elements:e[0]},right:O("add",[])},mean:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:L("/",O("add",[]),O("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:L("/",O("add",[]),O("length",[]))},avg:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:L("/",O("add",[]),O("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:L("/",O("add",[]),O("length",[]))},type:"type",isnull:e=>e.length===0?L("==",{type:"Identity"},{type:"Literal",value:null}):L("==",e[0],{type:"Literal",value:null}),isempty:e=>e.length===0?L("==",{type:"Identity"},{type:"Literal",value:""}):L("==",e[0],{type:"Literal",value:""}),tonumber:e=>e.length===0?O("tonumber",[]):O("tonumber",e),tostring:e=>e.length===0?O("tostring",[]):O("tostring",e),if:e=>st(e[0],e[1],e[2]),coalesce:e=>{if(e.length===0)return{type:"Literal",value:null};if(e.length===1)return e[0];let t=e[e.length-1];for(let n=e.length-2;n>=0;n--){let s=e[n],r=L("and",L("!=",s,{type:"Literal",value:null}),L("!=",s,{type:"Literal",value:""}));t=st(r,s,t)}return t},index:()=>({type:"Field",name:"_row_index"}),now:()=>O("now",[]),fmt:e=>O("tostring",e),format:e=>O("tostring",e)};Object.setPrototypeOf(le,null);function L(e,t,n){return{type:"BinaryOp",op:e,left:t,right:n}}function O(e,t){return{type:"Call",name:e,args:t}}var mt="then";function st(e,t,n){let s=Xe({type:"Cond",cond:e,elifs:[],else:n||{type:"Literal",value:null}});return s[mt]=t,s}function M(e){return{type:"Pipe",left:e,right:{type:"Call",name:"tostring",args:[]}}}function U(e,t=!0,n={}){let s={nodes:0,operations:0,maxNodes:n.maxAstNodes??1e5,maxOperations:n.maxOperations??1e5,maxDepth:n.maxDepth??100};return rt(e,t,s,0)}function rt(e,t,n,s){if(s>=n.maxDepth)throw new E(`xan: expression conversion depth limit exceeded (${n.maxDepth})`,"recursion");if(++n.nodes>n.maxNodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");if(++n.operations>n.maxOperations)throw new E(`xan: expression conversion operation limit exceeded (${n.maxOperations})`,"iterations");let r=o=>rt(o,t,n,s+1);switch(e.type){case"int":case"float":return{type:"Literal",value:e.value};case"string":return{type:"Literal",value:e.value};case"bool":return{type:"Literal",value:e.value};case"null":return{type:"Literal",value:null};case"underscore":return{type:"Index",base:{type:"Identity"},index:{type:"Literal",value:"_"}};case"identifier":return t?{type:"Field",name:e.name}:{type:"VarRef",name:e.name};case"lambdaBinding":return{type:"VarRef",name:e.name};case"func":{if(e.args.length>n.maxNodes-n.nodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");let o=e.args.map(p=>r(p.expr));if(e.name==="coalesce"){let p=Math.max(0,o.length-1)*7;if(p>n.maxNodes-n.nodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");if(n.nodes+=p,n.operations+=o.length,n.operations>n.maxOperations)throw new E(`xan: expression conversion operation limit exceeded (${n.maxOperations})`,"iterations")}let i=Object.hasOwn(le,e.name)?le[e.name]:void 0;return typeof i=="function"?i(o):O(typeof i=="string"?i:e.name,o)}case"list":return e.elements.length===0?{type:"Array"}:{type:"Array",elements:e.elements.reduce((o,i,p)=>{let h=r(i);return p===0?h:{type:"Comma",left:o,right:h}},null)};case"map":return{type:"Object",entries:e.entries.map(o=>({key:o.key,value:r(o.value)}))};case"regex":return{type:"Literal",value:e.pattern};case"slice":return{type:"Slice",start:e.start?r(e.start):void 0,end:e.end?r(e.end):void 0};case"lambda":return r(e.body);case"pipeline":return{type:"Identity"};default:throw new Error(`Unknown moonblade expression type: ${e.type}`)}}function Q(e){return e<2?0:Math.ceil(e*Math.log2(e))}function ue(e,t={}){let n=t.maxArrayElements??1e5,s=t.maxStringLength??10*1024*1024,r=t.maxIterations??1e5,o=t.maxDepth??100;if(K(e)>s)throw new E(`xan: aggregation expression length limit exceeded (${s} bytes)`,"string_length");let i=[],p=0,h=0,m=()=>{if(t.consumeWork?.(),++h>r)throw new E(`xan: aggregation parser operation limit exceeded (${r})`,"iterations")};for(;p<e.length;){for(m();p<e.length&&(e[p]===" "||e[p]===",");)p++;if(p>=e.length)break;let c=p;for(;p<e.length&&/\w/.test(e[p]);)p++;let a=e.slice(c,p);for(;p<e.length&&e[p]===" ";)p++;if(e[p]!=="(")break;p++;let d=1,u=p;for(;p<e.length&&d>0;){if(m(),e[p]==="("?d++:e[p]===")"&&d--,d>o)throw new E(`xan: aggregation parser depth limit exceeded (${o})`,"recursion");d>0&&p++}let l=e.slice(u,p).trim();for(p++;p<e.length&&e[p]===" ";)p++;let f="";if(e.slice(p,p+3).toLowerCase()==="as "){for(p+=3;p<e.length&&e[p]===" ";)p++;let x=p;for(;p<e.length&&/\w/.test(e[p]);)p++;f=e.slice(x,p)}if(f||(f=l?`${a}(${l})`:`${a}()`),i.length>=n)throw new E(`xan: aggregation specification limit exceeded (${n})`,"array_elements");i.push({func:a,expr:l,alias:f})}return i}function ft(e){return/^\w+$/.test(e)}function ht(e,t,n){let s=V(e,t,n);return s.length>0?s[0]:null}function ce(e,t,n={},s={}){let{func:r,expr:o}=t,i=s.maxArrayElements??1e5,p=s.maxStringLength??10*1024*1024,h=s.maxIterations??1e5,m={maxSourceLength:p,maxTokens:i,maxAstNodes:i,maxOperations:h,maxDepth:s.maxDepth??100};if(e.length>i)throw new E(`xan: aggregation input limit exceeded (${i})`,"array_elements");if(r==="count"&&!o)return e.length;let c=ft(o),a=c?null:U(B(o,m),!0,m),d;if(c)d=f=>f[o];else{if(a===null)throw new Error("xan: missing compiled aggregation expression");d=f=>ht(f,a,n)}if(r==="all"||r==="any"){let f=0;for(let x of e){if(s.consumeWork?.(),++f>h)throw new E(`xan: aggregation iteration limit exceeded (${h})`,"iterations");let g=!!d(x);if(r==="all"&&!g)return!1;if(r==="any"&&g)return!0}return r==="all"}let u=[],l=0;for(let f of e){if(s.consumeWork?.(),++l>h)throw new E(`xan: aggregation iteration limit exceeded (${h})`,"iterations");let x=d(f);if(x!=null){if(u.length>=i)throw new E(`xan: aggregation value limit exceeded (${i})`,"array_elements");u.push(x)}}switch(r){case"count":{if(c)return u.length;let f=0;for(let x of u)s.consumeWork?.(),x&&f++;return f}case"sum":{let f=0;for(let x of u)s.consumeWork?.(),f+=typeof x=="number"?x:Number.parseFloat(String(x));return f}case"mean":case"avg":{let f=0;for(let x of u)s.consumeWork?.(),f+=typeof x=="number"?x:Number.parseFloat(String(x));return u.length>0?f/u.length:0}case"min":{let f=null;for(let x of u){s.consumeWork?.();let g=typeof x=="number"?x:Number.parseFloat(String(x));f=f===null?g:Math.min(f,g)}return f}case"max":{let f=null;for(let x of u){s.consumeWork?.();let g=typeof x=="number"?x:Number.parseFloat(String(x));f=f===null?g:Math.max(f,g)}return f}case"first":return u.length>0?u[0]:null;case"last":return u.length>0?u[u.length-1]:null;case"median":{let f=[];for(let g of u){s.consumeWork?.();let y=typeof g=="number"?g:Number.parseFloat(String(g));Number.isNaN(y)||f.push(y)}if(s.consumeWork?.(Q(f.length)),f.sort((g,y)=>g-y),f.length===0)return null;let x=Math.floor(f.length/2);return f.length%2===0?(f[x-1]+f[x])/2:f[x]}case"mode":{let f=new Map;for(let y of u){s.consumeWork?.();let w=String(y);f.set(w,(f.get(w)||0)+1)}let x=0,g=null;for(let[y,w]of f)s.consumeWork?.(),w>x&&(x=w,g=y);return g}case"cardinality":{let f=new Set;for(let x of u)s.consumeWork?.(),f.add(String(x));return f.size}case"values":return ot(u,!1,p,s);case"distinct_values":return ot(u,!0,p,s);default:return null}}function it(e,t,n={},s={}){let r=F();for(let o of t)b(r,o.alias,ce(e,o,n,s));return r}function ot(e,t,n,s){let r=[],o=t?new Set:null,i=0;for(let p of e){s.consumeWork?.();let h=String(p);if(o?.has(h))continue;o?.add(h);let m=K(h)+(r.length>0?1:0);if(m>n-i)throw new E(`xan: aggregation string limit exceeded (${n} bytes)`,"string_length");r.push(h),i+=m}return t&&(s.consumeWork?.(Q(r.length)),r.sort()),r.join("|")}function lt(e,t){return{maxArrayElements:e.limits.maxArrayElements,maxStringLength:e.limits.maxStringLength,maxIterations:e.limits.maxJqIterations,maxDepth:e.limits.maxQueryDepth,consumeWork:(n=1)=>t.consumeWork(n)}}function at(e,t,n){let s=e.size-(t&&e.has("")?1:0);return n>0?Math.min(s,n):s}async function pe(e,t){let n="",s=[];for(let d of e)d.startsWith("-")||(n?s.push(d):n=d);if(!n)return{stdout:"",stderr:`xan agg: no aggregation expression
|
|
@@ -62,7 +62,7 @@ import{a as $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k
|
|
|
62
62
|
`,exitCode:1};i=o[0].headers}let m=[];for(let{headers:c,data:a}of o)for(let d of a){let u=F();for(let l of i)b(u,l,c.includes(l)?d[l]:"");m.push(u)}return{stdout:C(i,m,t),stderr:"",exitCode:0}}async function Be(e,t){let n="",s=[],r=!1,o=!1,i=[];for(let u=0;u<e.length;u++){let l=e[u];(l==="-s"||l==="--select")&&u+1<e.length?s=e[++u].split(","):l==="-v"||l==="--invert"?r=!0:l==="-i"||l==="--ignore-case"?o=!0:l==="-r"||l==="--regex"||l.startsWith("-")||(n?i.push(l):n=l)}if(!n)return{stdout:"",stderr:`xan search: no pattern specified
|
|
63
63
|
`,exitCode:1};let{headers:p,data:h,error:m}=await k(i,t);if(m)return m;let c=s.length>0?s:p,a;try{a=Z(n,o?"i":"")}catch{return{stdout:"",stderr:`xan search: invalid regex pattern '${n}'
|
|
64
64
|
`,exitCode:1}}let d=h.filter(u=>{let l=c.some(f=>{let x=u[f];return x!=null&&a.test(String(x))});return r?!l:l});return{stdout:C(p,d,t),stderr:"",exitCode:0}}async function He(e,t){let n="",s=[];for(let l of e)l.startsWith("-")||(n?s.push(l):n=l);if(!n)return{stdout:"",stderr:`xan flatmap: no expression specified
|
|
65
|
-
`,exitCode:1};let{headers:r,data:o,error:i}=await k(s,t);if(i)return i;let p=z(t),m=X(n,p).map(({expr:l,name:f})=>({alias:typeof f=="string"?f:f[0],ast:U(l,!0,p)})),c={limits:t.limits?{maxIterations:t.limits.maxJqIterations,maxStringLength:t.limits.maxStringLength}:void 0};if(W(r.length,m.length,"xan flatmap")>t.limits.maxArrayElements)throw new E(`xan flatmap: output column limit exceeded (${t.limits.maxArrayElements})`,"array_elements");let a=[...r,...m.map(l=>l.alias)],d=[],u=new $(t,"xan flatmap");for(let l of o){let f=[],x=1;for(let g of m){u.consumeWork();let y=V(l,g.ast,c),w=y.length>0&&Array.isArray(y[0])?y[0]:y;if(w.length>t.limits.maxArrayElements)throw new E(`xan flatmap: expression result limit exceeded (${t.limits.maxArrayElements})`,"array_elements");f.push(w),x=Math.max(x,w.length)}for(let g=0;g<x;g++){u.addRow(a.length);let y=j(l);for(let w=0;w<m.length;w++){let A=f[w][g]??null;b(y,m[w].alias,A)}d.push(y)}}return{stdout:C(a,d,t),stderr:"",exitCode:0}}async function Ke(e,t){let{cmdView:n}=await import("./xan-view-
|
|
65
|
+
`,exitCode:1};let{headers:r,data:o,error:i}=await k(s,t);if(i)return i;let p=z(t),m=X(n,p).map(({expr:l,name:f})=>({alias:typeof f=="string"?f:f[0],ast:U(l,!0,p)})),c={limits:t.limits?{maxIterations:t.limits.maxJqIterations,maxStringLength:t.limits.maxStringLength}:void 0};if(W(r.length,m.length,"xan flatmap")>t.limits.maxArrayElements)throw new E(`xan flatmap: output column limit exceeded (${t.limits.maxArrayElements})`,"array_elements");let a=[...r,...m.map(l=>l.alias)],d=[],u=new $(t,"xan flatmap");for(let l of o){let f=[],x=1;for(let g of m){u.consumeWork();let y=V(l,g.ast,c),w=y.length>0&&Array.isArray(y[0])?y[0]:y;if(w.length>t.limits.maxArrayElements)throw new E(`xan flatmap: expression result limit exceeded (${t.limits.maxArrayElements})`,"array_elements");f.push(w),x=Math.max(x,w.length)}for(let g=0;g<x;g++){u.addRow(a.length);let y=j(l);for(let w=0;w<m.length;w++){let A=f[w][g]??null;b(y,m[w].alias,A)}d.push(y)}}return{stdout:C(a,d,t),stderr:"",exitCode:0}}async function Ke(e,t){let{cmdView:n}=await import("./xan-view-H3LNQ72O.js");return n(e,t)}var dt=new Set(["fuzzy-join","glob","hist","input","parallel","plot","progress","range","scrape","tokenize","union-find"]),St=new Set(["agg","behead","cat","count","dedup","drop","enum","explode","f","filter","fixlengths","flatmap","flatten","fmt","frequency","freq","from","groupby","head","headers","implode","join","map","merge","partition","pivot","rename","reverse","sample","search","select","shuffle","slice","sort","split","stats","tail","to","top","transform","transpose","view",...dt]),pt={name:"xan",summary:"CSV toolkit for data manipulation",usage:"xan <COMMAND> [OPTIONS] [FILE]",description:`xan is a collection of commands for working with CSV data.
|
|
66
66
|
It provides a simple, ergonomic interface for common data operations.
|
|
67
67
|
|
|
68
68
|
COMMANDS:
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as we,b as Oe}from"./chunk-DN2YCFOR.js";var xe=Oe((le,pe)=>{(function(he,w){typeof define=="function"&&define.amd?define([],w):typeof pe=="object"&&typeof le<"u"?pe.exports=w():he.Papa=w()})(le,function he(){"use strict";var w=(function(){return typeof self<"u"?self:typeof window<"u"?window:typeof w<"u"?w:{}})();function _e(){var t=w.URL||w.webkitURL||null,e=he.toString();return f.BLOB_URL||(f.BLOB_URL=t.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",e,")();"],{type:"text/javascript"})))}var Y=!w.document&&!!w.postMessage,ue=w.IS_PAPA_WORKER||!1,ne={},Re=0,f={};f.parse=ge,f.unparse=Ee,f.RECORD_SEP="",f.UNIT_SEP="",f.BYTE_ORDER_MARK="\uFEFF",f.BAD_DELIMITERS=["\r",`
|
|
4
|
+
`,'"',f.BYTE_ORDER_MARK],f.WORKERS_SUPPORTED=!Y&&!!w.Worker,f.NODE_STREAM_INPUT=1,f.LocalChunkSize=1024*1024*10,f.RemoteChunkSize=1024*1024*5,f.DefaultDelimiter=",",f.Parser=fe,f.ParserHandle=ce,f.NetworkStreamer=V,f.FileStreamer=G,f.StringStreamer=Q,f.ReadableStreamStreamer=ee,typeof PAPA_BROWSER_CONTEXT>"u"&&(f.DuplexStreamStreamer=te),ue&&(w.onmessage=be);function oe(t){return t.charCodeAt(0)===65279?t.slice(1):t}function ge(t,e){e=e||{};var r=e.dynamicTyping||!1;if(g(r)&&(e.dynamicTypingFunction=r,r={}),e.dynamicTyping=r,e.transform=g(e.transform)?e.transform:!1,e.worker&&f.WORKERS_SUPPORTED){var s=Ce();s.userStep=e.step,s.userChunk=e.chunk,s.userComplete=e.complete,s.userError=e.error,e.step=g(e.step),e.chunk=g(e.chunk),e.complete=g(e.complete),e.error=g(e.error),delete e.worker,s.postMessage({input:t,config:e,workerId:s.id});return}var i=null;return t===f.NODE_STREAM_INPUT&&typeof PAPA_BROWSER_CONTEXT>"u"?(i=new te(e),i.getStream()):(typeof t=="string"?(t=oe(t),e.download?i=new V(e):i=new Q(e)):t.readable===!0&&g(t.read)&&g(t.on)?i=new ee(e):(w.File&&t instanceof File||t instanceof Object)&&(i=new G(e)),i.stream(t))}function Ee(t,e){var r=!1,s=!0,i=",",c=`\r
|
|
5
|
+
`,m='"',h=m+m,_=!1,x=null,S=!1;P();var d=new RegExp(re(m),"g");if(typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return u(null,t,_);if(typeof t[0]=="object")return u(x||Object.keys(t[0]),t,_)}else if(typeof t=="object")return typeof t.data=="string"&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||x),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:typeof t.data[0]=="object"?Object.keys(t.data[0]):[]),!Array.isArray(t.data[0])&&typeof t.data[0]!="object"&&(t.data=[t.data])),u(t.fields||[],t.data||[],_);throw new Error("Unable to serialize unrecognized input");function P(){if(typeof e=="object"){if(typeof e.delimiter=="string"&&!f.BAD_DELIMITERS.filter(function(y){return e.delimiter.indexOf(y)!==-1}).length&&(i=e.delimiter),(typeof e.quotes=="boolean"||typeof e.quotes=="function"||Array.isArray(e.quotes))&&(r=e.quotes),(typeof e.skipEmptyLines=="boolean"||typeof e.skipEmptyLines=="string")&&(_=e.skipEmptyLines),typeof e.newline=="string"&&(c=e.newline),typeof e.quoteChar=="string"&&(m=e.quoteChar,h=m+m),typeof e.header=="boolean"&&(s=e.header),Array.isArray(e.columns)){if(e.columns.length===0)throw new Error("Option columns is empty");x=e.columns}e.escapeChar!==void 0&&(h=e.escapeChar+m),e.escapeFormulae instanceof RegExp?S=e.escapeFormulae:typeof e.escapeFormulae=="boolean"&&e.escapeFormulae&&(S=/^[=+\-@\t\r].*$/)}}function u(y,v,C){var A="";typeof y=="string"&&(y=JSON.parse(y)),typeof v=="string"&&(v=JSON.parse(v));var b=Array.isArray(y)&&y.length>0,D=!Array.isArray(v[0]);if(b&&s){for(var q=0;q<y.length;q++)q>0&&(A+=i),A+=l(y[q],q);v.length>0&&(A+=c)}for(var k=0;k<v.length;k++){var N=b?y.length:v[k].length,W=!1,a=b?Object.keys(v[k]).length===0:v[k].length===0;if(C&&!b&&(W=C==="greedy"?v[k].join("").trim()==="":v[k].length===1&&v[k][0].length===0),C==="greedy"&&b){for(var o=[],p=0;p<N;p++){var E=D?y[p]:p;o.push(v[k][E])}W=o.join("").trim()===""}if(!W){for(var n=0;n<N;n++){n>0&&!a&&(A+=i);var R=b&&D?y[n]:n;A+=l(v[k][R],n)}k<v.length-1&&(!C||N>0&&!a)&&(A+=c)}}return A}function l(y,v){if(typeof y>"u"||y===null)return"";if(y.constructor===Date)return isNaN(y.getTime())?"":y.toISOString();var C=!1;S&&typeof y=="string"&&S.test(y)&&(y="'"+y,C=!0);var A=y.toString(),b=A.replace(d,h);return C=C||r===!0||typeof r=="function"&&r(y,v)||Array.isArray(r)&&r[v]||J(b,f.BAD_DELIMITERS)||b.indexOf(i)>-1||A.indexOf(m)>-1||b.charAt(0)===" "||b.charAt(b.length-1)===" ",C?m+b+m:b}function J(y,v){for(var C=0;C<v.length;C++)if(y.indexOf(v[C])>-1)return!0;return!1}}function z(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},e.call(this,t),this.parseChunk=function(r,s){let i=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&i>0){let S=this._config.newline;if(!S){let P=this._config.quoteChar||'"';S=this._handle.guessLineEndings(r,P)}r=[...r.split(S).slice(i)].join(S)}if(this.isFirstChunk&&g(this._config.beforeFirstChunk)){var c=this._config.beforeFirstChunk(r);c!==void 0&&(r=c)}this.isFirstChunk=!1,this._halted=!1;var m=this._partialLine+r;this._partialLine="";var h=this._handle.parse(m,this._baseIndex,!this._finished);if(this._handle.paused()||this._handle.aborted()){this._halted=!0;return}var _=h.meta.cursor;this._finished||(this._partialLine=m.substring(_-this._baseIndex),this._baseIndex=_),h&&h.data&&(this._rowCount+=h.data.length);var x=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(ue)w.postMessage({results:h,workerId:f.WORKER_ID,finished:x});else if(g(this._config.chunk)&&!s){if(this._config.chunk(h,this._handle),this._handle.paused()||this._handle.aborted()){this._halted=!0;return}h=void 0,this._completeResults=void 0}return!this._config.step&&!this._config.chunk&&(this._completeResults.data=this._completeResults.data.concat(h.data),this._completeResults.errors=this._completeResults.errors.concat(h.errors),this._completeResults.meta=h.meta),!this._completed&&x&&g(this._config.complete)&&(!h||!h.meta.aborted)&&(this._config.complete(this._completeResults,this._input),this._completed=!0),!x&&(!h||!h.meta.paused)&&this._nextChunk(),h},this._sendError=function(r){g(this._config.error)?this._config.error(r):ue&&this._config.error&&w.postMessage({workerId:f.WORKER_ID,error:r,finished:!1})};function e(r){var s=ae(r);s.chunkSize=parseInt(s.chunkSize),!r.step&&!r.chunk&&(s.chunkSize=null),this._handle=new ce(s),this._handle.streamer=this,this._config=s}}function V(t){t=t||{},t.chunkSize||(t.chunkSize=f.RemoteChunkSize),z.call(this,t);var e;Y?this._nextChunk=function(){this._readChunk(),this._chunkLoaded()}:this._nextChunk=function(){this._readChunk()},this.stream=function(s){this._input=s,this._nextChunk()},this._readChunk=function(){if(this._finished){this._chunkLoaded();return}if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),Y||(e.onload=L(this._chunkLoaded,this),e.onerror=L(this._chunkError,this)),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!Y),this._config.downloadRequestHeaders){var s=this._config.downloadRequestHeaders;for(var i in s)e.setRequestHeader(i,s[i])}if(this._config.chunkSize){var c=this._start+this._config.chunkSize-1;e.setRequestHeader("Range","bytes="+this._start+"-"+c)}try{e.send(this._config.downloadRequestBody)}catch(m){this._chunkError(m.message)}Y&&e.status===0&&this._chunkError()},this._chunkLoaded=function(){if(e.readyState===4){if(e.status<200||e.status>=400){this._chunkError();return}this._start+=this._config.chunkSize?this._config.chunkSize:e.responseText.length,this._finished=!this._config.chunkSize||this._start>=r(e),this.parseChunk(e.responseText)}},this._chunkError=function(s){var i=e.statusText||s;this._sendError(new Error(i))};function r(s){var i=s.getResponseHeader("Content-Range");return i===null?-1:parseInt(i.substring(i.lastIndexOf("/")+1))}}V.prototype=Object.create(z.prototype),V.prototype.constructor=V;function G(t){t=t||{},t.chunkSize||(t.chunkSize=f.LocalChunkSize),z.call(this,t);var e,r,s=typeof FileReader<"u";this.stream=function(i){this._input=i,r=i.slice||i.webkitSlice||i.mozSlice,s?(e=new FileReader,e.onload=L(this._chunkLoaded,this),e.onerror=L(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){!this._finished&&(!this._config.preview||this._rowCount<this._config.preview)&&this._readChunk()},this._readChunk=function(){var i=this._input;if(this._config.chunkSize){var c=Math.min(this._start+this._config.chunkSize,this._input.size);i=r.call(i,this._start,c)}var m=e.readAsText(i,this._config.encoding);s||this._chunkLoaded({target:{result:m}})},this._chunkLoaded=function(i){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(i.target.result)},this._chunkError=function(){this._sendError(e.error)}}G.prototype=Object.create(z.prototype),G.prototype.constructor=G;function Q(t){t=t||{},z.call(this,t);var e;this.stream=function(r){return e=r,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var r=this._config.chunkSize,s;return r?(s=e.substring(0,r),e=e.substring(r)):(s=e,e=""),this._finished=!e,this.parseChunk(s)}}}Q.prototype=Object.create(Q.prototype),Q.prototype.constructor=Q;function ee(t){t=t||{},z.call(this,t);var e=[],r=!0,s=!1;this.pause=function(){z.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){z.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(i){this._input=i,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){s&&e.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):r=!0},this._streamData=L(function(i){try{e.push(typeof i=="string"?i:i.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(c){this._streamError(c)}},this),this._streamError=L(function(i){this._streamCleanUp(),this._sendError(i)},this),this._streamEnd=L(function(){this._streamCleanUp(),s=!0,this._streamData("")},this),this._streamCleanUp=L(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}ee.prototype=Object.create(z.prototype),ee.prototype.constructor=ee;function te(t){var e=we("stream").Duplex,r=ae(t),s=!0,i=!1,c=[],m=null;this._onCsvData=function(h){var _=h.data;!m.push(_)&&!this._handle.paused()&&this._handle.pause()},this._onCsvComplete=function(){m.push(null)},r.step=L(this._onCsvData,this),r.complete=L(this._onCsvComplete,this),z.call(this,r),this._nextChunk=function(){i&&c.length===1&&(this._finished=!0),c.length?c.shift()():s=!0},this._addToParseQueue=function(h,_){c.push(L(function(){if(this.parseChunk(typeof h=="string"?h:h.toString(r.encoding)),g(_))return _()},this)),s&&(s=!1,this._nextChunk())},this._onRead=function(){this._handle.paused()&&this._handle.resume()},this._onWrite=function(h,_,x){this._addToParseQueue(h,x)},this._onWriteComplete=function(){i=!0,this._addToParseQueue("")},this.getStream=function(){return m},m=new e({readableObjectMode:!0,decodeStrings:!1,read:L(this._onRead,this),write:L(this._onWrite,this)}),m.once("finish",L(this._onWriteComplete,this))}typeof PAPA_BROWSER_CONTEXT>"u"&&(te.prototype=Object.create(z.prototype),te.prototype.constructor=te);function ce(t){var e=Math.pow(2,53),r=-e,s=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,i=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,c=this,m=0,h=0,_,x,S=!1,d=!1,P,u=[],l={data:[],errors:[],meta:{}};if(g(t.step)){var J=t.step;t.step=function(a){if(l=a,A())C();else{if(C(),l.data.length===0)return;m+=a.data.length,t.preview&&m>t.preview?x.abort():(l.data=l.data[0],J(l,c))}}}this.parse=function(a,o,p){var E=t.quoteChar||'"';if(t.newline||(t.newline=this.guessLineEndings(a,E)),P=!1,t.delimiter)g(t.delimiter)&&(t.delimiter=t.delimiter(a),l.meta.delimiter=t.delimiter);else{var n=N(a,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess);n.successful?t.delimiter=n.bestDelimiter:(P=!0,t.delimiter=f.DefaultDelimiter),l.meta.delimiter=t.delimiter}var R=ae(t);return t.preview&&t.header&&R.preview++,_=a,x=new fe(R),l=x.parse(_,o,p),C(),S?{meta:{paused:!0}}:l||{meta:{paused:!1}}},this.paused=function(){return S},this.pause=function(){S=!0,x.abort(),_=g(t.chunk)?"":_.substring(x.getCharIndex())},this.resume=function(){c.streamer._halted?(S=!1,c.streamer.parseChunk(_,!0)):setTimeout(c.resume,3)},this.aborted=function(){return d},this.abort=function(){d=!0,x.abort(),l.meta.aborted=!0,g(t.complete)&&t.complete(l),_=""},this.guessLineEndings=function(a,o){a=a.substring(0,1024*1024);var p=new RegExp(re(o)+"([^]*?)"+re(o),"gm");a=a.replace(p,"");var E=a.split("\r"),n=a.split(`
|
|
6
|
+
`),R=n.length>1&&n[0].length<E[0].length;if(E.length===1||R)return`
|
|
7
|
+
`;for(var T=0,O=0;O<E.length;O++)E[O][0]===`
|
|
8
|
+
`&&T++;return T>=E.length/2?`\r
|
|
9
|
+
`:"\r"};function y(a){return t.skipEmptyLines==="greedy"?a.join("").trim()==="":a.length===1&&a[0].length===0}function v(a){if(s.test(a)){var o=parseFloat(a);if(o>r&&o<e)return!0}return!1}function C(){return l&&P&&(W("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+f.DefaultDelimiter+"'"),P=!1),t.skipEmptyLines&&(l.data=l.data.filter(function(a){return!y(a)})),A()&&b(),k()}function A(){return t.header&&u.length===0}function b(){if(!l)return;function a(p,E){p=oe(p),g(t.transformHeader)&&(p=t.transformHeader(p,E)),u.push(p)}if(Array.isArray(l.data[0])){for(var o=0;A()&&o<l.data.length;o++)l.data[o].forEach(a);l.data.splice(0,1)}else l.data.forEach(a)}function D(a){return t.dynamicTypingFunction&&t.dynamicTyping[a]===void 0&&(t.dynamicTyping[a]=t.dynamicTypingFunction(a)),(t.dynamicTyping[a]||t.dynamicTyping)===!0}function q(a,o){return D(a)?o==="true"||o==="TRUE"?!0:o==="false"||o==="FALSE"?!1:v(o)?parseFloat(o):i.test(o)?new Date(o):o===""?null:o:o}function k(){if(!l||!t.header&&!t.dynamicTyping&&!t.transform)return l;function a(p,E){var n=t.header?{}:[],R;for(R=0;R<p.length;R++){var T=R,O=p[R];t.header&&(T=R>=u.length?"__parsed_extra":u[R]),t.transform&&(O=t.transform(O,T)),O=q(T,O),T==="__parsed_extra"?(n[T]=n[T]||[],n[T].push(O)):n[T]=O}return t.header&&(R>u.length?W("FieldMismatch","TooManyFields","Too many fields: expected "+u.length+" fields but parsed "+R,h+E):R<u.length&&W("FieldMismatch","TooFewFields","Too few fields: expected "+u.length+" fields but parsed "+R,h+E)),n}var o=1;return!l.data.length||Array.isArray(l.data[0])?(l.data=l.data.map(a),o=l.data.length):l.data=a(l.data,0),t.header&&l.meta&&(l.meta.fields=u),h+=o,l}function N(a,o,p,E,n){var R,T,O,X;n=n||[","," ","|",";",f.RECORD_SEP,f.UNIT_SEP];for(var j=0;j<n.length;j++){var se=n[j],K=0,B=0,F=0;O=void 0;for(var H=new fe({comments:E,delimiter:se,newline:o,preview:10}).parse(a),I=0;I<H.data.length;I++){if(p&&y(H.data[I])){F++;continue}var M=H.data[I].length;if(B+=M,typeof O>"u"){O=M;continue}else M>0&&(K+=Math.abs(M-O),O=M)}H.data.length>0&&(B/=H.data.length-F),B>1.99&&(typeof T>"u"||K<T||K===T&&B>X)&&(T=K,R=se,X=B)}return t.delimiter=R,{successful:!!R,bestDelimiter:R}}function W(a,o,p,E){var n={type:a,code:o,message:p};E!==void 0&&(n.row=E),l.errors.push(n)}}function re(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fe(t){t=t||{};var e=t.delimiter,r=t.newline,s=t.comments,i=t.step,c=t.preview,m=t.fastMode,h,_=null,x=!1;t.quoteChar===void 0||t.quoteChar===null?h='"':h=t.quoteChar;var S=h;if(t.escapeChar!==void 0&&(S=t.escapeChar),(typeof e!="string"||f.BAD_DELIMITERS.indexOf(e)>-1)&&(e=","),s===e)throw new Error("Comment character same as delimiter");s===!0?s="#":(typeof s!="string"||f.BAD_DELIMITERS.indexOf(s)>-1)&&(s=!1),r!==`
|
|
10
|
+
`&&r!=="\r"&&r!==`\r
|
|
11
|
+
`&&(r=`
|
|
12
|
+
`);var d=0,P=!1;this.parse=function(u,l,J){if(typeof u!="string")throw new Error("Input must be a string");var y=u.length,v=e.length,C=r.length,A=s.length,b=g(i);d=0;var D=[],q=[],k=[],N=0;if(!u)return F();if(m||m!==!1&&u.indexOf(h)===-1){for(var W=u.split(r),a=0;a<W.length;a++){if(k=W[a],d+=k.length,a!==W.length-1)d+=r.length;else if(J)return F();if(!(s&&k.substring(0,A)===s)){if(b){if(D=[],j(k.split(e)),H(),P)return F()}else j(k.split(e));if(c&&a>=c)return D=D.slice(0,c),F(!0)}}return F()}for(var o=u.indexOf(e,d),p=u.indexOf(r,d),E=new RegExp(re(S)+re(h),"g"),n=u.indexOf(h,d);;){if(u[d]===h){for(n=d,d++;;){if(n=u.indexOf(h,n+1),n===-1)return J||q.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:D.length,index:d}),K();if(n===y-1){var R=u.substring(d,n).replace(E,h);return K(R)}if(h===S&&u[n+1]===S){n++;continue}if(!(h!==S&&n!==0&&u[n-1]===S)){o!==-1&&o<n+1&&(o=u.indexOf(e,n+1)),p!==-1&&p<n+1&&(p=u.indexOf(r,n+1));var T=p===-1?o:Math.min(o,p),O=se(T);if(u.substr(n+1+O,v)===e){k.push(u.substring(d,n).replace(E,h)),d=n+1+O+v,u[n+1+O+v]!==h&&(n=u.indexOf(h,d)),o=u.indexOf(e,d),p=u.indexOf(r,d);break}var X=se(p);if(u.substring(n+1+X,n+1+X+C)===r){if(k.push(u.substring(d,n).replace(E,h)),B(n+1+X+C),o=u.indexOf(e,d),n=u.indexOf(h,d),b&&(H(),P))return F();if(c&&D.length>=c)return F(!0);break}q.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:D.length,index:d}),n++}}continue}if(s&&k.length===0&&u.substring(d,d+A)===s){if(p===-1)return F();d=p+C,p=u.indexOf(r,d),o=u.indexOf(e,d);continue}if(o!==-1&&(o<p||p===-1)){k.push(u.substring(d,o)),d=o+v,o=u.indexOf(e,d);continue}if(p!==-1){if(k.push(u.substring(d,p)),B(p+C),b&&(H(),P))return F();if(c&&D.length>=c)return F(!0);continue}break}return K();function j(I){D.push(I),N=d}function se(I){var M=0;if(I!==-1){var $=u.substring(n+1,I);$&&$.trim()===""&&(M=$.length)}return M}function K(I){return J||(typeof I>"u"&&(I=u.substring(d)),k.push(I),d=y,j(k),b&&H()),F()}function B(I){d=I,j(k),k=[],p=u.indexOf(r,d)}function F(I){if(t.header&&!l&&D.length&&!x){let M=D[0],$=Object.create(null),de=new Set(M),ve=!1;for(let Z=0;Z<M.length;Z++){let U=oe(M[Z]);if(g(t.transformHeader)&&(U=t.transformHeader(U,Z)),!$[U])$[U]=1,M[Z]=U;else{let ie,ke=$[U];do ie=`${U}_${ke}`,ke++;while(de.has(ie));de.add(ie),M[Z]=ie,$[U]++,ve=!0,_===null&&(_={}),_[ie]=U}de.add(U)}ve&&console.warn("Duplicate headers found and renamed."),x=!0}return{data:D,errors:q,meta:{delimiter:e,linebreak:r,aborted:P,truncated:!!I,cursor:N+(l||0),renamedHeaders:_}}}function H(){i(F()),D=[],q=[]}},this.abort=function(){P=!0},this.getCharIndex=function(){return d}}function Ce(){if(!f.WORKERS_SUPPORTED)return!1;var t=_e(),e=new w.Worker(t);return e.onmessage=Se,e.id=Re++,ne[e.id]=e,e}function Se(t){var e=t.data,r=ne[e.workerId],s=!1;if(e.error)r.userError(e.error,e.file);else if(e.results&&e.results.data){var i=function(){s=!0,me(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},c={abort:i,pause:ye,resume:ye};if(g(r.userStep)){for(var m=0;m<e.results.data.length&&(r.userStep({data:e.results.data[m],errors:e.results.errors,meta:e.results.meta},c),!s);m++);delete e.results}else g(r.userChunk)&&(r.userChunk(e.results,c,e.file),delete e.results)}e.finished&&!s&&me(e.workerId,e.results)}function me(t,e){var r=ne[t];g(r.userComplete)&&r.userComplete(e),r.terminate(),delete ne[t]}function ye(){throw new Error("Not implemented.")}function be(t){var e=t.data;if(typeof f.WORKER_ID>"u"&&e&&(f.WORKER_ID=e.workerId),typeof e.input=="string")w.postMessage({workerId:f.WORKER_ID,results:f.parse(e.input,e.config),finished:!0});else if(w.File&&e.input instanceof File||e.input instanceof Object){var r=f.parse(e.input,e.config);r&&w.postMessage({workerId:f.WORKER_ID,results:r,finished:!0})}}function ae(t){if(typeof t!="object"||t===null)return t;var e=Array.isArray(t)?[]:{};for(var r in t)e[r]=ae(t[r]);return e}function L(t,e){return function(){t.apply(e,arguments)}}function g(t){return typeof t=="function"}return f})});export{xe as a};
|
|
13
|
+
/*! Bundled license information:
|
|
14
|
+
|
|
15
|
+
papaparse/papaparse.js:
|
|
16
|
+
(* @license
|
|
17
|
+
Papa Parse
|
|
18
|
+
v5.6.0
|
|
19
|
+
https://github.com/mholt/PapaParse
|
|
20
|
+
License: MIT
|
|
21
|
+
*)
|
|
22
|
+
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as E}from"./chunk-
|
|
3
|
+
import{a as E}from"./chunk-ODCVIRIN.js";import{a as h}from"./chunk-H4BRFPKY.js";import{l as $}from"./chunk-LCP3IKI7.js";import{a as k}from"./chunk-CPKBPQ2C.js";import{a as C,b as L,c as F}from"./chunk-MUFNRCMY.js";var A={name:"split",summary:"split a file into pieces",usage:"split [OPTION]... [FILE [PREFIX]]",description:"Output pieces of FILE to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is 'x'.",options:["-l N Put N lines per output file","-b SIZE Put SIZE bytes per output file (K, M, G suffixes)","-n CHUNKS Split into CHUNKS equal-sized files","-d Use numeric suffixes (00, 01, ...) instead of alphabetic","-a LENGTH Use suffixes of length LENGTH (default: 2)","--additional-suffix=SUFFIX Append SUFFIX to file names"],examples:["split -l 100 file.txt # Split into 100-line chunks","split -b 1M file.bin # Split into 1MB chunks","split -n 5 file.txt # Split into 5 equal parts","split -d file.txt part_ # part_00, part_01, ...","split -a 3 -d file.txt x # x000, x001, ..."]},S=1e5,_=0;function U(e){return Uint8Array.from(e,t=>t.charCodeAt(0))}function N(e){let t=e.match(/^(\d+)([KMGTPEZY]?)([B]?)$/i);if(!t)return null;let i=Number(t[1]);if(!Number.isSafeInteger(i)||i<1)return null;let u=(t[2]||"").toUpperCase(),a=new Map([["",1],["K",1024],["M",1024*1024],["G",1024*1024*1024],["T",1024*1024*1024*1024],["P",1024*1024*1024*1024*1024]]).get(u);return a===void 0||i>Math.floor(Number.MAX_SAFE_INTEGER/a)?null:i*a}function x(e){if(!/^[0-9]+$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)&&t>=1?t:null}function H(e,t,i){if(t)return e.toString().padStart(i,"0");let u="abcdefghijklmnopqrstuvwxyz",n=new Array(i),a=e;for(let o=i-1;o>=0;o--)n[o]=u[a%26],a=Math.floor(a/26);return n.join("")}function B(e,t){let i=[],u=0,n=0;for(let a=0;a<e.length;a++)e[a]===10&&(n++,n===t&&(i.push(e.subarray(u,a+1)),u=a+1,n=0));return u<e.length&&i.push(e.subarray(u)),i}function T(e,t){let i=[];for(let u=0;u<e.length;u+=t)i.push(e.subarray(u,u+t));return i}function X(e,t){let i=[],u=Math.ceil(e.length/t);for(let n=0;n<t;n++){let a=n*u,o=Math.min(a+u,e.length);a<o&&i.push(e.subarray(a,o))}return i}function z(e,t){let i=e?10**t:26**t;return Number.isSafeInteger(i)?i:Number.MAX_SAFE_INTEGER}function G(e){if(e.existence!=="unknown")return e.existence==="existing"?e.stableIdentity:e.canonicalPath===void 0?void 0:`missing:${e.canonicalPath}`}function I(e,t){return e.existence!==t.existence||e.existence==="unknown"||t.existence==="unknown"?!1:e.existence==="missing"&&t.existence==="missing"?e.canonicalPath===t.canonicalPath:e.existence==="existing"&&t.existence==="existing"?e.stableIdentity!==void 0&&e.stableIdentity===t.stableIdentity:!1}async function M(e,t,i){let u=t.lastIndexOf("/"),n=u<=0?"/":t.slice(0,u),a=t.slice(u+1);for(let o=0;o<100;o++){let d=_++,c=e.fs.resolvePath(n,`.${a}.just-bash-split-${i}-${d}`),p=await h(e.fs,c);if(p.existence==="missing")return c;if(p.existence==="unknown")break}throw new Error("unable to allocate transaction path")}var Z={name:"split",execute:async(e,t)=>{if(L(e))return C(A);let i={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},u=[],n=0;for(;n<e.length;){let s=e[n];if(s==="-l"&&n+1<e.length){let l=x(e[n+1]);if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${e[n+1]}'
|
|
4
4
|
`};i.mode="lines",i.lines=l,n+=2}else if(s.match(/^-l\d+$/)){let l=x(s.slice(2));if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${s.slice(2)}'
|
|
5
5
|
`};i.mode="lines",i.lines=l,n++}else if(s==="-b"&&n+1<e.length){let l=N(e[n+1]);if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${e[n+1]}'
|
|
6
6
|
`};i.mode="bytes",i.bytes=l,n+=2}else if(s.match(/^-b.+$/)){let l=N(s.slice(2));if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${s.slice(2)}'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as C}from"./chunk-
|
|
3
|
+
import{a as C}from"./chunk-Z7QCL4IA.js";import{a as se,b as re}from"./chunk-ROFYAVPF.js";import{a as O}from"./chunk-ODCVIRIN.js";import{l as A}from"./chunk-LCP3IKI7.js";import{b as j}from"./chunk-CPKBPQ2C.js";import{a as me,c as ne}from"./chunk-MUFNRCMY.js";var xe="(standard input)";function he(t){let e=t.limits.maxLoopIterations,i=t.limits.maxArrayElements;return Math.max(e,Math.min(i,e*10))}function w(t){if(++t.operations>t.maxOperations)throw new A(`grep: glob operation limit exceeded (${t.maxOperations})`,"glob_operations")}function _(t){if(t.results>=t.maxResults)throw new A(`grep: array element limit exceeded (${t.maxResults})`,"array_elements");t.results++}var we="[^\\s\\S]";function Fe(t){return t.split(`
|
|
4
4
|
`)}function ve(t){if(t==="")return[];let e=t.split(`
|
|
5
5
|
`);return e[e.length-1]===""&&e.pop(),e}function Ce(t,e){return t.length===1?{pattern:t[0],mode:e}:e==="fixed"?{pattern:t.map(i=>`(?:${i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`).join("|"),mode:"extended"}:e==="basic"?{pattern:t.join("\\|"),mode:e}:{pattern:t.map(i=>`(?:${i})`).join("|"),mode:e}}var Ee={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",description:["Search for PATTERN in each FILE.","With no FILE, or when FILE is -, read standard input."],options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching","-f FILE, --file=FILE obtain patterns from FILE, one per line"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},de={name:"grep",async execute(t,e){let i=!1,g=!1,f=!1,h=!1,c=!1,u=!1,a=!1,l=!1,m=!1,F=!1,$=!1,y=!1,x=!1,M=!1,G=!1,S=0,N=0,W=0,B=[],b=[],X=[],L=null,H=[],Z=[],Q=!0;for(let s=0;s<t.length;s++){let r=t[s];if(Q&&r==="--"){Q=!1;continue}if(Q&&r==="--help")return me(Ee);if(Q&&r.startsWith("-")&&r!=="-"){if(r==="-e"&&s+1<t.length){L=t[++s];continue}if(r.startsWith("--file=")){H.push(r.slice(7));continue}if(r.startsWith("--include=")){B.push(r.slice(10));continue}if(r.startsWith("--exclude=")){b.push(r.slice(10));continue}if(r.startsWith("--exclude-dir=")){X.push(r.slice(14));continue}if(r.startsWith("--max-count=")){S=parseInt(r.slice(12),10);continue}let v=r.match(/^-m(\d+)$/);if(v){S=parseInt(v[1],10);continue}if(r==="-m"&&s+1<t.length){S=parseInt(t[++s],10);continue}let o=r.match(/^-([ABC])(\d+)$/);if(o){let p=parseInt(o[2],10);o[1]==="A"?W=p:o[1]==="B"?N=p:o[1]==="C"&&(N=p,W=p);continue}if((r==="-A"||r==="-B"||r==="-C")&&s+1<t.length){let p=parseInt(t[++s],10);r==="-A"?W=p:r==="-B"?N=p:(N=p,W=p);continue}let d=r.startsWith("--")?[r]:r.slice(1).split("");for(let p=0;p<d.length;p++){let n=d[p];if(n==="f"||n==="--file"){let z=n==="f"?d.slice(p+1).join(""):"";if(z.length>0)H.push(z);else if(s+1<t.length)H.push(t[++s]);else return{stdout:"",stderr:n==="f"?`grep: option requires an argument -- 'f'
|
|
6
6
|
`:`grep: option '--file' requires an argument
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as n,b as i,c as r}from"./chunk-
|
|
3
|
+
import{a as n,b as i,c as r}from"./chunk-35BSNGJK.js";import{a,b as s}from"./chunk-MUFNRCMY.js";var f={name:"head",summary:"output the first part of files",usage:"head [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the first NUM bytes","-n, --lines=NUM print the first NUM lines (default 10)","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},m={name:"head",async execute(t,l){if(s(t))return a(f);let e=n(t,"head");if(!e.ok)return e.error;let{lines:o,bytes:p}=e.options;return i(l,e.options,"head",d=>r(d,o,p))}},g={name:"head",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0};export{m as a,g as b};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as p}from"./chunk-B2DRBHGQ.js";import{a as n,b as l}from"./chunk-
|
|
3
|
+
import{a as p}from"./chunk-B2DRBHGQ.js";import{a as n,b as l}from"./chunk-EJIZDPMG.js";import{a as m,b as d}from"./chunk-MUFNRCMY.js";var f={name:"sleep",summary:"delay for a specified amount of time",usage:"sleep NUMBER[SUFFIX]",description:`Pause for NUMBER seconds. SUFFIX may be:
|
|
4
4
|
s - seconds (default)
|
|
5
5
|
m - minutes
|
|
6
6
|
h - hours
|