struct-fakerator 2.7.9 → 2.9.9
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/LICENSE +21 -0
- package/README.md +8 -8
- package/dist/config.cjs +51 -0
- package/dist/config.d.ts +1 -2
- package/dist/config.js +2 -19
- package/dist/config_scheme.cjs +95 -0
- package/dist/config_scheme.d.ts +7 -10
- package/dist/config_scheme.js +46 -17
- package/dist/create_config.cjs +110 -0
- package/dist/create_config.d.ts +9 -11
- package/dist/create_config.js +61 -18
- package/dist/create_config.test.d.ts +1 -2
- package/dist/create_generator_fn.cjs +168 -0
- package/dist/create_generator_fn.d.ts +9 -11
- package/dist/create_generator_fn.js +116 -20
- package/dist/create_generator_fn.test.d.ts +1 -2
- package/dist/generator_fn.cjs +54 -0
- package/dist/generator_fn.d.ts +1 -2
- package/dist/generator_fn.js +2 -21
- package/dist/index.cjs +107 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -43
- package/dist/type.cjs +18 -0
- package/dist/type.d.ts +9 -11
- package/dist/type.js +0 -1
- package/dist/utils/airline.cjs +46 -0
- package/dist/utils/airline.d.ts +14 -3
- package/dist/utils/airline.js +6 -14
- package/dist/utils/animal.cjs +94 -0
- package/dist/utils/animal.d.ts +30 -2
- package/dist/utils/animal.js +18 -38
- package/dist/utils/color.cjs +78 -0
- package/dist/utils/color.d.ts +41 -3
- package/dist/utils/color.js +14 -30
- package/dist/utils/commerce.cjs +66 -0
- package/dist/utils/commerce.d.ts +24 -2
- package/dist/utils/commerce.js +11 -24
- package/dist/utils/common.cjs +37 -0
- package/dist/utils/common.d.ts +2 -2
- package/dist/utils/common.js +3 -9
- package/dist/utils/company.cjs +70 -0
- package/dist/utils/company.d.ts +18 -2
- package/dist/utils/company.js +12 -26
- package/dist/utils/database.cjs +54 -0
- package/dist/utils/database.d.ts +10 -2
- package/dist/utils/database.js +8 -18
- package/dist/utils/datatype.cjs +38 -0
- package/dist/utils/datatype.d.ts +4 -2
- package/dist/utils/datatype.js +4 -10
- package/dist/utils/datetime.cjs +78 -0
- package/dist/utils/datetime.d.ts +59 -2
- package/dist/utils/datetime.js +14 -30
- package/dist/utils/finance.cjs +110 -0
- package/dist/utils/finance.d.ts +62 -3
- package/dist/utils/finance.js +22 -46
- package/dist/utils/food.cjs +70 -0
- package/dist/utils/food.d.ts +18 -2
- package/dist/utils/food.js +12 -26
- package/dist/utils/git.cjs +54 -0
- package/dist/utils/git.d.ts +18 -2
- package/dist/utils/git.js +8 -18
- package/dist/utils/hacker.cjs +58 -0
- package/dist/utils/hacker.d.ts +12 -2
- package/dist/utils/hacker.js +9 -20
- package/dist/utils/image.cjs +66 -0
- package/dist/utils/image.d.ts +40 -2
- package/dist/utils/image.js +11 -24
- package/dist/utils/index.cjs +136 -0
- package/dist/utils/index.d.ts +26 -28
- package/dist/utils/index.js +27 -109
- package/dist/utils/internet.cjs +114 -0
- package/dist/utils/internet.d.ts +77 -3
- package/dist/utils/internet.js +23 -48
- package/dist/utils/location.cjs +98 -0
- package/dist/utils/location.d.ts +56 -2
- package/dist/utils/location.js +19 -40
- package/dist/utils/lorem.cjs +70 -0
- package/dist/utils/lorem.d.ts +45 -2
- package/dist/utils/lorem.js +12 -26
- package/dist/utils/music.cjs +50 -0
- package/dist/utils/music.d.ts +8 -2
- package/dist/utils/music.js +7 -16
- package/dist/utils/number.cjs +58 -0
- package/dist/utils/number.d.ts +34 -2
- package/dist/utils/number.js +9 -20
- package/dist/utils/person.cjs +94 -0
- package/dist/utils/person.d.ts +34 -3
- package/dist/utils/person.js +18 -38
- package/dist/utils/phone.cjs +42 -0
- package/dist/utils/phone.d.ts +6 -2
- package/dist/utils/phone.js +5 -12
- package/dist/utils/science.cjs +42 -0
- package/dist/utils/science.d.ts +4 -3
- package/dist/utils/science.js +5 -12
- package/dist/utils/string.cjs +74 -0
- package/dist/utils/string.d.ts +69 -2
- package/dist/utils/string.js +13 -28
- package/dist/utils/system.cjs +82 -0
- package/dist/utils/system.d.ts +35 -2
- package/dist/utils/system.js +15 -32
- package/dist/utils/utils.cjs +39 -0
- package/dist/utils/utils.d.ts +2 -2
- package/dist/utils/utils.js +5 -9
- package/dist/utils/vehicle.cjs +70 -0
- package/dist/utils/vehicle.d.ts +18 -2
- package/dist/utils/vehicle.js +12 -26
- package/dist/utils/word.cjs +70 -0
- package/dist/utils/word.d.ts +18 -22
- package/dist/utils/word.js +12 -29
- package/package.json +27 -35
- package/biome.json +0 -27
- package/dist/airline-98MCzMN8.d.ts +0 -26
- package/dist/airline-BUwgrfsj.d.ts +0 -26
- package/dist/airline-C0ManYED.d.mts +0 -26
- package/dist/airline-CuAxOEYH.d.mts +0 -26
- package/dist/animal-BohQ7s0w.d.mts +0 -53
- package/dist/animal-arG64NM6.d.mts +0 -53
- package/dist/animal-erAZXs_d.d.ts +0 -53
- package/dist/animal-o8BFF7gd.d.ts +0 -53
- package/dist/chunk-25HDDMTE.js +0 -45
- package/dist/chunk-266JLHQ7.mjs +0 -27
- package/dist/chunk-266W7TLD.mjs +0 -45
- package/dist/chunk-2FTPTSHD.mjs +0 -1972
- package/dist/chunk-2HHTDZ5W.mjs +0 -27
- package/dist/chunk-2P6DPKAW.js +0 -35
- package/dist/chunk-2QPSWN3J.js +0 -24
- package/dist/chunk-2SF54GZN.mjs +0 -24
- package/dist/chunk-2UAN3WRZ.js +0 -51
- package/dist/chunk-2VTSGFBK.mjs +0 -56
- package/dist/chunk-2ZR6AR26.js +0 -24
- package/dist/chunk-3APOILUV.js +0 -81
- package/dist/chunk-3AXS7RA6.mjs +0 -18
- package/dist/chunk-3DIP4M5Y.mjs +0 -36
- package/dist/chunk-3E2B272L.js +0 -25
- package/dist/chunk-3FFGDXA5.mjs +0 -48
- package/dist/chunk-3HQMGDUF.js +0 -98
- package/dist/chunk-3KXIZTCT.mjs +0 -20
- package/dist/chunk-3MYH2PDS.js +0 -24
- package/dist/chunk-3P4RJMMV.js +0 -79
- package/dist/chunk-3PSJD6BF.js +0 -67
- package/dist/chunk-3SVV5GDL.js +0 -22
- package/dist/chunk-3U6BNHWG.mjs +0 -2040
- package/dist/chunk-3WINWLTB.js +0 -34
- package/dist/chunk-42EKB2FX.js +0 -74
- package/dist/chunk-44Q7WXPL.mjs +0 -30
- package/dist/chunk-474WFN7X.js +0 -33
- package/dist/chunk-4ESFUYHU.js +0 -48
- package/dist/chunk-4OB35J4Q.mjs +0 -151
- package/dist/chunk-4UGSTE5Q.js +0 -1968
- package/dist/chunk-4VNS5WPM.js +0 -42
- package/dist/chunk-4XEKUGKR.js +0 -35
- package/dist/chunk-4XQBQAPC.mjs +0 -33
- package/dist/chunk-52ZOIHJM.js +0 -26
- package/dist/chunk-55HSOHNN.js +0 -36
- package/dist/chunk-5A3HJWPX.mjs +0 -33
- package/dist/chunk-5KKLW4SD.js +0 -26
- package/dist/chunk-5LCWZUVP.mjs +0 -19
- package/dist/chunk-5M3DUBFV.mjs +0 -24
- package/dist/chunk-5NC3JFHS.mjs +0 -63
- package/dist/chunk-5PCIFPK7.js +0 -15721
- package/dist/chunk-5TG43IWT.js +0 -36
- package/dist/chunk-5UFZ4NET.mjs +0 -26
- package/dist/chunk-5VTJIH2Q.mjs +0 -63
- package/dist/chunk-5ZNSQDU5.js +0 -81
- package/dist/chunk-62MDIAG3.js +0 -19
- package/dist/chunk-62NUC6UZ.js +0 -51
- package/dist/chunk-6BWS3CLP.mjs +0 -16
- package/dist/chunk-6GXFVYK2.js +0 -18
- package/dist/chunk-6LNIYJMV.mjs +0 -21
- package/dist/chunk-6OOU3BX5.mjs +0 -35
- package/dist/chunk-6QXR4Q23.js +0 -43
- package/dist/chunk-6QZF75LH.js +0 -20
- package/dist/chunk-6TGTIMX2.mjs +0 -151
- package/dist/chunk-6UVWD65N.mjs +0 -63
- package/dist/chunk-73BBBL26.js +0 -49
- package/dist/chunk-7C2MCLYX.mjs +0 -15721
- package/dist/chunk-7IQW6MWT.mjs +0 -81
- package/dist/chunk-7IWAOHPW.mjs +0 -27
- package/dist/chunk-7LDYF5VW.js +0 -78
- package/dist/chunk-7POVLKQR.mjs +0 -20
- package/dist/chunk-7QCNINQB.js +0 -43
- package/dist/chunk-7RP7F74O.js +0 -49
- package/dist/chunk-7TMD372Q.mjs +0 -165
- package/dist/chunk-7UQSPUCL.mjs +0 -0
- package/dist/chunk-7V3T6MQ3.mjs +0 -21
- package/dist/chunk-7ZAVU2DI.mjs +0 -81
- package/dist/chunk-A4QVPMYT.js +0 -44
- package/dist/chunk-A5YXOL6G.mjs +0 -63
- package/dist/chunk-ABZZ2Y2O.mjs +0 -45
- package/dist/chunk-AH3KD37M.js +0 -45
- package/dist/chunk-AQWBYQGF.js +0 -54
- package/dist/chunk-AT4FPDTE.mjs +0 -51
- package/dist/chunk-AWKBY27N.js +0 -35
- package/dist/chunk-B2NENAKV.mjs +0 -34
- package/dist/chunk-B3RA7BAM.mjs +0 -30
- package/dist/chunk-B7MK7WHV.mjs +0 -21
- package/dist/chunk-BGE4WZH7.js +0 -27
- package/dist/chunk-BMQ2NETL.js +0 -63
- package/dist/chunk-BNJUSXEO.js +0 -27
- package/dist/chunk-BNUCXH6Q.js +0 -49
- package/dist/chunk-BS7IEV74.mjs +0 -1968
- package/dist/chunk-BVGE5IMC.js +0 -45
- package/dist/chunk-C3RGM3CB.js +0 -67
- package/dist/chunk-C6FQYK5T.js +0 -81
- package/dist/chunk-C6IEYVWV.mjs +0 -21
- package/dist/chunk-CC255UJD.mjs +0 -27
- package/dist/chunk-CK65OFQQ.mjs +0 -56
- package/dist/chunk-CKNDI3RH.js +0 -24
- package/dist/chunk-CRW5Q4VB.js +0 -30
- package/dist/chunk-CSOXFDKC.mjs +0 -42
- package/dist/chunk-D3DPNIYF.mjs +0 -36
- package/dist/chunk-D6QN54CO.js +0 -46
- package/dist/chunk-D74AUXZW.mjs +0 -35
- package/dist/chunk-DM5VFX6B.js +0 -17008
- package/dist/chunk-DN6VWFMI.js +0 -56
- package/dist/chunk-DONFLQME.js +0 -49
- package/dist/chunk-DQBTHPWE.js +0 -24
- package/dist/chunk-DSDX7NOV.mjs +0 -40
- package/dist/chunk-DX6NQK6H.js +0 -49
- package/dist/chunk-DXVB5THL.js +0 -36
- package/dist/chunk-DZCTAI2Q.js +0 -49
- package/dist/chunk-E3EZHXI2.mjs +0 -45
- package/dist/chunk-E3N3PWFI.js +0 -45
- package/dist/chunk-E7JW4TGQ.mjs +0 -49
- package/dist/chunk-ECTLN5SO.mjs +0 -63
- package/dist/chunk-EGCGEPYD.mjs +0 -24
- package/dist/chunk-ELK6OOE6.js +0 -55
- package/dist/chunk-EM67LVYX.mjs +0 -18
- package/dist/chunk-EPWKT75L.js +0 -63
- package/dist/chunk-ES6I4JEP.js +0 -24
- package/dist/chunk-ETS5PP3N.js +0 -42
- package/dist/chunk-EXLV2IRM.mjs +0 -26
- package/dist/chunk-EZFWJGGR.js +0 -28
- package/dist/chunk-F4NIEPKF.mjs +0 -48
- package/dist/chunk-F4WSUHUB.js +0 -27
- package/dist/chunk-F54WJZPR.mjs +0 -48
- package/dist/chunk-FDIHUTKO.mjs +0 -34
- package/dist/chunk-FG2O523S.js +0 -48
- package/dist/chunk-FGA73ALI.mjs +0 -45
- package/dist/chunk-FT5QWXEO.mjs +0 -21
- package/dist/chunk-FXTLAJTY.mjs +0 -74
- package/dist/chunk-G73JPAKW.mjs +0 -16831
- package/dist/chunk-GAOFL72U.mjs +0 -24
- package/dist/chunk-GF4PSVJ7.js +0 -81
- package/dist/chunk-GL777PKT.js +0 -21
- package/dist/chunk-GLK5ZVJB.js +0 -47
- package/dist/chunk-GMOMLI4W.js +0 -56
- package/dist/chunk-GNFZ7Z6V.mjs +0 -28
- package/dist/chunk-GNLLMLQX.js +0 -48
- package/dist/chunk-GNPP2GGZ.js +0 -16831
- package/dist/chunk-GR5EJCJ2.js +0 -24
- package/dist/chunk-GSFJYUDA.js +0 -63
- package/dist/chunk-GUIYTTMP.mjs +0 -24
- package/dist/chunk-HAIK2LXD.js +0 -63
- package/dist/chunk-HEHR64VN.js +0 -1972
- package/dist/chunk-HK4L636Y.mjs +0 -49
- package/dist/chunk-HLHMXAI2.js +0 -21
- package/dist/chunk-HMDAKHLF.js +0 -151
- package/dist/chunk-HMGGQ5ZJ.js +0 -45
- package/dist/chunk-HNCQJ5F3.js +0 -56
- package/dist/chunk-HVWSAC7Q.js +0 -74
- package/dist/chunk-I3BHVE4B.js +0 -43
- package/dist/chunk-IEYIHOHM.js +0 -57
- package/dist/chunk-IHDAERZ6.mjs +0 -61
- package/dist/chunk-IM5JST4B.js +0 -76
- package/dist/chunk-IN3R3ABZ.mjs +0 -45
- package/dist/chunk-IOLQKV4S.js +0 -51
- package/dist/chunk-IOXGSFEU.js +0 -20
- package/dist/chunk-IRHHL256.mjs +0 -36
- package/dist/chunk-IY4LBMAL.js +0 -78
- package/dist/chunk-IZVHA6FO.js +0 -45
- package/dist/chunk-JA2F23JA.mjs +0 -79
- package/dist/chunk-JC2FY5K5.mjs +0 -42
- package/dist/chunk-JFYN4RCQ.mjs +0 -24
- package/dist/chunk-JHNWL66I.mjs +0 -47
- package/dist/chunk-JIPBMHNL.mjs +0 -63
- package/dist/chunk-JIWCYW33.js +0 -35
- package/dist/chunk-JSZXNY5A.js +0 -33
- package/dist/chunk-JTURHVCR.mjs +0 -67
- package/dist/chunk-JUS3FQET.js +0 -63
- package/dist/chunk-JY2DLJQ7.js +0 -74
- package/dist/chunk-KB4QNLUX.js +0 -30
- package/dist/chunk-KDRX2A7A.mjs +0 -45
- package/dist/chunk-KDTNND32.js +0 -63
- package/dist/chunk-KESFLCJB.mjs +0 -57
- package/dist/chunk-KK4QURZV.mjs +0 -63
- package/dist/chunk-KKDNACGF.js +0 -78
- package/dist/chunk-KLYK2EDS.js +0 -18
- package/dist/chunk-KMAT3MEQ.mjs +0 -24
- package/dist/chunk-KMGBR4B7.mjs +0 -49
- package/dist/chunk-KO4BOJXG.mjs +0 -18
- package/dist/chunk-KSBJZ7PZ.mjs +0 -48
- package/dist/chunk-KUNWO6DB.js +0 -20
- package/dist/chunk-KVPPJDFE.mjs +0 -63
- package/dist/chunk-L55R55BM.mjs +0 -24
- package/dist/chunk-L5EOJC4C.mjs +0 -78
- package/dist/chunk-L63CILKL.js +0 -36
- package/dist/chunk-L7SUBSOS.mjs +0 -74
- package/dist/chunk-LCQV5ZXR.js +0 -63
- package/dist/chunk-LDVSCWU7.mjs +0 -51
- package/dist/chunk-LGYUIU5L.js +0 -33
- package/dist/chunk-LKLQIBRC.mjs +0 -18
- package/dist/chunk-LPLLITHD.mjs +0 -33
- package/dist/chunk-LSFOERXQ.js +0 -18
- package/dist/chunk-LSP4VVPM.mjs +0 -45
- package/dist/chunk-LYYFKB5U.mjs +0 -48
- package/dist/chunk-M2ERA63H.mjs +0 -20
- package/dist/chunk-M3JRMFX2.js +0 -36
- package/dist/chunk-M7SBPX3E.mjs +0 -45
- package/dist/chunk-MCHBNMZ7.js +0 -48
- package/dist/chunk-MHBVLDC4.js +0 -30
- package/dist/chunk-MJWNNESP.js +0 -57
- package/dist/chunk-MKTV5ZCC.mjs +0 -30
- package/dist/chunk-MLJAHDYX.mjs +0 -167
- package/dist/chunk-MNRDBDJD.js +0 -33
- package/dist/chunk-MTNLYYS2.mjs +0 -51
- package/dist/chunk-MYNHKOPJ.js +0 -34
- package/dist/chunk-N2ZA6SQB.mjs +0 -45
- package/dist/chunk-NBUVTD24.js +0 -24
- package/dist/chunk-NEFBZJ7G.mjs +0 -42
- package/dist/chunk-NGJNM6BX.mjs +0 -48
- package/dist/chunk-NO44Z2RV.mjs +0 -55
- package/dist/chunk-NOD5QLN5.js +0 -40
- package/dist/chunk-NP7ZKTAA.js +0 -36
- package/dist/chunk-NPYKAZ5O.mjs +0 -42
- package/dist/chunk-NWVKBRLA.js +0 -30
- package/dist/chunk-O73LDQID.mjs +0 -57
- package/dist/chunk-OAPPDES4.js +0 -51
- package/dist/chunk-OCKZOACK.js +0 -24
- package/dist/chunk-OETKBS7R.mjs +0 -63
- package/dist/chunk-OFMBEI6Y.js +0 -20
- package/dist/chunk-OJRNPQVE.js +0 -45
- package/dist/chunk-OKDN5R6M.mjs +0 -78
- package/dist/chunk-OLSCXZ3D.mjs +0 -98
- package/dist/chunk-OTDJMFZE.js +0 -36
- package/dist/chunk-OYP22DDC.mjs +0 -31
- package/dist/chunk-OZ5VJVBQ.js +0 -21
- package/dist/chunk-OZ7Y3D4Z.js +0 -48
- package/dist/chunk-OZU24BQP.mjs +0 -81
- package/dist/chunk-P2NEBQQH.mjs +0 -78
- package/dist/chunk-PBOBMHB3.js +0 -45
- package/dist/chunk-PECDKT6F.js +0 -76
- package/dist/chunk-PEMTSFQT.mjs +0 -36
- package/dist/chunk-PFTS7XQK.js +0 -27
- package/dist/chunk-PFVCJYEK.js +0 -46
- package/dist/chunk-PLNNO4GL.js +0 -36
- package/dist/chunk-PPQIZT6A.mjs +0 -48
- package/dist/chunk-PS673ZMG.mjs +0 -78
- package/dist/chunk-PSTZXVEM.mjs +0 -45
- package/dist/chunk-PXVILWPC.js +0 -51
- package/dist/chunk-PXXIPMA2.mjs +0 -17567
- package/dist/chunk-PYIUSFN2.js +0 -48
- package/dist/chunk-Q4BXZB6O.mjs +0 -35
- package/dist/chunk-Q6CVTFPU.mjs +0 -2022
- package/dist/chunk-Q7THO24V.js +0 -45
- package/dist/chunk-QEVQSGOW.mjs +0 -49
- package/dist/chunk-QFG2B4XU.js +0 -35
- package/dist/chunk-QH2RT36U.js +0 -57
- package/dist/chunk-QHW2YYKY.js +0 -45
- package/dist/chunk-QMNACCJG.mjs +0 -30
- package/dist/chunk-QN2KYEUJ.js +0 -28
- package/dist/chunk-QOATILWS.mjs +0 -48
- package/dist/chunk-QQWZ56UO.js +0 -33
- package/dist/chunk-QTT2TUDM.js +0 -165
- package/dist/chunk-QZQ32UPU.mjs +0 -28
- package/dist/chunk-R3MBRFOY.js +0 -22
- package/dist/chunk-R5U7XKVJ.js +0 -16
- package/dist/chunk-R7ZZJULR.js +0 -61
- package/dist/chunk-RA35MXTT.mjs +0 -51
- package/dist/chunk-RCDDW7NN.js +0 -36
- package/dist/chunk-RDATYKAG.mjs +0 -58
- package/dist/chunk-RDMAE6F2.js +0 -17567
- package/dist/chunk-RFTRP37B.mjs +0 -74
- package/dist/chunk-RIOEYYMH.mjs +0 -30
- package/dist/chunk-RJPUHGKC.mjs +0 -54
- package/dist/chunk-RM7GMMWN.mjs +0 -49
- package/dist/chunk-ROM4ZH2A.js +0 -56
- package/dist/chunk-RTENULN5.mjs +0 -36
- package/dist/chunk-RUTM5ENW.js +0 -57
- package/dist/chunk-RUUOAMRF.mjs +0 -43
- package/dist/chunk-RW4IZD3J.js +0 -74
- package/dist/chunk-RWSXJDFQ.mjs +0 -57
- package/dist/chunk-S2AEEWWW.mjs +0 -36
- package/dist/chunk-SAYLPMKP.js +0 -74
- package/dist/chunk-SDPCOC7O.mjs +0 -76
- package/dist/chunk-SEUDYVHA.js +0 -45
- package/dist/chunk-SMIDTCUZ.mjs +0 -56
- package/dist/chunk-SN2ALAEI.mjs +0 -36
- package/dist/chunk-SN4QTD6R.js +0 -1
- package/dist/chunk-SOFVWH6A.js +0 -56
- package/dist/chunk-SSFS7U3T.mjs +0 -72
- package/dist/chunk-SSZ5GGDT.js +0 -45
- package/dist/chunk-STKSA23M.mjs +0 -33
- package/dist/chunk-SVHWBNOB.mjs +0 -61
- package/dist/chunk-SVMTK42D.mjs +0 -48
- package/dist/chunk-SYIPILT6.mjs +0 -35
- package/dist/chunk-T4IVAGFU.mjs +0 -48
- package/dist/chunk-TKS2PTMF.mjs +0 -18
- package/dist/chunk-TLH73HQN.js +0 -63
- package/dist/chunk-TQIJQZBP.js +0 -57
- package/dist/chunk-TQTDHXR6.mjs +0 -22
- package/dist/chunk-TSDTKUIT.mjs +0 -151
- package/dist/chunk-TTPRXCNS.mjs +0 -46
- package/dist/chunk-TYWXW3FQ.mjs +0 -46
- package/dist/chunk-TZ2RKEBF.js +0 -2040
- package/dist/chunk-U3EACZZ3.js +0 -18
- package/dist/chunk-U3TS432W.js +0 -48
- package/dist/chunk-U634RJNK.js +0 -36
- package/dist/chunk-U7MLTDS4.js +0 -167
- package/dist/chunk-UCRPFQYY.js +0 -48
- package/dist/chunk-UEXFND2J.mjs +0 -56
- package/dist/chunk-UIYW7U2O.js +0 -28
- package/dist/chunk-UJ5Q7MZB.js +0 -78
- package/dist/chunk-UOSN6FPU.js +0 -42
- package/dist/chunk-UOY5QUAW.js +0 -63
- package/dist/chunk-UP3FJ7EK.mjs +0 -44
- package/dist/chunk-UQYEFGMG.mjs +0 -43
- package/dist/chunk-URX5VRVB.js +0 -24
- package/dist/chunk-USLYTOPD.mjs +0 -41
- package/dist/chunk-UUIIGFUZ.js +0 -33
- package/dist/chunk-UX7CIOBD.js +0 -61
- package/dist/chunk-V2AWKRQI.js +0 -26
- package/dist/chunk-V4JFB4H6.mjs +0 -45
- package/dist/chunk-V4P2FTIC.js +0 -72
- package/dist/chunk-VE3Q5LC3.mjs +0 -26
- package/dist/chunk-VKKQV6UO.js +0 -42
- package/dist/chunk-VOMHZHCC.js +0 -21
- package/dist/chunk-VTSJ33HJ.js +0 -18
- package/dist/chunk-VVELSEXL.mjs +0 -27
- package/dist/chunk-VX2IFBCP.mjs +0 -17008
- package/dist/chunk-VX346ARA.js +0 -42
- package/dist/chunk-VYV7BUJR.js +0 -42
- package/dist/chunk-W4CBCFMS.mjs +0 -36
- package/dist/chunk-W6QSJNDJ.js +0 -58
- package/dist/chunk-WDFGFSCS.js +0 -63
- package/dist/chunk-WGRAINAP.mjs +0 -43
- package/dist/chunk-WH4MHYUQ.mjs +0 -33
- package/dist/chunk-WJ6C635R.mjs +0 -45
- package/dist/chunk-WSYHZP5C.mjs +0 -28
- package/dist/chunk-X5WN73EF.js +0 -48
- package/dist/chunk-X7YFEBIL.mjs +0 -28
- package/dist/chunk-XB5AI72P.mjs +0 -24
- package/dist/chunk-XCCBDMTZ.mjs +0 -22
- package/dist/chunk-XG6RUZSI.mjs +0 -16
- package/dist/chunk-XGB3TDIC.mjs +0 -42
- package/dist/chunk-XI5L2ENL.js +0 -28
- package/dist/chunk-XIROUDIK.js +0 -151
- package/dist/chunk-XJ3B37LJ.js +0 -45
- package/dist/chunk-XJGSUINR.mjs +0 -24
- package/dist/chunk-XKWYGGIM.mjs +0 -36
- package/dist/chunk-XL5V4E3Z.js +0 -16
- package/dist/chunk-XMR5DWYS.mjs +0 -74
- package/dist/chunk-XN5RU4UY.js +0 -27
- package/dist/chunk-XR64DI5O.js +0 -31
- package/dist/chunk-XUZOVQYC.mjs +0 -42
- package/dist/chunk-XVQOUXV6.js +0 -48
- package/dist/chunk-XYNVAWSB.mjs +0 -45
- package/dist/chunk-Y2G3CY4Q.mjs +0 -51
- package/dist/chunk-YHZKCAK6.mjs +0 -49
- package/dist/chunk-YJXRZ5WX.mjs +0 -78
- package/dist/chunk-YNT5L5UH.js +0 -78
- package/dist/chunk-YRB3F2AG.mjs +0 -81
- package/dist/chunk-YRRALMO4.mjs +0 -36
- package/dist/chunk-YUFVOYYX.mjs +0 -57
- package/dist/chunk-YV3HYBCX.js +0 -45
- package/dist/chunk-YVASGALV.js +0 -81
- package/dist/chunk-YWFUY5A4.js +0 -30
- package/dist/chunk-YYSJWYK3.js +0 -21
- package/dist/chunk-YZNZHRY3.mjs +0 -81
- package/dist/chunk-Z46HCVNZ.js +0 -151
- package/dist/chunk-Z5HPFZ65.mjs +0 -35
- package/dist/chunk-ZADIRLZW.mjs +0 -56
- package/dist/chunk-ZAU43ZDI.mjs +0 -74
- package/dist/chunk-ZBU5LSC3.mjs +0 -45
- package/dist/chunk-ZDV7FI2F.js +0 -45
- package/dist/chunk-ZKVLWCGR.mjs +0 -63
- package/dist/chunk-ZN3MHVES.mjs +0 -57
- package/dist/chunk-ZPQ6LVKQ.mjs +0 -20
- package/dist/chunk-ZQA42PYM.mjs +0 -67
- package/dist/chunk-ZQYJPU4U.mjs +0 -76
- package/dist/chunk-ZSBGAX6X.js +0 -2022
- package/dist/chunk-ZT2QP4MD.mjs +0 -25
- package/dist/chunk-ZTUCFJLM.mjs +0 -33
- package/dist/chunk-ZWLHVT5O.js +0 -41
- package/dist/chunk-ZXWWD74E.mjs +0 -45
- package/dist/color-BT6BF8oV.d.mts +0 -61
- package/dist/color-BmTZnKiW.d.mts +0 -61
- package/dist/color-WFinq_Y4.d.ts +0 -61
- package/dist/color-lBH29suB.d.ts +0 -61
- package/dist/commerce-BqVjXEhQ.d.mts +0 -40
- package/dist/commerce-Ch71_dd2.d.ts +0 -40
- package/dist/commerce-IGFkOXjQ.d.mts +0 -40
- package/dist/commerce-mdOpchjx.d.ts +0 -40
- package/dist/common-CbuXAeQ-.d.mts +0 -11
- package/dist/common-IR_KozaJ.d.mts +0 -11
- package/dist/common-Kp8LaAzK.d.ts +0 -11
- package/dist/common-t-ZQebCq.d.ts +0 -11
- package/dist/company---O1IwYo.d.ts +0 -35
- package/dist/company-C3EU1J7k.d.ts +0 -35
- package/dist/company-D7Cc_hsx.d.mts +0 -35
- package/dist/company-cR_0hm6U.d.mts +0 -35
- package/dist/config-BTjogu5M.d.ts +0 -7
- package/dist/config-C1N2Brw-.d.mts +0 -7
- package/dist/config.d.mts +0 -2
- package/dist/config.mjs +0 -19
- package/dist/config_scheme.d.mts +0 -32
- package/dist/config_scheme.mjs +0 -17
- package/dist/create_config.d.mts +0 -58
- package/dist/create_config.mjs +0 -18
- package/dist/create_config.test.d.mts +0 -2
- package/dist/create_config.test.js +0 -63
- package/dist/create_config.test.mjs +0 -63
- package/dist/create_generator_fn.d.mts +0 -12
- package/dist/create_generator_fn.mjs +0 -20
- package/dist/create_generator_fn.test.d.mts +0 -2
- package/dist/create_generator_fn.test.js +0 -200
- package/dist/create_generator_fn.test.mjs +0 -200
- package/dist/database-B8Wr1oXH.d.mts +0 -23
- package/dist/database-DV9wgnca.d.ts +0 -23
- package/dist/database-Dnsy3cQb.d.ts +0 -23
- package/dist/database-UzO1Lwec.d.mts +0 -23
- package/dist/datatype-C92TZLxo.d.ts +0 -13
- package/dist/datatype-CAu_sc1g.d.ts +0 -13
- package/dist/datatype-DZjmP0fA.d.mts +0 -13
- package/dist/datatype-gjFHrdMj.d.mts +0 -13
- package/dist/datetime-BDgsnqq_.d.mts +0 -78
- package/dist/datetime-BkidbR1O.d.ts +0 -78
- package/dist/datetime-CSUpnUXU.d.ts +0 -78
- package/dist/datetime-dnPA_lnt.d.mts +0 -78
- package/dist/finance-BZEmlfNQ.d.mts +0 -90
- package/dist/finance-Cn3DFbX4.d.ts +0 -90
- package/dist/finance-CstKW1nH.d.mts +0 -90
- package/dist/finance-gj0fiEmf.d.ts +0 -90
- package/dist/food-CInj1GX2.d.ts +0 -35
- package/dist/food-CfxZX81O.d.mts +0 -35
- package/dist/food-Dk3-40CY.d.mts +0 -35
- package/dist/food-tr11e_Qp.d.ts +0 -35
- package/dist/generator_fn-CJDbnCZl.d.mts +0 -7
- package/dist/generator_fn-D-npAfnC.d.ts +0 -7
- package/dist/generator_fn.d.mts +0 -2
- package/dist/generator_fn.mjs +0 -21
- package/dist/git-BHL1ppL4.d.ts +0 -31
- package/dist/git-DoCI9ZYT.d.ts +0 -31
- package/dist/git-Feo1ntKa.d.mts +0 -31
- package/dist/git-w0nznSjX.d.mts +0 -31
- package/dist/hacker-DL7pR6JO.d.ts +0 -26
- package/dist/hacker-FcQXZGtz.d.mts +0 -26
- package/dist/hacker-X3zBTMoE.d.ts +0 -26
- package/dist/hacker-mGVIO_wL.d.mts +0 -26
- package/dist/image-B5OPCNhD.d.mts +0 -56
- package/dist/image-BeZbZlyo.d.ts +0 -56
- package/dist/image-IyGCgqNf.d.ts +0 -56
- package/dist/image-govZ7HjA.d.mts +0 -56
- package/dist/index.d.mts +0 -5
- package/dist/index.mjs +0 -43
- package/dist/internet-BWBjFZ1E.d.mts +0 -101
- package/dist/internet-BukCBMX-.d.ts +0 -106
- package/dist/internet-C2ElurWb.d.mts +0 -106
- package/dist/internet-CH_7YDHs.d.mts +0 -106
- package/dist/internet-CJEETk0v.d.mts +0 -101
- package/dist/internet-DLYaMWtd.d.ts +0 -106
- package/dist/internet-WmWuV39U.d.ts +0 -101
- package/dist/internet-jHHnqVJG.d.ts +0 -101
- package/dist/location-BIZ-KsaI.d.ts +0 -80
- package/dist/location-CTA_Bq7w.d.mts +0 -80
- package/dist/location-CsVekxIU.d.ts +0 -80
- package/dist/location-WU_nRdjx.d.mts +0 -80
- package/dist/lorem-BE4n3dVs.d.mts +0 -62
- package/dist/lorem-Btv0fltY.d.ts +0 -62
- package/dist/lorem-OlHaVntu.d.mts +0 -62
- package/dist/lorem-yMyLb-d-.d.ts +0 -62
- package/dist/magic-string.es-2DLPM6Q3.js +0 -1299
- package/dist/magic-string.es-NHTKQXSF.mjs +0 -1299
- package/dist/magic-string.es-PQN52XPX.js +0 -1288
- package/dist/magic-string.es-X3ME2TR2.mjs +0 -1288
- package/dist/music-CQ3lnDvg.d.mts +0 -20
- package/dist/music-D3zj5REe.d.ts +0 -20
- package/dist/music-P8XZ4JSO.d.ts +0 -20
- package/dist/music-vcWm9dzu.d.mts +0 -20
- package/dist/number-BfwwKvTJ.d.mts +0 -48
- package/dist/number-Bj9ydAOH.d.ts +0 -47
- package/dist/number-D5QmTRsK.d.ts +0 -48
- package/dist/number-D9Wn_qjS.d.mts +0 -47
- package/dist/number-DomDs-l5.d.mts +0 -47
- package/dist/number-DvzbKHZR.d.ts +0 -47
- package/dist/person-DXne2mKX.d.ts +0 -58
- package/dist/person-LLleVozS.d.ts +0 -58
- package/dist/person-OKRyYmeX.d.mts +0 -58
- package/dist/person-Si_vy67g.d.mts +0 -58
- package/dist/phone-Bc8UXPF3.d.ts +0 -16
- package/dist/phone-Cbxvm_Qv.d.ts +0 -16
- package/dist/phone-QbHXAqVF.d.mts +0 -16
- package/dist/phone-g4FDs50M.d.mts +0 -16
- package/dist/science-BX8WhoEY.d.ts +0 -15
- package/dist/science-BfA9sVXz.d.mts +0 -15
- package/dist/science-BgXAZ3YR.d.ts +0 -15
- package/dist/science-CSN41yUZ.d.mts +0 -15
- package/dist/string-9w976kVk.d.mts +0 -87
- package/dist/string-Cm9TczI6.d.ts +0 -87
- package/dist/string-DGScZrrP.d.mts +0 -87
- package/dist/string-Do4vhsl0.d.ts +0 -87
- package/dist/system-BpxbduIr.d.ts +0 -55
- package/dist/system-Cy0e05Cr.d.mts +0 -55
- package/dist/system-DOyHjHxs.d.mts +0 -55
- package/dist/system-DipW6DYb.d.ts +0 -55
- package/dist/system-EuG0S2Xy.d.mts +0 -55
- package/dist/system-ZV2S9Qw2.d.ts +0 -55
- package/dist/test.d.mts +0 -2
- package/dist/test.d.ts +0 -2
- package/dist/test.js +0 -15
- package/dist/test.mjs +0 -15
- package/dist/type-C8Ny1fB6.d.mts +0 -33
- package/dist/type-C8Ny1fB6.d.ts +0 -33
- package/dist/type.d.mts +0 -93
- package/dist/type.mjs +0 -1
- package/dist/utils/airline.d.mts +0 -3
- package/dist/utils/airline.mjs +0 -14
- package/dist/utils/animal.d.mts +0 -2
- package/dist/utils/animal.mjs +0 -38
- package/dist/utils/color.d.mts +0 -3
- package/dist/utils/color.mjs +0 -30
- package/dist/utils/commerce.d.mts +0 -2
- package/dist/utils/commerce.mjs +0 -24
- package/dist/utils/common.d.mts +0 -2
- package/dist/utils/common.mjs +0 -9
- package/dist/utils/company.d.mts +0 -2
- package/dist/utils/company.mjs +0 -26
- package/dist/utils/database.d.mts +0 -2
- package/dist/utils/database.mjs +0 -18
- package/dist/utils/datatype.d.mts +0 -2
- package/dist/utils/datatype.mjs +0 -10
- package/dist/utils/datetime.d.mts +0 -2
- package/dist/utils/datetime.mjs +0 -30
- package/dist/utils/finance.d.mts +0 -3
- package/dist/utils/finance.mjs +0 -46
- package/dist/utils/food.d.mts +0 -2
- package/dist/utils/food.mjs +0 -26
- package/dist/utils/git.d.mts +0 -2
- package/dist/utils/git.mjs +0 -18
- package/dist/utils/hacker.d.mts +0 -2
- package/dist/utils/hacker.mjs +0 -20
- package/dist/utils/image.d.mts +0 -2
- package/dist/utils/image.mjs +0 -24
- package/dist/utils/index.d.mts +0 -28
- package/dist/utils/index.mjs +0 -109
- package/dist/utils/internet.d.mts +0 -3
- package/dist/utils/internet.mjs +0 -48
- package/dist/utils/location.d.mts +0 -2
- package/dist/utils/location.mjs +0 -40
- package/dist/utils/lorem.d.mts +0 -2
- package/dist/utils/lorem.mjs +0 -26
- package/dist/utils/music.d.mts +0 -2
- package/dist/utils/music.mjs +0 -16
- package/dist/utils/number.d.mts +0 -2
- package/dist/utils/number.mjs +0 -20
- package/dist/utils/person.d.mts +0 -3
- package/dist/utils/person.mjs +0 -38
- package/dist/utils/phone.d.mts +0 -2
- package/dist/utils/phone.mjs +0 -12
- package/dist/utils/science.d.mts +0 -3
- package/dist/utils/science.mjs +0 -12
- package/dist/utils/string.d.mts +0 -2
- package/dist/utils/string.mjs +0 -28
- package/dist/utils/system.d.mts +0 -2
- package/dist/utils/system.mjs +0 -32
- package/dist/utils/utils.d.mts +0 -2
- package/dist/utils/utils.mjs +0 -9
- package/dist/utils/vehicle.d.mts +0 -2
- package/dist/utils/vehicle.mjs +0 -26
- package/dist/utils/word.d.mts +0 -75
- package/dist/utils/word.mjs +0 -29
- package/dist/utils-BImnOpvp.d.ts +0 -10
- package/dist/utils-BiDlGzTl.d.mts +0 -10
- package/dist/utils-DinJc3Cq.d.ts +0 -10
- package/dist/utils-zJKwaMUY.d.mts +0 -10
- package/dist/vehicle-D4yBDYMc.d.mts +0 -35
- package/dist/vehicle-DmBDda98.d.mts +0 -35
- package/dist/vehicle-Ufz4AoXu.d.ts +0 -35
- package/dist/vehicle-rnBz1Za2.d.ts +0 -35
- package/src/config.ts +0 -8
- package/src/config_scheme.ts +0 -41
- package/src/create_config.test.ts +0 -71
- package/src/create_config.ts +0 -170
- package/src/create_generator_fn.test.ts +0 -229
- package/src/create_generator_fn.ts +0 -343
- package/src/generator_fn.ts +0 -9
- package/src/index.ts +0 -5
- package/src/type.ts +0 -167
- package/src/utils/airline.ts +0 -11
- package/src/utils/animal.ts +0 -47
- package/src/utils/color.ts +0 -41
- package/src/utils/commerce.ts +0 -32
- package/src/utils/common.ts +0 -4
- package/src/utils/company.ts +0 -33
- package/src/utils/database.ts +0 -19
- package/src/utils/datatype.ts +0 -5
- package/src/utils/datetime.ts +0 -35
- package/src/utils/finance.ts +0 -65
- package/src/utils/food.ts +0 -29
- package/src/utils/git.ts +0 -17
- package/src/utils/hacker.ts +0 -20
- package/src/utils/image.ts +0 -26
- package/src/utils/index.ts +0 -27
- package/src/utils/internet.ts +0 -62
- package/src/utils/location.ts +0 -58
- package/src/utils/lorem.ts +0 -29
- package/src/utils/music.ts +0 -14
- package/src/utils/number.ts +0 -20
- package/src/utils/person.ts +0 -47
- package/src/utils/phone.ts +0 -8
- package/src/utils/science.ts +0 -8
- package/src/utils/string.ts +0 -32
- package/src/utils/system.ts +0 -40
- package/src/utils/utils.ts +0 -8
- package/src/utils/vehicle.ts +0 -29
- package/src/utils/word.ts +0 -29
- package/tsconfig.json +0 -17
- package/tsup.config.ts +0 -8
|
@@ -1,1299 +0,0 @@
|
|
|
1
|
-
import "./chunk-XGB3TDIC.mjs";
|
|
2
|
-
|
|
3
|
-
// node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
4
|
-
var comma = ",".charCodeAt(0);
|
|
5
|
-
var semicolon = ";".charCodeAt(0);
|
|
6
|
-
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
7
|
-
var intToChar = new Uint8Array(64);
|
|
8
|
-
var charToInt = new Uint8Array(128);
|
|
9
|
-
for (let i = 0; i < chars.length; i++) {
|
|
10
|
-
const c = chars.charCodeAt(i);
|
|
11
|
-
intToChar[i] = c;
|
|
12
|
-
charToInt[c] = i;
|
|
13
|
-
}
|
|
14
|
-
function encodeInteger(builder, num, relative) {
|
|
15
|
-
let delta = num - relative;
|
|
16
|
-
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
|
|
17
|
-
do {
|
|
18
|
-
let clamped = delta & 31;
|
|
19
|
-
delta >>>= 5;
|
|
20
|
-
if (delta > 0)
|
|
21
|
-
clamped |= 32;
|
|
22
|
-
builder.write(intToChar[clamped]);
|
|
23
|
-
} while (delta > 0);
|
|
24
|
-
return num;
|
|
25
|
-
}
|
|
26
|
-
var bufLength = 1024 * 16;
|
|
27
|
-
var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
|
28
|
-
decode(buf) {
|
|
29
|
-
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
30
|
-
return out.toString();
|
|
31
|
-
}
|
|
32
|
-
} : {
|
|
33
|
-
decode(buf) {
|
|
34
|
-
let out = "";
|
|
35
|
-
for (let i = 0; i < buf.length; i++) {
|
|
36
|
-
out += String.fromCharCode(buf[i]);
|
|
37
|
-
}
|
|
38
|
-
return out;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var StringWriter = class {
|
|
42
|
-
constructor() {
|
|
43
|
-
this.pos = 0;
|
|
44
|
-
this.out = "";
|
|
45
|
-
this.buffer = new Uint8Array(bufLength);
|
|
46
|
-
}
|
|
47
|
-
write(v) {
|
|
48
|
-
const { buffer } = this;
|
|
49
|
-
buffer[this.pos++] = v;
|
|
50
|
-
if (this.pos === bufLength) {
|
|
51
|
-
this.out += td.decode(buffer);
|
|
52
|
-
this.pos = 0;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
flush() {
|
|
56
|
-
const { buffer, out, pos } = this;
|
|
57
|
-
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
function encode(decoded) {
|
|
61
|
-
const writer = new StringWriter();
|
|
62
|
-
let sourcesIndex = 0;
|
|
63
|
-
let sourceLine = 0;
|
|
64
|
-
let sourceColumn = 0;
|
|
65
|
-
let namesIndex = 0;
|
|
66
|
-
for (let i = 0; i < decoded.length; i++) {
|
|
67
|
-
const line = decoded[i];
|
|
68
|
-
if (i > 0)
|
|
69
|
-
writer.write(semicolon);
|
|
70
|
-
if (line.length === 0)
|
|
71
|
-
continue;
|
|
72
|
-
let genColumn = 0;
|
|
73
|
-
for (let j = 0; j < line.length; j++) {
|
|
74
|
-
const segment = line[j];
|
|
75
|
-
if (j > 0)
|
|
76
|
-
writer.write(comma);
|
|
77
|
-
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
78
|
-
if (segment.length === 1)
|
|
79
|
-
continue;
|
|
80
|
-
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
|
|
81
|
-
sourceLine = encodeInteger(writer, segment[2], sourceLine);
|
|
82
|
-
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
|
|
83
|
-
if (segment.length === 4)
|
|
84
|
-
continue;
|
|
85
|
-
namesIndex = encodeInteger(writer, segment[4], namesIndex);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return writer.flush();
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.es.mjs
|
|
92
|
-
var BitSet = class _BitSet {
|
|
93
|
-
constructor(arg) {
|
|
94
|
-
this.bits = arg instanceof _BitSet ? arg.bits.slice() : [];
|
|
95
|
-
}
|
|
96
|
-
add(n2) {
|
|
97
|
-
this.bits[n2 >> 5] |= 1 << (n2 & 31);
|
|
98
|
-
}
|
|
99
|
-
has(n2) {
|
|
100
|
-
return !!(this.bits[n2 >> 5] & 1 << (n2 & 31));
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
var Chunk = class _Chunk {
|
|
104
|
-
constructor(start, end, content) {
|
|
105
|
-
this.start = start;
|
|
106
|
-
this.end = end;
|
|
107
|
-
this.original = content;
|
|
108
|
-
this.intro = "";
|
|
109
|
-
this.outro = "";
|
|
110
|
-
this.content = content;
|
|
111
|
-
this.storeName = false;
|
|
112
|
-
this.edited = false;
|
|
113
|
-
{
|
|
114
|
-
this.previous = null;
|
|
115
|
-
this.next = null;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
appendLeft(content) {
|
|
119
|
-
this.outro += content;
|
|
120
|
-
}
|
|
121
|
-
appendRight(content) {
|
|
122
|
-
this.intro = this.intro + content;
|
|
123
|
-
}
|
|
124
|
-
clone() {
|
|
125
|
-
const chunk = new _Chunk(this.start, this.end, this.original);
|
|
126
|
-
chunk.intro = this.intro;
|
|
127
|
-
chunk.outro = this.outro;
|
|
128
|
-
chunk.content = this.content;
|
|
129
|
-
chunk.storeName = this.storeName;
|
|
130
|
-
chunk.edited = this.edited;
|
|
131
|
-
return chunk;
|
|
132
|
-
}
|
|
133
|
-
contains(index) {
|
|
134
|
-
return this.start < index && index < this.end;
|
|
135
|
-
}
|
|
136
|
-
eachNext(fn) {
|
|
137
|
-
let chunk = this;
|
|
138
|
-
while (chunk) {
|
|
139
|
-
fn(chunk);
|
|
140
|
-
chunk = chunk.next;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
eachPrevious(fn) {
|
|
144
|
-
let chunk = this;
|
|
145
|
-
while (chunk) {
|
|
146
|
-
fn(chunk);
|
|
147
|
-
chunk = chunk.previous;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
edit(content, storeName, contentOnly) {
|
|
151
|
-
this.content = content;
|
|
152
|
-
if (!contentOnly) {
|
|
153
|
-
this.intro = "";
|
|
154
|
-
this.outro = "";
|
|
155
|
-
}
|
|
156
|
-
this.storeName = storeName;
|
|
157
|
-
this.edited = true;
|
|
158
|
-
return this;
|
|
159
|
-
}
|
|
160
|
-
prependLeft(content) {
|
|
161
|
-
this.outro = content + this.outro;
|
|
162
|
-
}
|
|
163
|
-
prependRight(content) {
|
|
164
|
-
this.intro = content + this.intro;
|
|
165
|
-
}
|
|
166
|
-
reset() {
|
|
167
|
-
this.intro = "";
|
|
168
|
-
this.outro = "";
|
|
169
|
-
if (this.edited) {
|
|
170
|
-
this.content = this.original;
|
|
171
|
-
this.storeName = false;
|
|
172
|
-
this.edited = false;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
split(index) {
|
|
176
|
-
const sliceIndex = index - this.start;
|
|
177
|
-
const originalBefore = this.original.slice(0, sliceIndex);
|
|
178
|
-
const originalAfter = this.original.slice(sliceIndex);
|
|
179
|
-
this.original = originalBefore;
|
|
180
|
-
const newChunk = new _Chunk(index, this.end, originalAfter);
|
|
181
|
-
newChunk.outro = this.outro;
|
|
182
|
-
this.outro = "";
|
|
183
|
-
this.end = index;
|
|
184
|
-
if (this.edited) {
|
|
185
|
-
newChunk.edit("", false);
|
|
186
|
-
this.content = "";
|
|
187
|
-
} else {
|
|
188
|
-
this.content = originalBefore;
|
|
189
|
-
}
|
|
190
|
-
newChunk.next = this.next;
|
|
191
|
-
if (newChunk.next) newChunk.next.previous = newChunk;
|
|
192
|
-
newChunk.previous = this;
|
|
193
|
-
this.next = newChunk;
|
|
194
|
-
return newChunk;
|
|
195
|
-
}
|
|
196
|
-
toString() {
|
|
197
|
-
return this.intro + this.content + this.outro;
|
|
198
|
-
}
|
|
199
|
-
trimEnd(rx) {
|
|
200
|
-
this.outro = this.outro.replace(rx, "");
|
|
201
|
-
if (this.outro.length) return true;
|
|
202
|
-
const trimmed = this.content.replace(rx, "");
|
|
203
|
-
if (trimmed.length) {
|
|
204
|
-
if (trimmed !== this.content) {
|
|
205
|
-
this.split(this.start + trimmed.length).edit("", void 0, true);
|
|
206
|
-
if (this.edited) {
|
|
207
|
-
this.edit(trimmed, this.storeName, true);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
return true;
|
|
211
|
-
} else {
|
|
212
|
-
this.edit("", void 0, true);
|
|
213
|
-
this.intro = this.intro.replace(rx, "");
|
|
214
|
-
if (this.intro.length) return true;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
trimStart(rx) {
|
|
218
|
-
this.intro = this.intro.replace(rx, "");
|
|
219
|
-
if (this.intro.length) return true;
|
|
220
|
-
const trimmed = this.content.replace(rx, "");
|
|
221
|
-
if (trimmed.length) {
|
|
222
|
-
if (trimmed !== this.content) {
|
|
223
|
-
const newChunk = this.split(this.end - trimmed.length);
|
|
224
|
-
if (this.edited) {
|
|
225
|
-
newChunk.edit(trimmed, this.storeName, true);
|
|
226
|
-
}
|
|
227
|
-
this.edit("", void 0, true);
|
|
228
|
-
}
|
|
229
|
-
return true;
|
|
230
|
-
} else {
|
|
231
|
-
this.edit("", void 0, true);
|
|
232
|
-
this.outro = this.outro.replace(rx, "");
|
|
233
|
-
if (this.outro.length) return true;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
function getBtoa() {
|
|
238
|
-
if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function") {
|
|
239
|
-
return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
|
|
240
|
-
} else if (typeof Buffer === "function") {
|
|
241
|
-
return (str) => Buffer.from(str, "utf-8").toString("base64");
|
|
242
|
-
} else {
|
|
243
|
-
return () => {
|
|
244
|
-
throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
var btoa = /* @__PURE__ */ getBtoa();
|
|
249
|
-
var SourceMap = class {
|
|
250
|
-
constructor(properties) {
|
|
251
|
-
this.version = 3;
|
|
252
|
-
this.file = properties.file;
|
|
253
|
-
this.sources = properties.sources;
|
|
254
|
-
this.sourcesContent = properties.sourcesContent;
|
|
255
|
-
this.names = properties.names;
|
|
256
|
-
this.mappings = encode(properties.mappings);
|
|
257
|
-
if (typeof properties.x_google_ignoreList !== "undefined") {
|
|
258
|
-
this.x_google_ignoreList = properties.x_google_ignoreList;
|
|
259
|
-
}
|
|
260
|
-
if (typeof properties.debugId !== "undefined") {
|
|
261
|
-
this.debugId = properties.debugId;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
toString() {
|
|
265
|
-
return JSON.stringify(this);
|
|
266
|
-
}
|
|
267
|
-
toUrl() {
|
|
268
|
-
return "data:application/json;charset=utf-8;base64," + btoa(this.toString());
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
function guessIndent(code) {
|
|
272
|
-
const lines = code.split("\n");
|
|
273
|
-
const tabbed = lines.filter((line) => /^\t+/.test(line));
|
|
274
|
-
const spaced = lines.filter((line) => /^ {2,}/.test(line));
|
|
275
|
-
if (tabbed.length === 0 && spaced.length === 0) {
|
|
276
|
-
return null;
|
|
277
|
-
}
|
|
278
|
-
if (tabbed.length >= spaced.length) {
|
|
279
|
-
return " ";
|
|
280
|
-
}
|
|
281
|
-
const min = spaced.reduce((previous, current) => {
|
|
282
|
-
const numSpaces = /^ +/.exec(current)[0].length;
|
|
283
|
-
return Math.min(numSpaces, previous);
|
|
284
|
-
}, Infinity);
|
|
285
|
-
return new Array(min + 1).join(" ");
|
|
286
|
-
}
|
|
287
|
-
function getRelativePath(from, to) {
|
|
288
|
-
const fromParts = from.split(/[/\\]/);
|
|
289
|
-
const toParts = to.split(/[/\\]/);
|
|
290
|
-
fromParts.pop();
|
|
291
|
-
while (fromParts[0] === toParts[0]) {
|
|
292
|
-
fromParts.shift();
|
|
293
|
-
toParts.shift();
|
|
294
|
-
}
|
|
295
|
-
if (fromParts.length) {
|
|
296
|
-
let i = fromParts.length;
|
|
297
|
-
while (i--) fromParts[i] = "..";
|
|
298
|
-
}
|
|
299
|
-
return fromParts.concat(toParts).join("/");
|
|
300
|
-
}
|
|
301
|
-
var toString = Object.prototype.toString;
|
|
302
|
-
function isObject(thing) {
|
|
303
|
-
return toString.call(thing) === "[object Object]";
|
|
304
|
-
}
|
|
305
|
-
function getLocator(source) {
|
|
306
|
-
const originalLines = source.split("\n");
|
|
307
|
-
const lineOffsets = [];
|
|
308
|
-
for (let i = 0, pos = 0; i < originalLines.length; i++) {
|
|
309
|
-
lineOffsets.push(pos);
|
|
310
|
-
pos += originalLines[i].length + 1;
|
|
311
|
-
}
|
|
312
|
-
return function locate(index) {
|
|
313
|
-
let i = 0;
|
|
314
|
-
let j = lineOffsets.length;
|
|
315
|
-
while (i < j) {
|
|
316
|
-
const m = i + j >> 1;
|
|
317
|
-
if (index < lineOffsets[m]) {
|
|
318
|
-
j = m;
|
|
319
|
-
} else {
|
|
320
|
-
i = m + 1;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
const line = i - 1;
|
|
324
|
-
const column = index - lineOffsets[line];
|
|
325
|
-
return { line, column };
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
var wordRegex = /\w/;
|
|
329
|
-
var Mappings = class {
|
|
330
|
-
constructor(hires) {
|
|
331
|
-
this.hires = hires;
|
|
332
|
-
this.generatedCodeLine = 0;
|
|
333
|
-
this.generatedCodeColumn = 0;
|
|
334
|
-
this.raw = [];
|
|
335
|
-
this.rawSegments = this.raw[this.generatedCodeLine] = [];
|
|
336
|
-
this.pending = null;
|
|
337
|
-
}
|
|
338
|
-
addEdit(sourceIndex, content, loc, nameIndex) {
|
|
339
|
-
if (content.length) {
|
|
340
|
-
const contentLengthMinusOne = content.length - 1;
|
|
341
|
-
let contentLineEnd = content.indexOf("\n", 0);
|
|
342
|
-
let previousContentLineEnd = -1;
|
|
343
|
-
while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {
|
|
344
|
-
const segment2 = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
345
|
-
if (nameIndex >= 0) {
|
|
346
|
-
segment2.push(nameIndex);
|
|
347
|
-
}
|
|
348
|
-
this.rawSegments.push(segment2);
|
|
349
|
-
this.generatedCodeLine += 1;
|
|
350
|
-
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
351
|
-
this.generatedCodeColumn = 0;
|
|
352
|
-
previousContentLineEnd = contentLineEnd;
|
|
353
|
-
contentLineEnd = content.indexOf("\n", contentLineEnd + 1);
|
|
354
|
-
}
|
|
355
|
-
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
356
|
-
if (nameIndex >= 0) {
|
|
357
|
-
segment.push(nameIndex);
|
|
358
|
-
}
|
|
359
|
-
this.rawSegments.push(segment);
|
|
360
|
-
this.advance(content.slice(previousContentLineEnd + 1));
|
|
361
|
-
} else if (this.pending) {
|
|
362
|
-
this.rawSegments.push(this.pending);
|
|
363
|
-
this.advance(content);
|
|
364
|
-
}
|
|
365
|
-
this.pending = null;
|
|
366
|
-
}
|
|
367
|
-
addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
|
|
368
|
-
let originalCharIndex = chunk.start;
|
|
369
|
-
let first = true;
|
|
370
|
-
let charInHiresBoundary = false;
|
|
371
|
-
while (originalCharIndex < chunk.end) {
|
|
372
|
-
if (original[originalCharIndex] === "\n") {
|
|
373
|
-
loc.line += 1;
|
|
374
|
-
loc.column = 0;
|
|
375
|
-
this.generatedCodeLine += 1;
|
|
376
|
-
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
377
|
-
this.generatedCodeColumn = 0;
|
|
378
|
-
first = true;
|
|
379
|
-
charInHiresBoundary = false;
|
|
380
|
-
} else {
|
|
381
|
-
if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
|
|
382
|
-
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
383
|
-
if (this.hires === "boundary") {
|
|
384
|
-
if (wordRegex.test(original[originalCharIndex])) {
|
|
385
|
-
if (!charInHiresBoundary) {
|
|
386
|
-
this.rawSegments.push(segment);
|
|
387
|
-
charInHiresBoundary = true;
|
|
388
|
-
}
|
|
389
|
-
} else {
|
|
390
|
-
this.rawSegments.push(segment);
|
|
391
|
-
charInHiresBoundary = false;
|
|
392
|
-
}
|
|
393
|
-
} else {
|
|
394
|
-
this.rawSegments.push(segment);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
loc.column += 1;
|
|
398
|
-
this.generatedCodeColumn += 1;
|
|
399
|
-
first = false;
|
|
400
|
-
}
|
|
401
|
-
originalCharIndex += 1;
|
|
402
|
-
}
|
|
403
|
-
this.pending = null;
|
|
404
|
-
}
|
|
405
|
-
advance(str) {
|
|
406
|
-
if (!str) return;
|
|
407
|
-
const lines = str.split("\n");
|
|
408
|
-
if (lines.length > 1) {
|
|
409
|
-
for (let i = 0; i < lines.length - 1; i++) {
|
|
410
|
-
this.generatedCodeLine++;
|
|
411
|
-
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
412
|
-
}
|
|
413
|
-
this.generatedCodeColumn = 0;
|
|
414
|
-
}
|
|
415
|
-
this.generatedCodeColumn += lines[lines.length - 1].length;
|
|
416
|
-
}
|
|
417
|
-
};
|
|
418
|
-
var n = "\n";
|
|
419
|
-
var warned = {
|
|
420
|
-
insertLeft: false,
|
|
421
|
-
insertRight: false,
|
|
422
|
-
storeName: false
|
|
423
|
-
};
|
|
424
|
-
var MagicString = class _MagicString {
|
|
425
|
-
constructor(string, options = {}) {
|
|
426
|
-
const chunk = new Chunk(0, string.length, string);
|
|
427
|
-
Object.defineProperties(this, {
|
|
428
|
-
original: { writable: true, value: string },
|
|
429
|
-
outro: { writable: true, value: "" },
|
|
430
|
-
intro: { writable: true, value: "" },
|
|
431
|
-
firstChunk: { writable: true, value: chunk },
|
|
432
|
-
lastChunk: { writable: true, value: chunk },
|
|
433
|
-
lastSearchedChunk: { writable: true, value: chunk },
|
|
434
|
-
byStart: { writable: true, value: {} },
|
|
435
|
-
byEnd: { writable: true, value: {} },
|
|
436
|
-
filename: { writable: true, value: options.filename },
|
|
437
|
-
indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
|
|
438
|
-
sourcemapLocations: { writable: true, value: new BitSet() },
|
|
439
|
-
storedNames: { writable: true, value: {} },
|
|
440
|
-
indentStr: { writable: true, value: void 0 },
|
|
441
|
-
ignoreList: { writable: true, value: options.ignoreList },
|
|
442
|
-
offset: { writable: true, value: options.offset || 0 }
|
|
443
|
-
});
|
|
444
|
-
this.byStart[0] = chunk;
|
|
445
|
-
this.byEnd[string.length] = chunk;
|
|
446
|
-
}
|
|
447
|
-
addSourcemapLocation(char) {
|
|
448
|
-
this.sourcemapLocations.add(char);
|
|
449
|
-
}
|
|
450
|
-
append(content) {
|
|
451
|
-
if (typeof content !== "string") throw new TypeError("outro content must be a string");
|
|
452
|
-
this.outro += content;
|
|
453
|
-
return this;
|
|
454
|
-
}
|
|
455
|
-
appendLeft(index, content) {
|
|
456
|
-
index = index + this.offset;
|
|
457
|
-
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
458
|
-
this._split(index);
|
|
459
|
-
const chunk = this.byEnd[index];
|
|
460
|
-
if (chunk) {
|
|
461
|
-
chunk.appendLeft(content);
|
|
462
|
-
} else {
|
|
463
|
-
this.intro += content;
|
|
464
|
-
}
|
|
465
|
-
return this;
|
|
466
|
-
}
|
|
467
|
-
appendRight(index, content) {
|
|
468
|
-
index = index + this.offset;
|
|
469
|
-
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
470
|
-
this._split(index);
|
|
471
|
-
const chunk = this.byStart[index];
|
|
472
|
-
if (chunk) {
|
|
473
|
-
chunk.appendRight(content);
|
|
474
|
-
} else {
|
|
475
|
-
this.outro += content;
|
|
476
|
-
}
|
|
477
|
-
return this;
|
|
478
|
-
}
|
|
479
|
-
clone() {
|
|
480
|
-
const cloned = new _MagicString(this.original, { filename: this.filename, offset: this.offset });
|
|
481
|
-
let originalChunk = this.firstChunk;
|
|
482
|
-
let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
|
|
483
|
-
while (originalChunk) {
|
|
484
|
-
cloned.byStart[clonedChunk.start] = clonedChunk;
|
|
485
|
-
cloned.byEnd[clonedChunk.end] = clonedChunk;
|
|
486
|
-
const nextOriginalChunk = originalChunk.next;
|
|
487
|
-
const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
|
|
488
|
-
if (nextClonedChunk) {
|
|
489
|
-
clonedChunk.next = nextClonedChunk;
|
|
490
|
-
nextClonedChunk.previous = clonedChunk;
|
|
491
|
-
clonedChunk = nextClonedChunk;
|
|
492
|
-
}
|
|
493
|
-
originalChunk = nextOriginalChunk;
|
|
494
|
-
}
|
|
495
|
-
cloned.lastChunk = clonedChunk;
|
|
496
|
-
if (this.indentExclusionRanges) {
|
|
497
|
-
cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
|
|
498
|
-
}
|
|
499
|
-
cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
|
|
500
|
-
cloned.intro = this.intro;
|
|
501
|
-
cloned.outro = this.outro;
|
|
502
|
-
return cloned;
|
|
503
|
-
}
|
|
504
|
-
generateDecodedMap(options) {
|
|
505
|
-
options = options || {};
|
|
506
|
-
const sourceIndex = 0;
|
|
507
|
-
const names = Object.keys(this.storedNames);
|
|
508
|
-
const mappings = new Mappings(options.hires);
|
|
509
|
-
const locate = getLocator(this.original);
|
|
510
|
-
if (this.intro) {
|
|
511
|
-
mappings.advance(this.intro);
|
|
512
|
-
}
|
|
513
|
-
this.firstChunk.eachNext((chunk) => {
|
|
514
|
-
const loc = locate(chunk.start);
|
|
515
|
-
if (chunk.intro.length) mappings.advance(chunk.intro);
|
|
516
|
-
if (chunk.edited) {
|
|
517
|
-
mappings.addEdit(
|
|
518
|
-
sourceIndex,
|
|
519
|
-
chunk.content,
|
|
520
|
-
loc,
|
|
521
|
-
chunk.storeName ? names.indexOf(chunk.original) : -1
|
|
522
|
-
);
|
|
523
|
-
} else {
|
|
524
|
-
mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
|
|
525
|
-
}
|
|
526
|
-
if (chunk.outro.length) mappings.advance(chunk.outro);
|
|
527
|
-
});
|
|
528
|
-
return {
|
|
529
|
-
file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
|
|
530
|
-
sources: [
|
|
531
|
-
options.source ? getRelativePath(options.file || "", options.source) : options.file || ""
|
|
532
|
-
],
|
|
533
|
-
sourcesContent: options.includeContent ? [this.original] : void 0,
|
|
534
|
-
names,
|
|
535
|
-
mappings: mappings.raw,
|
|
536
|
-
x_google_ignoreList: this.ignoreList ? [sourceIndex] : void 0
|
|
537
|
-
};
|
|
538
|
-
}
|
|
539
|
-
generateMap(options) {
|
|
540
|
-
return new SourceMap(this.generateDecodedMap(options));
|
|
541
|
-
}
|
|
542
|
-
_ensureindentStr() {
|
|
543
|
-
if (this.indentStr === void 0) {
|
|
544
|
-
this.indentStr = guessIndent(this.original);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
_getRawIndentString() {
|
|
548
|
-
this._ensureindentStr();
|
|
549
|
-
return this.indentStr;
|
|
550
|
-
}
|
|
551
|
-
getIndentString() {
|
|
552
|
-
this._ensureindentStr();
|
|
553
|
-
return this.indentStr === null ? " " : this.indentStr;
|
|
554
|
-
}
|
|
555
|
-
indent(indentStr, options) {
|
|
556
|
-
const pattern = /^[^\r\n]/gm;
|
|
557
|
-
if (isObject(indentStr)) {
|
|
558
|
-
options = indentStr;
|
|
559
|
-
indentStr = void 0;
|
|
560
|
-
}
|
|
561
|
-
if (indentStr === void 0) {
|
|
562
|
-
this._ensureindentStr();
|
|
563
|
-
indentStr = this.indentStr || " ";
|
|
564
|
-
}
|
|
565
|
-
if (indentStr === "") return this;
|
|
566
|
-
options = options || {};
|
|
567
|
-
const isExcluded = {};
|
|
568
|
-
if (options.exclude) {
|
|
569
|
-
const exclusions = typeof options.exclude[0] === "number" ? [options.exclude] : options.exclude;
|
|
570
|
-
exclusions.forEach((exclusion) => {
|
|
571
|
-
for (let i = exclusion[0]; i < exclusion[1]; i += 1) {
|
|
572
|
-
isExcluded[i] = true;
|
|
573
|
-
}
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
let shouldIndentNextCharacter = options.indentStart !== false;
|
|
577
|
-
const replacer = (match) => {
|
|
578
|
-
if (shouldIndentNextCharacter) return `${indentStr}${match}`;
|
|
579
|
-
shouldIndentNextCharacter = true;
|
|
580
|
-
return match;
|
|
581
|
-
};
|
|
582
|
-
this.intro = this.intro.replace(pattern, replacer);
|
|
583
|
-
let charIndex = 0;
|
|
584
|
-
let chunk = this.firstChunk;
|
|
585
|
-
while (chunk) {
|
|
586
|
-
const end = chunk.end;
|
|
587
|
-
if (chunk.edited) {
|
|
588
|
-
if (!isExcluded[charIndex]) {
|
|
589
|
-
chunk.content = chunk.content.replace(pattern, replacer);
|
|
590
|
-
if (chunk.content.length) {
|
|
591
|
-
shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === "\n";
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
} else {
|
|
595
|
-
charIndex = chunk.start;
|
|
596
|
-
while (charIndex < end) {
|
|
597
|
-
if (!isExcluded[charIndex]) {
|
|
598
|
-
const char = this.original[charIndex];
|
|
599
|
-
if (char === "\n") {
|
|
600
|
-
shouldIndentNextCharacter = true;
|
|
601
|
-
} else if (char !== "\r" && shouldIndentNextCharacter) {
|
|
602
|
-
shouldIndentNextCharacter = false;
|
|
603
|
-
if (charIndex === chunk.start) {
|
|
604
|
-
chunk.prependRight(indentStr);
|
|
605
|
-
} else {
|
|
606
|
-
this._splitChunk(chunk, charIndex);
|
|
607
|
-
chunk = chunk.next;
|
|
608
|
-
chunk.prependRight(indentStr);
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
charIndex += 1;
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
charIndex = chunk.end;
|
|
616
|
-
chunk = chunk.next;
|
|
617
|
-
}
|
|
618
|
-
this.outro = this.outro.replace(pattern, replacer);
|
|
619
|
-
return this;
|
|
620
|
-
}
|
|
621
|
-
insert() {
|
|
622
|
-
throw new Error(
|
|
623
|
-
"magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)"
|
|
624
|
-
);
|
|
625
|
-
}
|
|
626
|
-
insertLeft(index, content) {
|
|
627
|
-
if (!warned.insertLeft) {
|
|
628
|
-
console.warn(
|
|
629
|
-
"magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"
|
|
630
|
-
);
|
|
631
|
-
warned.insertLeft = true;
|
|
632
|
-
}
|
|
633
|
-
return this.appendLeft(index, content);
|
|
634
|
-
}
|
|
635
|
-
insertRight(index, content) {
|
|
636
|
-
if (!warned.insertRight) {
|
|
637
|
-
console.warn(
|
|
638
|
-
"magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"
|
|
639
|
-
);
|
|
640
|
-
warned.insertRight = true;
|
|
641
|
-
}
|
|
642
|
-
return this.prependRight(index, content);
|
|
643
|
-
}
|
|
644
|
-
move(start, end, index) {
|
|
645
|
-
start = start + this.offset;
|
|
646
|
-
end = end + this.offset;
|
|
647
|
-
index = index + this.offset;
|
|
648
|
-
if (index >= start && index <= end) throw new Error("Cannot move a selection inside itself");
|
|
649
|
-
this._split(start);
|
|
650
|
-
this._split(end);
|
|
651
|
-
this._split(index);
|
|
652
|
-
const first = this.byStart[start];
|
|
653
|
-
const last = this.byEnd[end];
|
|
654
|
-
const oldLeft = first.previous;
|
|
655
|
-
const oldRight = last.next;
|
|
656
|
-
const newRight = this.byStart[index];
|
|
657
|
-
if (!newRight && last === this.lastChunk) return this;
|
|
658
|
-
const newLeft = newRight ? newRight.previous : this.lastChunk;
|
|
659
|
-
if (oldLeft) oldLeft.next = oldRight;
|
|
660
|
-
if (oldRight) oldRight.previous = oldLeft;
|
|
661
|
-
if (newLeft) newLeft.next = first;
|
|
662
|
-
if (newRight) newRight.previous = last;
|
|
663
|
-
if (!first.previous) this.firstChunk = last.next;
|
|
664
|
-
if (!last.next) {
|
|
665
|
-
this.lastChunk = first.previous;
|
|
666
|
-
this.lastChunk.next = null;
|
|
667
|
-
}
|
|
668
|
-
first.previous = newLeft;
|
|
669
|
-
last.next = newRight || null;
|
|
670
|
-
if (!newLeft) this.firstChunk = first;
|
|
671
|
-
if (!newRight) this.lastChunk = last;
|
|
672
|
-
return this;
|
|
673
|
-
}
|
|
674
|
-
overwrite(start, end, content, options) {
|
|
675
|
-
options = options || {};
|
|
676
|
-
return this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
|
|
677
|
-
}
|
|
678
|
-
update(start, end, content, options) {
|
|
679
|
-
start = start + this.offset;
|
|
680
|
-
end = end + this.offset;
|
|
681
|
-
if (typeof content !== "string") throw new TypeError("replacement content must be a string");
|
|
682
|
-
if (this.original.length !== 0) {
|
|
683
|
-
while (start < 0) start += this.original.length;
|
|
684
|
-
while (end < 0) end += this.original.length;
|
|
685
|
-
}
|
|
686
|
-
if (end > this.original.length) throw new Error("end is out of bounds");
|
|
687
|
-
if (start === end)
|
|
688
|
-
throw new Error(
|
|
689
|
-
"Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead"
|
|
690
|
-
);
|
|
691
|
-
this._split(start);
|
|
692
|
-
this._split(end);
|
|
693
|
-
if (options === true) {
|
|
694
|
-
if (!warned.storeName) {
|
|
695
|
-
console.warn(
|
|
696
|
-
"The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"
|
|
697
|
-
);
|
|
698
|
-
warned.storeName = true;
|
|
699
|
-
}
|
|
700
|
-
options = { storeName: true };
|
|
701
|
-
}
|
|
702
|
-
const storeName = options !== void 0 ? options.storeName : false;
|
|
703
|
-
const overwrite = options !== void 0 ? options.overwrite : false;
|
|
704
|
-
if (storeName) {
|
|
705
|
-
const original = this.original.slice(start, end);
|
|
706
|
-
Object.defineProperty(this.storedNames, original, {
|
|
707
|
-
writable: true,
|
|
708
|
-
value: true,
|
|
709
|
-
enumerable: true
|
|
710
|
-
});
|
|
711
|
-
}
|
|
712
|
-
const first = this.byStart[start];
|
|
713
|
-
const last = this.byEnd[end];
|
|
714
|
-
if (first) {
|
|
715
|
-
let chunk = first;
|
|
716
|
-
while (chunk !== last) {
|
|
717
|
-
if (chunk.next !== this.byStart[chunk.end]) {
|
|
718
|
-
throw new Error("Cannot overwrite across a split point");
|
|
719
|
-
}
|
|
720
|
-
chunk = chunk.next;
|
|
721
|
-
chunk.edit("", false);
|
|
722
|
-
}
|
|
723
|
-
first.edit(content, storeName, !overwrite);
|
|
724
|
-
} else {
|
|
725
|
-
const newChunk = new Chunk(start, end, "").edit(content, storeName);
|
|
726
|
-
last.next = newChunk;
|
|
727
|
-
newChunk.previous = last;
|
|
728
|
-
}
|
|
729
|
-
return this;
|
|
730
|
-
}
|
|
731
|
-
prepend(content) {
|
|
732
|
-
if (typeof content !== "string") throw new TypeError("outro content must be a string");
|
|
733
|
-
this.intro = content + this.intro;
|
|
734
|
-
return this;
|
|
735
|
-
}
|
|
736
|
-
prependLeft(index, content) {
|
|
737
|
-
index = index + this.offset;
|
|
738
|
-
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
739
|
-
this._split(index);
|
|
740
|
-
const chunk = this.byEnd[index];
|
|
741
|
-
if (chunk) {
|
|
742
|
-
chunk.prependLeft(content);
|
|
743
|
-
} else {
|
|
744
|
-
this.intro = content + this.intro;
|
|
745
|
-
}
|
|
746
|
-
return this;
|
|
747
|
-
}
|
|
748
|
-
prependRight(index, content) {
|
|
749
|
-
index = index + this.offset;
|
|
750
|
-
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
751
|
-
this._split(index);
|
|
752
|
-
const chunk = this.byStart[index];
|
|
753
|
-
if (chunk) {
|
|
754
|
-
chunk.prependRight(content);
|
|
755
|
-
} else {
|
|
756
|
-
this.outro = content + this.outro;
|
|
757
|
-
}
|
|
758
|
-
return this;
|
|
759
|
-
}
|
|
760
|
-
remove(start, end) {
|
|
761
|
-
start = start + this.offset;
|
|
762
|
-
end = end + this.offset;
|
|
763
|
-
if (this.original.length !== 0) {
|
|
764
|
-
while (start < 0) start += this.original.length;
|
|
765
|
-
while (end < 0) end += this.original.length;
|
|
766
|
-
}
|
|
767
|
-
if (start === end) return this;
|
|
768
|
-
if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
|
|
769
|
-
if (start > end) throw new Error("end must be greater than start");
|
|
770
|
-
this._split(start);
|
|
771
|
-
this._split(end);
|
|
772
|
-
let chunk = this.byStart[start];
|
|
773
|
-
while (chunk) {
|
|
774
|
-
chunk.intro = "";
|
|
775
|
-
chunk.outro = "";
|
|
776
|
-
chunk.edit("");
|
|
777
|
-
chunk = end > chunk.end ? this.byStart[chunk.end] : null;
|
|
778
|
-
}
|
|
779
|
-
return this;
|
|
780
|
-
}
|
|
781
|
-
reset(start, end) {
|
|
782
|
-
start = start + this.offset;
|
|
783
|
-
end = end + this.offset;
|
|
784
|
-
if (this.original.length !== 0) {
|
|
785
|
-
while (start < 0) start += this.original.length;
|
|
786
|
-
while (end < 0) end += this.original.length;
|
|
787
|
-
}
|
|
788
|
-
if (start === end) return this;
|
|
789
|
-
if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
|
|
790
|
-
if (start > end) throw new Error("end must be greater than start");
|
|
791
|
-
this._split(start);
|
|
792
|
-
this._split(end);
|
|
793
|
-
let chunk = this.byStart[start];
|
|
794
|
-
while (chunk) {
|
|
795
|
-
chunk.reset();
|
|
796
|
-
chunk = end > chunk.end ? this.byStart[chunk.end] : null;
|
|
797
|
-
}
|
|
798
|
-
return this;
|
|
799
|
-
}
|
|
800
|
-
lastChar() {
|
|
801
|
-
if (this.outro.length) return this.outro[this.outro.length - 1];
|
|
802
|
-
let chunk = this.lastChunk;
|
|
803
|
-
do {
|
|
804
|
-
if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
|
|
805
|
-
if (chunk.content.length) return chunk.content[chunk.content.length - 1];
|
|
806
|
-
if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
|
|
807
|
-
} while (chunk = chunk.previous);
|
|
808
|
-
if (this.intro.length) return this.intro[this.intro.length - 1];
|
|
809
|
-
return "";
|
|
810
|
-
}
|
|
811
|
-
lastLine() {
|
|
812
|
-
let lineIndex = this.outro.lastIndexOf(n);
|
|
813
|
-
if (lineIndex !== -1) return this.outro.substr(lineIndex + 1);
|
|
814
|
-
let lineStr = this.outro;
|
|
815
|
-
let chunk = this.lastChunk;
|
|
816
|
-
do {
|
|
817
|
-
if (chunk.outro.length > 0) {
|
|
818
|
-
lineIndex = chunk.outro.lastIndexOf(n);
|
|
819
|
-
if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;
|
|
820
|
-
lineStr = chunk.outro + lineStr;
|
|
821
|
-
}
|
|
822
|
-
if (chunk.content.length > 0) {
|
|
823
|
-
lineIndex = chunk.content.lastIndexOf(n);
|
|
824
|
-
if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;
|
|
825
|
-
lineStr = chunk.content + lineStr;
|
|
826
|
-
}
|
|
827
|
-
if (chunk.intro.length > 0) {
|
|
828
|
-
lineIndex = chunk.intro.lastIndexOf(n);
|
|
829
|
-
if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;
|
|
830
|
-
lineStr = chunk.intro + lineStr;
|
|
831
|
-
}
|
|
832
|
-
} while (chunk = chunk.previous);
|
|
833
|
-
lineIndex = this.intro.lastIndexOf(n);
|
|
834
|
-
if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
|
|
835
|
-
return this.intro + lineStr;
|
|
836
|
-
}
|
|
837
|
-
slice(start = 0, end = this.original.length - this.offset) {
|
|
838
|
-
start = start + this.offset;
|
|
839
|
-
end = end + this.offset;
|
|
840
|
-
if (this.original.length !== 0) {
|
|
841
|
-
while (start < 0) start += this.original.length;
|
|
842
|
-
while (end < 0) end += this.original.length;
|
|
843
|
-
}
|
|
844
|
-
let result = "";
|
|
845
|
-
let chunk = this.firstChunk;
|
|
846
|
-
while (chunk && (chunk.start > start || chunk.end <= start)) {
|
|
847
|
-
if (chunk.start < end && chunk.end >= end) {
|
|
848
|
-
return result;
|
|
849
|
-
}
|
|
850
|
-
chunk = chunk.next;
|
|
851
|
-
}
|
|
852
|
-
if (chunk && chunk.edited && chunk.start !== start)
|
|
853
|
-
throw new Error(`Cannot use replaced character ${start} as slice start anchor.`);
|
|
854
|
-
const startChunk = chunk;
|
|
855
|
-
while (chunk) {
|
|
856
|
-
if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
|
|
857
|
-
result += chunk.intro;
|
|
858
|
-
}
|
|
859
|
-
const containsEnd = chunk.start < end && chunk.end >= end;
|
|
860
|
-
if (containsEnd && chunk.edited && chunk.end !== end)
|
|
861
|
-
throw new Error(`Cannot use replaced character ${end} as slice end anchor.`);
|
|
862
|
-
const sliceStart = startChunk === chunk ? start - chunk.start : 0;
|
|
863
|
-
const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
|
|
864
|
-
result += chunk.content.slice(sliceStart, sliceEnd);
|
|
865
|
-
if (chunk.outro && (!containsEnd || chunk.end === end)) {
|
|
866
|
-
result += chunk.outro;
|
|
867
|
-
}
|
|
868
|
-
if (containsEnd) {
|
|
869
|
-
break;
|
|
870
|
-
}
|
|
871
|
-
chunk = chunk.next;
|
|
872
|
-
}
|
|
873
|
-
return result;
|
|
874
|
-
}
|
|
875
|
-
// TODO deprecate this? not really very useful
|
|
876
|
-
snip(start, end) {
|
|
877
|
-
const clone = this.clone();
|
|
878
|
-
clone.remove(0, start);
|
|
879
|
-
clone.remove(end, clone.original.length);
|
|
880
|
-
return clone;
|
|
881
|
-
}
|
|
882
|
-
_split(index) {
|
|
883
|
-
if (this.byStart[index] || this.byEnd[index]) return;
|
|
884
|
-
let chunk = this.lastSearchedChunk;
|
|
885
|
-
const searchForward = index > chunk.end;
|
|
886
|
-
while (chunk) {
|
|
887
|
-
if (chunk.contains(index)) return this._splitChunk(chunk, index);
|
|
888
|
-
chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
_splitChunk(chunk, index) {
|
|
892
|
-
if (chunk.edited && chunk.content.length) {
|
|
893
|
-
const loc = getLocator(this.original)(index);
|
|
894
|
-
throw new Error(
|
|
895
|
-
`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} \u2013 "${chunk.original}")`
|
|
896
|
-
);
|
|
897
|
-
}
|
|
898
|
-
const newChunk = chunk.split(index);
|
|
899
|
-
this.byEnd[index] = chunk;
|
|
900
|
-
this.byStart[index] = newChunk;
|
|
901
|
-
this.byEnd[newChunk.end] = newChunk;
|
|
902
|
-
if (chunk === this.lastChunk) this.lastChunk = newChunk;
|
|
903
|
-
this.lastSearchedChunk = chunk;
|
|
904
|
-
return true;
|
|
905
|
-
}
|
|
906
|
-
toString() {
|
|
907
|
-
let str = this.intro;
|
|
908
|
-
let chunk = this.firstChunk;
|
|
909
|
-
while (chunk) {
|
|
910
|
-
str += chunk.toString();
|
|
911
|
-
chunk = chunk.next;
|
|
912
|
-
}
|
|
913
|
-
return str + this.outro;
|
|
914
|
-
}
|
|
915
|
-
isEmpty() {
|
|
916
|
-
let chunk = this.firstChunk;
|
|
917
|
-
do {
|
|
918
|
-
if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim())
|
|
919
|
-
return false;
|
|
920
|
-
} while (chunk = chunk.next);
|
|
921
|
-
return true;
|
|
922
|
-
}
|
|
923
|
-
length() {
|
|
924
|
-
let chunk = this.firstChunk;
|
|
925
|
-
let length = 0;
|
|
926
|
-
do {
|
|
927
|
-
length += chunk.intro.length + chunk.content.length + chunk.outro.length;
|
|
928
|
-
} while (chunk = chunk.next);
|
|
929
|
-
return length;
|
|
930
|
-
}
|
|
931
|
-
trimLines() {
|
|
932
|
-
return this.trim("[\\r\\n]");
|
|
933
|
-
}
|
|
934
|
-
trim(charType) {
|
|
935
|
-
return this.trimStart(charType).trimEnd(charType);
|
|
936
|
-
}
|
|
937
|
-
trimEndAborted(charType) {
|
|
938
|
-
const rx = new RegExp((charType || "\\s") + "+$");
|
|
939
|
-
this.outro = this.outro.replace(rx, "");
|
|
940
|
-
if (this.outro.length) return true;
|
|
941
|
-
let chunk = this.lastChunk;
|
|
942
|
-
do {
|
|
943
|
-
const end = chunk.end;
|
|
944
|
-
const aborted = chunk.trimEnd(rx);
|
|
945
|
-
if (chunk.end !== end) {
|
|
946
|
-
if (this.lastChunk === chunk) {
|
|
947
|
-
this.lastChunk = chunk.next;
|
|
948
|
-
}
|
|
949
|
-
this.byEnd[chunk.end] = chunk;
|
|
950
|
-
this.byStart[chunk.next.start] = chunk.next;
|
|
951
|
-
this.byEnd[chunk.next.end] = chunk.next;
|
|
952
|
-
}
|
|
953
|
-
if (aborted) return true;
|
|
954
|
-
chunk = chunk.previous;
|
|
955
|
-
} while (chunk);
|
|
956
|
-
return false;
|
|
957
|
-
}
|
|
958
|
-
trimEnd(charType) {
|
|
959
|
-
this.trimEndAborted(charType);
|
|
960
|
-
return this;
|
|
961
|
-
}
|
|
962
|
-
trimStartAborted(charType) {
|
|
963
|
-
const rx = new RegExp("^" + (charType || "\\s") + "+");
|
|
964
|
-
this.intro = this.intro.replace(rx, "");
|
|
965
|
-
if (this.intro.length) return true;
|
|
966
|
-
let chunk = this.firstChunk;
|
|
967
|
-
do {
|
|
968
|
-
const end = chunk.end;
|
|
969
|
-
const aborted = chunk.trimStart(rx);
|
|
970
|
-
if (chunk.end !== end) {
|
|
971
|
-
if (chunk === this.lastChunk) this.lastChunk = chunk.next;
|
|
972
|
-
this.byEnd[chunk.end] = chunk;
|
|
973
|
-
this.byStart[chunk.next.start] = chunk.next;
|
|
974
|
-
this.byEnd[chunk.next.end] = chunk.next;
|
|
975
|
-
}
|
|
976
|
-
if (aborted) return true;
|
|
977
|
-
chunk = chunk.next;
|
|
978
|
-
} while (chunk);
|
|
979
|
-
return false;
|
|
980
|
-
}
|
|
981
|
-
trimStart(charType) {
|
|
982
|
-
this.trimStartAborted(charType);
|
|
983
|
-
return this;
|
|
984
|
-
}
|
|
985
|
-
hasChanged() {
|
|
986
|
-
return this.original !== this.toString();
|
|
987
|
-
}
|
|
988
|
-
_replaceRegexp(searchValue, replacement) {
|
|
989
|
-
function getReplacement(match, str) {
|
|
990
|
-
if (typeof replacement === "string") {
|
|
991
|
-
return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => {
|
|
992
|
-
if (i === "$") return "$";
|
|
993
|
-
if (i === "&") return match[0];
|
|
994
|
-
const num = +i;
|
|
995
|
-
if (num < match.length) return match[+i];
|
|
996
|
-
return `$${i}`;
|
|
997
|
-
});
|
|
998
|
-
} else {
|
|
999
|
-
return replacement(...match, match.index, str, match.groups);
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
function matchAll(re, str) {
|
|
1003
|
-
let match;
|
|
1004
|
-
const matches = [];
|
|
1005
|
-
while (match = re.exec(str)) {
|
|
1006
|
-
matches.push(match);
|
|
1007
|
-
}
|
|
1008
|
-
return matches;
|
|
1009
|
-
}
|
|
1010
|
-
if (searchValue.global) {
|
|
1011
|
-
const matches = matchAll(searchValue, this.original);
|
|
1012
|
-
matches.forEach((match) => {
|
|
1013
|
-
if (match.index != null) {
|
|
1014
|
-
const replacement2 = getReplacement(match, this.original);
|
|
1015
|
-
if (replacement2 !== match[0]) {
|
|
1016
|
-
this.overwrite(match.index, match.index + match[0].length, replacement2);
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
});
|
|
1020
|
-
} else {
|
|
1021
|
-
const match = this.original.match(searchValue);
|
|
1022
|
-
if (match && match.index != null) {
|
|
1023
|
-
const replacement2 = getReplacement(match, this.original);
|
|
1024
|
-
if (replacement2 !== match[0]) {
|
|
1025
|
-
this.overwrite(match.index, match.index + match[0].length, replacement2);
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
return this;
|
|
1030
|
-
}
|
|
1031
|
-
_replaceString(string, replacement) {
|
|
1032
|
-
const { original } = this;
|
|
1033
|
-
const index = original.indexOf(string);
|
|
1034
|
-
if (index !== -1) {
|
|
1035
|
-
this.overwrite(index, index + string.length, replacement);
|
|
1036
|
-
}
|
|
1037
|
-
return this;
|
|
1038
|
-
}
|
|
1039
|
-
replace(searchValue, replacement) {
|
|
1040
|
-
if (typeof searchValue === "string") {
|
|
1041
|
-
return this._replaceString(searchValue, replacement);
|
|
1042
|
-
}
|
|
1043
|
-
return this._replaceRegexp(searchValue, replacement);
|
|
1044
|
-
}
|
|
1045
|
-
_replaceAllString(string, replacement) {
|
|
1046
|
-
const { original } = this;
|
|
1047
|
-
const stringLength = string.length;
|
|
1048
|
-
for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
|
|
1049
|
-
const previous = original.slice(index, index + stringLength);
|
|
1050
|
-
if (previous !== replacement) this.overwrite(index, index + stringLength, replacement);
|
|
1051
|
-
}
|
|
1052
|
-
return this;
|
|
1053
|
-
}
|
|
1054
|
-
replaceAll(searchValue, replacement) {
|
|
1055
|
-
if (typeof searchValue === "string") {
|
|
1056
|
-
return this._replaceAllString(searchValue, replacement);
|
|
1057
|
-
}
|
|
1058
|
-
if (!searchValue.global) {
|
|
1059
|
-
throw new TypeError(
|
|
1060
|
-
"MagicString.prototype.replaceAll called with a non-global RegExp argument"
|
|
1061
|
-
);
|
|
1062
|
-
}
|
|
1063
|
-
return this._replaceRegexp(searchValue, replacement);
|
|
1064
|
-
}
|
|
1065
|
-
};
|
|
1066
|
-
var hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1067
|
-
var Bundle = class _Bundle {
|
|
1068
|
-
constructor(options = {}) {
|
|
1069
|
-
this.intro = options.intro || "";
|
|
1070
|
-
this.separator = options.separator !== void 0 ? options.separator : "\n";
|
|
1071
|
-
this.sources = [];
|
|
1072
|
-
this.uniqueSources = [];
|
|
1073
|
-
this.uniqueSourceIndexByFilename = {};
|
|
1074
|
-
}
|
|
1075
|
-
addSource(source) {
|
|
1076
|
-
if (source instanceof MagicString) {
|
|
1077
|
-
return this.addSource({
|
|
1078
|
-
content: source,
|
|
1079
|
-
filename: source.filename,
|
|
1080
|
-
separator: this.separator
|
|
1081
|
-
});
|
|
1082
|
-
}
|
|
1083
|
-
if (!isObject(source) || !source.content) {
|
|
1084
|
-
throw new Error(
|
|
1085
|
-
"bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`"
|
|
1086
|
-
);
|
|
1087
|
-
}
|
|
1088
|
-
["filename", "ignoreList", "indentExclusionRanges", "separator"].forEach((option) => {
|
|
1089
|
-
if (!hasOwnProp.call(source, option)) source[option] = source.content[option];
|
|
1090
|
-
});
|
|
1091
|
-
if (source.separator === void 0) {
|
|
1092
|
-
source.separator = this.separator;
|
|
1093
|
-
}
|
|
1094
|
-
if (source.filename) {
|
|
1095
|
-
if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {
|
|
1096
|
-
this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;
|
|
1097
|
-
this.uniqueSources.push({ filename: source.filename, content: source.content.original });
|
|
1098
|
-
} else {
|
|
1099
|
-
const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];
|
|
1100
|
-
if (source.content.original !== uniqueSource.content) {
|
|
1101
|
-
throw new Error(`Illegal source: same filename (${source.filename}), different contents`);
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
|
-
this.sources.push(source);
|
|
1106
|
-
return this;
|
|
1107
|
-
}
|
|
1108
|
-
append(str, options) {
|
|
1109
|
-
this.addSource({
|
|
1110
|
-
content: new MagicString(str),
|
|
1111
|
-
separator: options && options.separator || ""
|
|
1112
|
-
});
|
|
1113
|
-
return this;
|
|
1114
|
-
}
|
|
1115
|
-
clone() {
|
|
1116
|
-
const bundle = new _Bundle({
|
|
1117
|
-
intro: this.intro,
|
|
1118
|
-
separator: this.separator
|
|
1119
|
-
});
|
|
1120
|
-
this.sources.forEach((source) => {
|
|
1121
|
-
bundle.addSource({
|
|
1122
|
-
filename: source.filename,
|
|
1123
|
-
content: source.content.clone(),
|
|
1124
|
-
separator: source.separator
|
|
1125
|
-
});
|
|
1126
|
-
});
|
|
1127
|
-
return bundle;
|
|
1128
|
-
}
|
|
1129
|
-
generateDecodedMap(options = {}) {
|
|
1130
|
-
const names = [];
|
|
1131
|
-
let x_google_ignoreList = void 0;
|
|
1132
|
-
this.sources.forEach((source) => {
|
|
1133
|
-
Object.keys(source.content.storedNames).forEach((name) => {
|
|
1134
|
-
if (!~names.indexOf(name)) names.push(name);
|
|
1135
|
-
});
|
|
1136
|
-
});
|
|
1137
|
-
const mappings = new Mappings(options.hires);
|
|
1138
|
-
if (this.intro) {
|
|
1139
|
-
mappings.advance(this.intro);
|
|
1140
|
-
}
|
|
1141
|
-
this.sources.forEach((source, i) => {
|
|
1142
|
-
if (i > 0) {
|
|
1143
|
-
mappings.advance(this.separator);
|
|
1144
|
-
}
|
|
1145
|
-
const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;
|
|
1146
|
-
const magicString = source.content;
|
|
1147
|
-
const locate = getLocator(magicString.original);
|
|
1148
|
-
if (magicString.intro) {
|
|
1149
|
-
mappings.advance(magicString.intro);
|
|
1150
|
-
}
|
|
1151
|
-
magicString.firstChunk.eachNext((chunk) => {
|
|
1152
|
-
const loc = locate(chunk.start);
|
|
1153
|
-
if (chunk.intro.length) mappings.advance(chunk.intro);
|
|
1154
|
-
if (source.filename) {
|
|
1155
|
-
if (chunk.edited) {
|
|
1156
|
-
mappings.addEdit(
|
|
1157
|
-
sourceIndex,
|
|
1158
|
-
chunk.content,
|
|
1159
|
-
loc,
|
|
1160
|
-
chunk.storeName ? names.indexOf(chunk.original) : -1
|
|
1161
|
-
);
|
|
1162
|
-
} else {
|
|
1163
|
-
mappings.addUneditedChunk(
|
|
1164
|
-
sourceIndex,
|
|
1165
|
-
chunk,
|
|
1166
|
-
magicString.original,
|
|
1167
|
-
loc,
|
|
1168
|
-
magicString.sourcemapLocations
|
|
1169
|
-
);
|
|
1170
|
-
}
|
|
1171
|
-
} else {
|
|
1172
|
-
mappings.advance(chunk.content);
|
|
1173
|
-
}
|
|
1174
|
-
if (chunk.outro.length) mappings.advance(chunk.outro);
|
|
1175
|
-
});
|
|
1176
|
-
if (magicString.outro) {
|
|
1177
|
-
mappings.advance(magicString.outro);
|
|
1178
|
-
}
|
|
1179
|
-
if (source.ignoreList && sourceIndex !== -1) {
|
|
1180
|
-
if (x_google_ignoreList === void 0) {
|
|
1181
|
-
x_google_ignoreList = [];
|
|
1182
|
-
}
|
|
1183
|
-
x_google_ignoreList.push(sourceIndex);
|
|
1184
|
-
}
|
|
1185
|
-
});
|
|
1186
|
-
return {
|
|
1187
|
-
file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
|
|
1188
|
-
sources: this.uniqueSources.map((source) => {
|
|
1189
|
-
return options.file ? getRelativePath(options.file, source.filename) : source.filename;
|
|
1190
|
-
}),
|
|
1191
|
-
sourcesContent: this.uniqueSources.map((source) => {
|
|
1192
|
-
return options.includeContent ? source.content : null;
|
|
1193
|
-
}),
|
|
1194
|
-
names,
|
|
1195
|
-
mappings: mappings.raw,
|
|
1196
|
-
x_google_ignoreList
|
|
1197
|
-
};
|
|
1198
|
-
}
|
|
1199
|
-
generateMap(options) {
|
|
1200
|
-
return new SourceMap(this.generateDecodedMap(options));
|
|
1201
|
-
}
|
|
1202
|
-
getIndentString() {
|
|
1203
|
-
const indentStringCounts = {};
|
|
1204
|
-
this.sources.forEach((source) => {
|
|
1205
|
-
const indentStr = source.content._getRawIndentString();
|
|
1206
|
-
if (indentStr === null) return;
|
|
1207
|
-
if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;
|
|
1208
|
-
indentStringCounts[indentStr] += 1;
|
|
1209
|
-
});
|
|
1210
|
-
return Object.keys(indentStringCounts).sort((a, b) => {
|
|
1211
|
-
return indentStringCounts[a] - indentStringCounts[b];
|
|
1212
|
-
})[0] || " ";
|
|
1213
|
-
}
|
|
1214
|
-
indent(indentStr) {
|
|
1215
|
-
if (!arguments.length) {
|
|
1216
|
-
indentStr = this.getIndentString();
|
|
1217
|
-
}
|
|
1218
|
-
if (indentStr === "") return this;
|
|
1219
|
-
let trailingNewline = !this.intro || this.intro.slice(-1) === "\n";
|
|
1220
|
-
this.sources.forEach((source, i) => {
|
|
1221
|
-
const separator = source.separator !== void 0 ? source.separator : this.separator;
|
|
1222
|
-
const indentStart = trailingNewline || i > 0 && /\r?\n$/.test(separator);
|
|
1223
|
-
source.content.indent(indentStr, {
|
|
1224
|
-
exclude: source.indentExclusionRanges,
|
|
1225
|
-
indentStart
|
|
1226
|
-
//: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator )
|
|
1227
|
-
});
|
|
1228
|
-
trailingNewline = source.content.lastChar() === "\n";
|
|
1229
|
-
});
|
|
1230
|
-
if (this.intro) {
|
|
1231
|
-
this.intro = indentStr + this.intro.replace(/^[^\n]/gm, (match, index) => {
|
|
1232
|
-
return index > 0 ? indentStr + match : match;
|
|
1233
|
-
});
|
|
1234
|
-
}
|
|
1235
|
-
return this;
|
|
1236
|
-
}
|
|
1237
|
-
prepend(str) {
|
|
1238
|
-
this.intro = str + this.intro;
|
|
1239
|
-
return this;
|
|
1240
|
-
}
|
|
1241
|
-
toString() {
|
|
1242
|
-
const body = this.sources.map((source, i) => {
|
|
1243
|
-
const separator = source.separator !== void 0 ? source.separator : this.separator;
|
|
1244
|
-
const str = (i > 0 ? separator : "") + source.content.toString();
|
|
1245
|
-
return str;
|
|
1246
|
-
}).join("");
|
|
1247
|
-
return this.intro + body;
|
|
1248
|
-
}
|
|
1249
|
-
isEmpty() {
|
|
1250
|
-
if (this.intro.length && this.intro.trim()) return false;
|
|
1251
|
-
if (this.sources.some((source) => !source.content.isEmpty())) return false;
|
|
1252
|
-
return true;
|
|
1253
|
-
}
|
|
1254
|
-
length() {
|
|
1255
|
-
return this.sources.reduce(
|
|
1256
|
-
(length, source) => length + source.content.length(),
|
|
1257
|
-
this.intro.length
|
|
1258
|
-
);
|
|
1259
|
-
}
|
|
1260
|
-
trimLines() {
|
|
1261
|
-
return this.trim("[\\r\\n]");
|
|
1262
|
-
}
|
|
1263
|
-
trim(charType) {
|
|
1264
|
-
return this.trimStart(charType).trimEnd(charType);
|
|
1265
|
-
}
|
|
1266
|
-
trimStart(charType) {
|
|
1267
|
-
const rx = new RegExp("^" + (charType || "\\s") + "+");
|
|
1268
|
-
this.intro = this.intro.replace(rx, "");
|
|
1269
|
-
if (!this.intro) {
|
|
1270
|
-
let source;
|
|
1271
|
-
let i = 0;
|
|
1272
|
-
do {
|
|
1273
|
-
source = this.sources[i++];
|
|
1274
|
-
if (!source) {
|
|
1275
|
-
break;
|
|
1276
|
-
}
|
|
1277
|
-
} while (!source.content.trimStartAborted(charType));
|
|
1278
|
-
}
|
|
1279
|
-
return this;
|
|
1280
|
-
}
|
|
1281
|
-
trimEnd(charType) {
|
|
1282
|
-
const rx = new RegExp((charType || "\\s") + "+$");
|
|
1283
|
-
let source;
|
|
1284
|
-
let i = this.sources.length - 1;
|
|
1285
|
-
do {
|
|
1286
|
-
source = this.sources[i--];
|
|
1287
|
-
if (!source) {
|
|
1288
|
-
this.intro = this.intro.replace(rx, "");
|
|
1289
|
-
break;
|
|
1290
|
-
}
|
|
1291
|
-
} while (!source.content.trimEndAborted(charType));
|
|
1292
|
-
return this;
|
|
1293
|
-
}
|
|
1294
|
-
};
|
|
1295
|
-
export {
|
|
1296
|
-
Bundle,
|
|
1297
|
-
SourceMap,
|
|
1298
|
-
MagicString as default
|
|
1299
|
-
};
|