struct-fakerator 2.4.7 → 2.5.7
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/biome.json +1 -1
- package/dist/airline-98MCzMN8.d.ts +26 -0
- package/dist/airline-CuAxOEYH.d.mts +26 -0
- package/dist/animal-BohQ7s0w.d.mts +53 -0
- package/dist/animal-o8BFF7gd.d.ts +53 -0
- package/dist/chunk-25HDDMTE.js +45 -0
- package/dist/chunk-266JLHQ7.mjs +27 -0
- package/dist/chunk-2FTPTSHD.mjs +1972 -0
- package/dist/chunk-2P6DPKAW.js +35 -0
- package/dist/chunk-2QPSWN3J.js +24 -0
- package/dist/chunk-2SF54GZN.mjs +24 -0
- package/dist/chunk-2UAN3WRZ.js +51 -0
- package/dist/chunk-2VTSGFBK.mjs +56 -0
- package/dist/chunk-2ZR6AR26.js +24 -0
- package/dist/chunk-3AXS7RA6.mjs +18 -0
- package/dist/chunk-3DIP4M5Y.mjs +36 -0
- package/dist/chunk-3U6BNHWG.mjs +2040 -0
- package/dist/chunk-42EKB2FX.js +74 -0
- package/dist/chunk-4OB35J4Q.mjs +151 -0
- package/dist/chunk-4VNS5WPM.js +42 -0
- package/dist/chunk-52ZOIHJM.js +26 -0
- package/dist/chunk-55HSOHNN.js +36 -0
- package/dist/chunk-5A3HJWPX.mjs +33 -0
- package/dist/chunk-5PCIFPK7.js +15721 -0
- package/dist/chunk-5TG43IWT.js +36 -0
- package/dist/chunk-5UFZ4NET.mjs +26 -0
- package/dist/chunk-5VTJIH2Q.mjs +63 -0
- package/dist/chunk-5ZNSQDU5.js +81 -0
- package/dist/chunk-6BWS3CLP.mjs +16 -0
- package/dist/chunk-6GXFVYK2.js +18 -0
- package/dist/chunk-6QZF75LH.js +20 -0
- package/dist/chunk-6TGTIMX2.mjs +151 -0
- package/dist/chunk-73BBBL26.js +49 -0
- package/dist/chunk-7C2MCLYX.mjs +15721 -0
- package/dist/chunk-7IWAOHPW.mjs +27 -0
- package/dist/chunk-7POVLKQR.mjs +20 -0
- package/dist/chunk-7UQSPUCL.mjs +0 -0
- package/dist/chunk-7ZAVU2DI.mjs +81 -0
- package/dist/chunk-A4QVPMYT.js +44 -0
- package/dist/chunk-A5YXOL6G.mjs +63 -0
- package/dist/chunk-ABZZ2Y2O.mjs +45 -0
- package/dist/chunk-AT4FPDTE.mjs +51 -0
- package/dist/chunk-B3RA7BAM.mjs +30 -0
- package/dist/chunk-B7MK7WHV.mjs +21 -0
- package/dist/chunk-BMQ2NETL.js +63 -0
- package/dist/chunk-BNJUSXEO.js +27 -0
- package/dist/chunk-BVGE5IMC.js +45 -0
- package/dist/chunk-C6FQYK5T.js +81 -0
- package/dist/chunk-C6IEYVWV.mjs +21 -0
- package/dist/chunk-CKNDI3RH.js +24 -0
- package/dist/chunk-CSOXFDKC.mjs +42 -0
- package/dist/chunk-D3DPNIYF.mjs +36 -0
- package/dist/chunk-D74AUXZW.mjs +35 -0
- package/dist/chunk-DONFLQME.js +49 -0
- package/dist/chunk-DX6NQK6H.js +49 -0
- package/dist/chunk-DXVB5THL.js +36 -0
- package/dist/chunk-E3EZHXI2.mjs +45 -0
- package/dist/chunk-E3N3PWFI.js +45 -0
- package/dist/chunk-E7JW4TGQ.mjs +49 -0
- package/dist/chunk-ECTLN5SO.mjs +63 -0
- package/dist/chunk-EGCGEPYD.mjs +24 -0
- package/dist/chunk-EPWKT75L.js +63 -0
- package/dist/chunk-ES6I4JEP.js +24 -0
- package/dist/chunk-F4NIEPKF.mjs +48 -0
- package/dist/chunk-F4WSUHUB.js +27 -0
- package/dist/chunk-FGA73ALI.mjs +45 -0
- package/dist/chunk-FT5QWXEO.mjs +21 -0
- package/dist/chunk-G73JPAKW.mjs +16831 -0
- package/dist/chunk-GAOFL72U.mjs +24 -0
- package/dist/chunk-GMOMLI4W.js +56 -0
- package/dist/chunk-GNLLMLQX.js +48 -0
- package/dist/chunk-GNPP2GGZ.js +16831 -0
- package/dist/chunk-GSFJYUDA.js +63 -0
- package/dist/chunk-GUIYTTMP.mjs +24 -0
- package/dist/chunk-HEHR64VN.js +1972 -0
- package/dist/chunk-HLHMXAI2.js +21 -0
- package/dist/chunk-HMDAKHLF.js +151 -0
- package/dist/chunk-HNCQJ5F3.js +56 -0
- package/dist/chunk-HVWSAC7Q.js +74 -0
- package/dist/chunk-IEYIHOHM.js +57 -0
- package/dist/chunk-IRHHL256.mjs +36 -0
- package/dist/chunk-IY4LBMAL.js +78 -0
- package/dist/chunk-JC2FY5K5.mjs +42 -0
- package/dist/chunk-JIPBMHNL.mjs +63 -0
- package/dist/chunk-JIWCYW33.js +35 -0
- package/dist/chunk-JSZXNY5A.js +33 -0
- package/dist/chunk-JUS3FQET.js +63 -0
- package/dist/chunk-KDRX2A7A.mjs +45 -0
- package/dist/chunk-KDTNND32.js +63 -0
- package/dist/chunk-KESFLCJB.mjs +57 -0
- package/dist/chunk-KKDNACGF.js +78 -0
- package/dist/chunk-KSBJZ7PZ.mjs +48 -0
- package/dist/chunk-KVPPJDFE.mjs +63 -0
- package/dist/chunk-L55R55BM.mjs +24 -0
- package/dist/chunk-L7SUBSOS.mjs +74 -0
- package/dist/chunk-LGYUIU5L.js +33 -0
- package/dist/chunk-LKLQIBRC.mjs +18 -0
- package/dist/chunk-LPLLITHD.mjs +33 -0
- package/dist/chunk-LSP4VVPM.mjs +45 -0
- package/dist/chunk-LYYFKB5U.mjs +48 -0
- package/dist/chunk-M2ERA63H.mjs +20 -0
- package/dist/chunk-M3JRMFX2.js +36 -0
- package/dist/chunk-MHBVLDC4.js +30 -0
- package/dist/chunk-N2ZA6SQB.mjs +45 -0
- package/dist/chunk-NBUVTD24.js +24 -0
- package/dist/chunk-NGJNM6BX.mjs +48 -0
- package/dist/chunk-NWVKBRLA.js +30 -0
- package/dist/chunk-O73LDQID.mjs +57 -0
- package/dist/chunk-OAPPDES4.js +51 -0
- package/dist/chunk-OETKBS7R.mjs +63 -0
- package/dist/chunk-OFMBEI6Y.js +20 -0
- package/dist/chunk-OJRNPQVE.js +45 -0
- package/dist/chunk-OKDN5R6M.mjs +78 -0
- package/dist/chunk-OTDJMFZE.js +36 -0
- package/dist/chunk-OZ5VJVBQ.js +21 -0
- package/dist/chunk-OZ7Y3D4Z.js +48 -0
- package/dist/chunk-P2NEBQQH.mjs +78 -0
- package/dist/chunk-PBOBMHB3.js +45 -0
- package/dist/chunk-PEMTSFQT.mjs +36 -0
- package/dist/chunk-PSTZXVEM.mjs +45 -0
- package/dist/chunk-PXVILWPC.js +51 -0
- package/dist/chunk-PXXIPMA2.mjs +17567 -0
- package/dist/chunk-PYIUSFN2.js +48 -0
- package/dist/chunk-Q4BXZB6O.mjs +35 -0
- package/dist/chunk-Q6CVTFPU.mjs +2022 -0
- package/dist/chunk-Q7THO24V.js +45 -0
- package/dist/chunk-QEVQSGOW.mjs +49 -0
- package/dist/chunk-QFG2B4XU.js +35 -0
- package/dist/chunk-QH2RT36U.js +57 -0
- package/dist/chunk-QHW2YYKY.js +45 -0
- package/dist/chunk-QMNACCJG.mjs +30 -0
- package/dist/chunk-QOATILWS.mjs +48 -0
- package/dist/chunk-R5U7XKVJ.js +16 -0
- package/dist/chunk-RA35MXTT.mjs +51 -0
- package/dist/chunk-RDATYKAG.mjs +58 -0
- package/dist/chunk-RDMAE6F2.js +17567 -0
- package/dist/chunk-RFTRP37B.mjs +74 -0
- package/dist/chunk-RIOEYYMH.mjs +30 -0
- package/dist/chunk-RM7GMMWN.mjs +49 -0
- package/dist/chunk-ROM4ZH2A.js +56 -0
- package/dist/chunk-RUTM5ENW.js +57 -0
- package/dist/chunk-RW4IZD3J.js +74 -0
- package/dist/chunk-S2AEEWWW.mjs +36 -0
- package/dist/chunk-SEUDYVHA.js +45 -0
- package/dist/chunk-SMIDTCUZ.mjs +56 -0
- package/dist/chunk-SN2ALAEI.mjs +36 -0
- package/dist/chunk-SN4QTD6R.js +1 -0
- package/dist/chunk-SSZ5GGDT.js +45 -0
- package/dist/chunk-SVMTK42D.mjs +48 -0
- package/dist/chunk-SYIPILT6.mjs +35 -0
- package/dist/chunk-TSDTKUIT.mjs +151 -0
- package/dist/chunk-TZ2RKEBF.js +2040 -0
- package/dist/chunk-U3EACZZ3.js +18 -0
- package/dist/chunk-U634RJNK.js +36 -0
- package/dist/chunk-UCRPFQYY.js +48 -0
- package/dist/chunk-UEXFND2J.mjs +56 -0
- package/dist/chunk-UJ5Q7MZB.js +78 -0
- package/dist/chunk-UOY5QUAW.js +63 -0
- package/dist/chunk-UP3FJ7EK.mjs +44 -0
- package/dist/chunk-URX5VRVB.js +24 -0
- package/dist/chunk-UUIIGFUZ.js +33 -0
- package/dist/chunk-VKKQV6UO.js +42 -0
- package/dist/chunk-VOMHZHCC.js +21 -0
- package/dist/chunk-VVELSEXL.mjs +27 -0
- package/dist/chunk-VX346ARA.js +42 -0
- package/dist/chunk-VYV7BUJR.js +42 -0
- package/dist/chunk-W6QSJNDJ.js +58 -0
- package/dist/chunk-X5WN73EF.js +48 -0
- package/dist/chunk-X7YFEBIL.mjs +28 -0
- package/dist/chunk-XGB3TDIC.mjs +42 -0
- package/dist/chunk-XI5L2ENL.js +28 -0
- package/dist/chunk-XIROUDIK.js +151 -0
- package/dist/chunk-XJGSUINR.mjs +24 -0
- package/dist/chunk-XN5RU4UY.js +27 -0
- package/dist/chunk-XUZOVQYC.mjs +42 -0
- package/dist/chunk-XVQOUXV6.js +48 -0
- package/dist/chunk-Y2G3CY4Q.mjs +51 -0
- package/dist/chunk-YJXRZ5WX.mjs +78 -0
- package/dist/chunk-YRB3F2AG.mjs +81 -0
- package/dist/chunk-YUFVOYYX.mjs +57 -0
- package/dist/chunk-YVASGALV.js +81 -0
- package/dist/chunk-YWFUY5A4.js +30 -0
- package/dist/chunk-YZNZHRY3.mjs +81 -0
- package/dist/chunk-Z46HCVNZ.js +151 -0
- package/dist/chunk-ZAU43ZDI.mjs +74 -0
- package/dist/chunk-ZBU5LSC3.mjs +45 -0
- package/dist/chunk-ZSBGAX6X.js +2022 -0
- package/dist/chunk-ZTUCFJLM.mjs +33 -0
- package/dist/chunk-ZXWWD74E.mjs +45 -0
- package/dist/color-BT6BF8oV.d.mts +61 -0
- package/dist/color-lBH29suB.d.ts +61 -0
- package/dist/commerce-BqVjXEhQ.d.mts +40 -0
- package/dist/commerce-mdOpchjx.d.ts +40 -0
- package/dist/common-IR_KozaJ.d.mts +11 -0
- package/dist/common-t-ZQebCq.d.ts +11 -0
- package/dist/company-C3EU1J7k.d.ts +35 -0
- package/dist/company-cR_0hm6U.d.mts +35 -0
- package/dist/config-BTjogu5M.d.ts +7 -0
- package/dist/config-C1N2Brw-.d.mts +7 -0
- package/dist/config.d.mts +2 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.js +19 -0
- package/dist/config.mjs +19 -0
- package/dist/config_scheme.d.mts +100 -0
- package/dist/config_scheme.d.ts +100 -0
- package/dist/config_scheme.js +17 -0
- package/dist/config_scheme.mjs +17 -0
- package/dist/create_config.d.mts +53 -0
- package/dist/create_config.d.ts +53 -0
- package/dist/create_config.js +18 -0
- package/dist/create_config.mjs +18 -0
- package/dist/create_config.test.d.mts +2 -0
- package/dist/create_config.test.d.ts +2 -0
- package/dist/create_config.test.js +63 -0
- package/dist/create_config.test.mjs +63 -0
- package/dist/create_generator_fn.d.mts +12 -0
- package/dist/create_generator_fn.d.ts +12 -0
- package/dist/create_generator_fn.js +21 -0
- package/dist/create_generator_fn.mjs +21 -0
- package/dist/create_generator_fn.test.d.mts +2 -0
- package/dist/create_generator_fn.test.d.ts +2 -0
- package/dist/create_generator_fn.test.js +178 -0
- package/dist/create_generator_fn.test.mjs +178 -0
- package/dist/database-DV9wgnca.d.ts +23 -0
- package/dist/database-UzO1Lwec.d.mts +23 -0
- package/dist/datatype-C92TZLxo.d.ts +13 -0
- package/dist/datatype-DZjmP0fA.d.mts +13 -0
- package/dist/datetime-CSUpnUXU.d.ts +78 -0
- package/dist/datetime-dnPA_lnt.d.mts +78 -0
- package/dist/finance-CstKW1nH.d.mts +90 -0
- package/dist/finance-gj0fiEmf.d.ts +90 -0
- package/dist/food-CInj1GX2.d.ts +35 -0
- package/dist/food-Dk3-40CY.d.mts +35 -0
- package/dist/generator_fn-CJDbnCZl.d.mts +7 -0
- package/dist/generator_fn-D-npAfnC.d.ts +7 -0
- package/dist/generator_fn.d.mts +2 -0
- package/dist/generator_fn.d.ts +2 -0
- package/dist/generator_fn.js +22 -0
- package/dist/generator_fn.mjs +22 -0
- package/dist/git-BHL1ppL4.d.ts +31 -0
- package/dist/git-w0nznSjX.d.mts +31 -0
- package/dist/hacker-DL7pR6JO.d.ts +26 -0
- package/dist/hacker-FcQXZGtz.d.mts +26 -0
- package/dist/image-B5OPCNhD.d.mts +56 -0
- package/dist/image-IyGCgqNf.d.ts +56 -0
- package/dist/index.d.mts +5 -57
- package/dist/index.d.ts +5 -57
- package/dist/index.js +44 -162
- package/dist/index.mjs +22 -140
- package/dist/internet-BWBjFZ1E.d.mts +101 -0
- package/dist/internet-BukCBMX-.d.ts +106 -0
- package/dist/internet-C2ElurWb.d.mts +106 -0
- package/dist/internet-WmWuV39U.d.ts +101 -0
- package/dist/location-BIZ-KsaI.d.ts +80 -0
- package/dist/location-WU_nRdjx.d.mts +80 -0
- package/dist/lorem-OlHaVntu.d.mts +62 -0
- package/dist/lorem-yMyLb-d-.d.ts +62 -0
- package/dist/magic-string.es-2DLPM6Q3.js +1299 -0
- package/dist/magic-string.es-NHTKQXSF.mjs +1299 -0
- package/dist/magic-string.es-PQN52XPX.js +1288 -0
- package/dist/magic-string.es-X3ME2TR2.mjs +1288 -0
- package/dist/music-P8XZ4JSO.d.ts +20 -0
- package/dist/music-vcWm9dzu.d.mts +20 -0
- package/dist/number-BfwwKvTJ.d.mts +48 -0
- package/dist/number-D5QmTRsK.d.ts +48 -0
- package/dist/number-DomDs-l5.d.mts +47 -0
- package/dist/number-DvzbKHZR.d.ts +47 -0
- package/dist/person-DXne2mKX.d.ts +58 -0
- package/dist/person-Si_vy67g.d.mts +58 -0
- package/dist/phone-Cbxvm_Qv.d.ts +16 -0
- package/dist/phone-g4FDs50M.d.mts +16 -0
- package/dist/science-BX8WhoEY.d.ts +15 -0
- package/dist/science-BfA9sVXz.d.mts +15 -0
- package/dist/string-DGScZrrP.d.mts +87 -0
- package/dist/string-Do4vhsl0.d.ts +87 -0
- package/dist/system-BpxbduIr.d.ts +55 -0
- package/dist/system-Cy0e05Cr.d.mts +55 -0
- package/dist/system-EuG0S2Xy.d.mts +55 -0
- package/dist/system-ZV2S9Qw2.d.ts +55 -0
- package/dist/type.d.mts +85 -0
- package/dist/type.d.ts +85 -0
- package/dist/type.js +1 -0
- package/dist/type.mjs +1 -0
- package/dist/utils/airline.d.mts +2 -2
- package/dist/utils/airline.d.ts +2 -2
- package/dist/utils/airline.js +7 -5
- package/dist/utils/airline.mjs +6 -4
- package/dist/utils/animal.d.mts +2 -2
- package/dist/utils/animal.d.ts +2 -2
- package/dist/utils/animal.js +7 -5
- package/dist/utils/animal.mjs +6 -4
- package/dist/utils/color.d.mts +2 -2
- package/dist/utils/color.d.ts +2 -2
- package/dist/utils/color.js +7 -5
- package/dist/utils/color.mjs +6 -4
- package/dist/utils/commerce.d.mts +2 -2
- package/dist/utils/commerce.d.ts +2 -2
- package/dist/utils/commerce.js +7 -5
- package/dist/utils/commerce.mjs +6 -4
- package/dist/utils/common.d.mts +2 -2
- package/dist/utils/common.d.ts +2 -2
- package/dist/utils/common.js +5 -3
- package/dist/utils/common.mjs +4 -2
- package/dist/utils/company.d.mts +2 -2
- package/dist/utils/company.d.ts +2 -2
- package/dist/utils/company.js +7 -5
- package/dist/utils/company.mjs +6 -4
- package/dist/utils/database.d.mts +2 -2
- package/dist/utils/database.d.ts +2 -2
- package/dist/utils/database.js +7 -5
- package/dist/utils/database.mjs +6 -4
- package/dist/utils/datatype.d.mts +2 -2
- package/dist/utils/datatype.d.ts +2 -2
- package/dist/utils/datatype.js +7 -5
- package/dist/utils/datatype.mjs +6 -4
- package/dist/utils/datetime.d.mts +2 -2
- package/dist/utils/datetime.d.ts +2 -2
- package/dist/utils/datetime.js +7 -5
- package/dist/utils/datetime.mjs +6 -4
- package/dist/utils/finance.d.mts +2 -2
- package/dist/utils/finance.d.ts +2 -2
- package/dist/utils/finance.js +7 -5
- package/dist/utils/finance.mjs +6 -4
- package/dist/utils/food.d.mts +2 -2
- package/dist/utils/food.d.ts +2 -2
- package/dist/utils/food.js +7 -5
- package/dist/utils/food.mjs +6 -4
- package/dist/utils/git.d.mts +2 -2
- package/dist/utils/git.d.ts +2 -2
- package/dist/utils/git.js +7 -5
- package/dist/utils/git.mjs +6 -4
- package/dist/utils/hacker.d.mts +2 -2
- package/dist/utils/hacker.d.ts +2 -2
- package/dist/utils/hacker.js +7 -5
- package/dist/utils/hacker.mjs +6 -4
- package/dist/utils/image.d.mts +2 -2
- package/dist/utils/image.d.ts +2 -2
- package/dist/utils/image.js +7 -5
- package/dist/utils/image.mjs +6 -4
- package/dist/utils/index.d.mts +27 -27
- package/dist/utils/index.d.ts +27 -27
- package/dist/utils/index.js +31 -29
- package/dist/utils/index.mjs +30 -28
- package/dist/utils/internet.d.mts +3 -2
- package/dist/utils/internet.d.ts +3 -2
- package/dist/utils/internet.js +7 -5
- package/dist/utils/internet.mjs +6 -4
- package/dist/utils/location.d.mts +2 -2
- package/dist/utils/location.d.ts +2 -2
- package/dist/utils/location.js +7 -5
- package/dist/utils/location.mjs +6 -4
- package/dist/utils/lorem.d.mts +2 -2
- package/dist/utils/lorem.d.ts +2 -2
- package/dist/utils/lorem.js +7 -5
- package/dist/utils/lorem.mjs +6 -4
- package/dist/utils/music.d.mts +2 -2
- package/dist/utils/music.d.ts +2 -2
- package/dist/utils/music.js +7 -5
- package/dist/utils/music.mjs +6 -4
- package/dist/utils/number.d.mts +2 -2
- package/dist/utils/number.d.ts +2 -2
- package/dist/utils/number.js +7 -5
- package/dist/utils/number.mjs +6 -4
- package/dist/utils/person.d.mts +2 -2
- package/dist/utils/person.d.ts +2 -2
- package/dist/utils/person.js +7 -5
- package/dist/utils/person.mjs +6 -4
- package/dist/utils/phone.d.mts +2 -2
- package/dist/utils/phone.d.ts +2 -2
- package/dist/utils/phone.js +7 -5
- package/dist/utils/phone.mjs +6 -4
- package/dist/utils/science.d.mts +2 -2
- package/dist/utils/science.d.ts +2 -2
- package/dist/utils/science.js +7 -5
- package/dist/utils/science.mjs +6 -4
- package/dist/utils/string.d.mts +2 -2
- package/dist/utils/string.d.ts +2 -2
- package/dist/utils/string.js +7 -5
- package/dist/utils/string.mjs +6 -4
- package/dist/utils/system.d.mts +2 -2
- package/dist/utils/system.d.ts +2 -2
- package/dist/utils/system.js +7 -5
- package/dist/utils/system.mjs +6 -4
- package/dist/utils/utils.d.mts +2 -2
- package/dist/utils/utils.d.ts +2 -2
- package/dist/utils/utils.js +5 -3
- package/dist/utils/utils.mjs +4 -2
- package/dist/utils/vehicle.d.mts +2 -2
- package/dist/utils/vehicle.d.ts +2 -2
- package/dist/utils/vehicle.js +7 -5
- package/dist/utils/vehicle.mjs +6 -4
- package/dist/utils/word.d.mts +1 -1
- package/dist/utils/word.d.ts +1 -1
- package/dist/utils/word.js +14 -12
- package/dist/utils/word.mjs +5 -3
- package/dist/utils-BImnOpvp.d.ts +10 -0
- package/dist/utils-zJKwaMUY.d.mts +10 -0
- package/dist/vehicle-D4yBDYMc.d.mts +35 -0
- package/dist/vehicle-Ufz4AoXu.d.ts +35 -0
- package/package.json +9 -8
- package/src/config.ts +8 -0
- package/src/create_config.ts +27 -14
- package/src/create_generator_fn.ts +39 -0
- package/src/generator_fn.ts +9 -0
- package/src/index.ts +2 -0
- package/src/type.ts +108 -19
- package/tsconfig.json +4 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
arrayConfigScheme,
|
|
3
|
+
boundedSeriesScheme,
|
|
4
|
+
objConfigScheme,
|
|
5
|
+
selectionConfigScheme,
|
|
6
|
+
tupleConfigScheme,
|
|
7
|
+
valueConfigScheme
|
|
8
|
+
} from "./chunk-UP3FJ7EK.mjs";
|
|
9
|
+
import "./chunk-XGB3TDIC.mjs";
|
|
10
|
+
export {
|
|
11
|
+
arrayConfigScheme,
|
|
12
|
+
boundedSeriesScheme,
|
|
13
|
+
objConfigScheme,
|
|
14
|
+
selectionConfigScheme,
|
|
15
|
+
tupleConfigScheme,
|
|
16
|
+
valueConfigScheme
|
|
17
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ValueConfig, ArrayConfig, ObjectConfig, TupleConfig, SelectionConfig, BoundedSeriesConfig } from './type.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* value
|
|
5
|
+
* @param {function} generateFn - The function used to generate the value.
|
|
6
|
+
* @return {ValueConfig} The configuration object with the type "value" and the provided generate function.
|
|
7
|
+
*/
|
|
8
|
+
declare const createValueConfig: <T>(generateFn: () => T) => ValueConfig<T>;
|
|
9
|
+
/**
|
|
10
|
+
* selection
|
|
11
|
+
* @param {Array} items - The array of items to choose from.
|
|
12
|
+
* @return {SelectionConfig} The configuration object with the type "select" and the provided items.
|
|
13
|
+
*/
|
|
14
|
+
declare const createSelectionConfig: <T>(items: T[]) => SelectionConfig<T>;
|
|
15
|
+
/**
|
|
16
|
+
* object
|
|
17
|
+
* @param {object} content
|
|
18
|
+
* @return {ObjectConfig}
|
|
19
|
+
*/
|
|
20
|
+
declare const createObjectConfig: <T extends object>(content: T) => ObjectConfig<T>;
|
|
21
|
+
/**
|
|
22
|
+
* array
|
|
23
|
+
* @param {object} item
|
|
24
|
+
* @param {number} len
|
|
25
|
+
* @return {ArrayConfig}
|
|
26
|
+
*/
|
|
27
|
+
declare const createArrayConfig: <T>(item: T, len: number) => ArrayConfig<T>;
|
|
28
|
+
/**
|
|
29
|
+
* tuple
|
|
30
|
+
* @param {Array} configItems
|
|
31
|
+
* @return {TupleConfig}
|
|
32
|
+
*/
|
|
33
|
+
interface CreateTupleConfig {
|
|
34
|
+
<A, B, C, D, E, F, G, H, I, J>(configItems: [A, B, C, D, E, F, G, H, I, J]): TupleConfig<A, B, C, D, E, F, G, H, I, J>;
|
|
35
|
+
<A, B, C, D, E, F, G, H, I>(configItems: [A, B, C, D, E, F, G, H, I]): TupleConfig<A, B, C, D, E, F, G, H, I>;
|
|
36
|
+
<A, B, C, D, E, F, G, H>(configItems: [A, B, C, D, E, F, G, H]): TupleConfig<A, B, C, D, E, F, G, H>;
|
|
37
|
+
<A, B, C, D, E, F, G>(configItems: [A, B, C, D, E, F, G]): TupleConfig<A, B, C, D, E, F, G>;
|
|
38
|
+
<A, B, C, D, E, F>(configItems: [A, B, C, D, E, F]): TupleConfig<A, B, C, D, E, F>;
|
|
39
|
+
<A, B, C, D, E>(configItems: [A, B, C, D, E]): TupleConfig<A, B, C, D, E>;
|
|
40
|
+
<A, B, C, D>(configItems: [A, B, C, D]): TupleConfig<A, B, C, D>;
|
|
41
|
+
<A, B, C>(configItems: [A, B, C]): TupleConfig<A, B, C>;
|
|
42
|
+
<A, B>(configItems: [A, B]): TupleConfig<A, B>;
|
|
43
|
+
<A>(configItems: [A]): TupleConfig<A>;
|
|
44
|
+
}
|
|
45
|
+
declare const createTupleConfig: CreateTupleConfig;
|
|
46
|
+
/**
|
|
47
|
+
* bounded series
|
|
48
|
+
* @param {{ upperLimit: number, lowerLimit: number, createInitValue: () => number, count: number }} config
|
|
49
|
+
* @return {BoundedSeriesConfig}
|
|
50
|
+
*/
|
|
51
|
+
declare const createBoundedSeriesConfig: (config: Omit<BoundedSeriesConfig, "type">) => BoundedSeriesConfig;
|
|
52
|
+
|
|
53
|
+
export { createArrayConfig, createBoundedSeriesConfig, createObjectConfig, createSelectionConfig, createTupleConfig, createValueConfig };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ValueConfig, ArrayConfig, ObjectConfig, TupleConfig, SelectionConfig, BoundedSeriesConfig } from './type.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* value
|
|
5
|
+
* @param {function} generateFn - The function used to generate the value.
|
|
6
|
+
* @return {ValueConfig} The configuration object with the type "value" and the provided generate function.
|
|
7
|
+
*/
|
|
8
|
+
declare const createValueConfig: <T>(generateFn: () => T) => ValueConfig<T>;
|
|
9
|
+
/**
|
|
10
|
+
* selection
|
|
11
|
+
* @param {Array} items - The array of items to choose from.
|
|
12
|
+
* @return {SelectionConfig} The configuration object with the type "select" and the provided items.
|
|
13
|
+
*/
|
|
14
|
+
declare const createSelectionConfig: <T>(items: T[]) => SelectionConfig<T>;
|
|
15
|
+
/**
|
|
16
|
+
* object
|
|
17
|
+
* @param {object} content
|
|
18
|
+
* @return {ObjectConfig}
|
|
19
|
+
*/
|
|
20
|
+
declare const createObjectConfig: <T extends object>(content: T) => ObjectConfig<T>;
|
|
21
|
+
/**
|
|
22
|
+
* array
|
|
23
|
+
* @param {object} item
|
|
24
|
+
* @param {number} len
|
|
25
|
+
* @return {ArrayConfig}
|
|
26
|
+
*/
|
|
27
|
+
declare const createArrayConfig: <T>(item: T, len: number) => ArrayConfig<T>;
|
|
28
|
+
/**
|
|
29
|
+
* tuple
|
|
30
|
+
* @param {Array} configItems
|
|
31
|
+
* @return {TupleConfig}
|
|
32
|
+
*/
|
|
33
|
+
interface CreateTupleConfig {
|
|
34
|
+
<A, B, C, D, E, F, G, H, I, J>(configItems: [A, B, C, D, E, F, G, H, I, J]): TupleConfig<A, B, C, D, E, F, G, H, I, J>;
|
|
35
|
+
<A, B, C, D, E, F, G, H, I>(configItems: [A, B, C, D, E, F, G, H, I]): TupleConfig<A, B, C, D, E, F, G, H, I>;
|
|
36
|
+
<A, B, C, D, E, F, G, H>(configItems: [A, B, C, D, E, F, G, H]): TupleConfig<A, B, C, D, E, F, G, H>;
|
|
37
|
+
<A, B, C, D, E, F, G>(configItems: [A, B, C, D, E, F, G]): TupleConfig<A, B, C, D, E, F, G>;
|
|
38
|
+
<A, B, C, D, E, F>(configItems: [A, B, C, D, E, F]): TupleConfig<A, B, C, D, E, F>;
|
|
39
|
+
<A, B, C, D, E>(configItems: [A, B, C, D, E]): TupleConfig<A, B, C, D, E>;
|
|
40
|
+
<A, B, C, D>(configItems: [A, B, C, D]): TupleConfig<A, B, C, D>;
|
|
41
|
+
<A, B, C>(configItems: [A, B, C]): TupleConfig<A, B, C>;
|
|
42
|
+
<A, B>(configItems: [A, B]): TupleConfig<A, B>;
|
|
43
|
+
<A>(configItems: [A]): TupleConfig<A>;
|
|
44
|
+
}
|
|
45
|
+
declare const createTupleConfig: CreateTupleConfig;
|
|
46
|
+
/**
|
|
47
|
+
* bounded series
|
|
48
|
+
* @param {{ upperLimit: number, lowerLimit: number, createInitValue: () => number, count: number }} config
|
|
49
|
+
* @return {BoundedSeriesConfig}
|
|
50
|
+
*/
|
|
51
|
+
declare const createBoundedSeriesConfig: (config: Omit<BoundedSeriesConfig, "type">) => BoundedSeriesConfig;
|
|
52
|
+
|
|
53
|
+
export { createArrayConfig, createBoundedSeriesConfig, createObjectConfig, createSelectionConfig, createTupleConfig, createValueConfig };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkW6QSJNDJjs = require('./chunk-W6QSJNDJ.js');
|
|
9
|
+
require('./chunk-A4QVPMYT.js');
|
|
10
|
+
require('./chunk-4VNS5WPM.js');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.createArrayConfig = _chunkW6QSJNDJjs.createArrayConfig; exports.createBoundedSeriesConfig = _chunkW6QSJNDJjs.createBoundedSeriesConfig; exports.createObjectConfig = _chunkW6QSJNDJjs.createObjectConfig; exports.createSelectionConfig = _chunkW6QSJNDJjs.createSelectionConfig; exports.createTupleConfig = _chunkW6QSJNDJjs.createTupleConfig; exports.createValueConfig = _chunkW6QSJNDJjs.createValueConfig;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createArrayConfig,
|
|
3
|
+
createBoundedSeriesConfig,
|
|
4
|
+
createObjectConfig,
|
|
5
|
+
createSelectionConfig,
|
|
6
|
+
createTupleConfig,
|
|
7
|
+
createValueConfig
|
|
8
|
+
} from "./chunk-RDATYKAG.mjs";
|
|
9
|
+
import "./chunk-UP3FJ7EK.mjs";
|
|
10
|
+
import "./chunk-XGB3TDIC.mjs";
|
|
11
|
+
export {
|
|
12
|
+
createArrayConfig,
|
|
13
|
+
createBoundedSeriesConfig,
|
|
14
|
+
createObjectConfig,
|
|
15
|
+
createSelectionConfig,
|
|
16
|
+
createTupleConfig,
|
|
17
|
+
createValueConfig
|
|
18
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkGNPP2GGZjs = require('./chunk-GNPP2GGZ.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkW6QSJNDJjs = require('./chunk-W6QSJNDJ.js');
|
|
13
|
+
require('./chunk-A4QVPMYT.js');
|
|
14
|
+
require('./chunk-4VNS5WPM.js');
|
|
15
|
+
|
|
16
|
+
// src/create_config.test.ts
|
|
17
|
+
_chunkGNPP2GGZjs.test.call(void 0, "createValueConfig", () => {
|
|
18
|
+
const valueConfig = _chunkW6QSJNDJjs.createValueConfig.call(void 0, () => 44);
|
|
19
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, valueConfig.type).toBe("value");
|
|
20
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, valueConfig.generateFn).toBeTypeOf("function");
|
|
21
|
+
});
|
|
22
|
+
_chunkGNPP2GGZjs.test.call(void 0, "createSelectionConfig", () => {
|
|
23
|
+
const options = [1, 2, 3, 4];
|
|
24
|
+
const selectionConfig = _chunkW6QSJNDJjs.createSelectionConfig.call(void 0, [1, 2, 3, 4]);
|
|
25
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, selectionConfig.type).toBe("select");
|
|
26
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, selectionConfig.items).toEqual(options);
|
|
27
|
+
});
|
|
28
|
+
_chunkGNPP2GGZjs.test.call(void 0, "createArrayConfig", () => {
|
|
29
|
+
const valueConfig = _chunkW6QSJNDJjs.createValueConfig.call(void 0, () => 44);
|
|
30
|
+
const arrConfig = _chunkW6QSJNDJjs.createArrayConfig.call(void 0, valueConfig, 20);
|
|
31
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, arrConfig.type).toBe("arr");
|
|
32
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, arrConfig.len).toBe(20);
|
|
33
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, arrConfig.item).toEqual(valueConfig);
|
|
34
|
+
});
|
|
35
|
+
_chunkGNPP2GGZjs.test.call(void 0, "createTupleConfig", () => {
|
|
36
|
+
const value1Config = _chunkW6QSJNDJjs.createValueConfig.call(void 0, () => 123);
|
|
37
|
+
const value2Config = _chunkW6QSJNDJjs.createValueConfig.call(void 0, () => "hello");
|
|
38
|
+
const tupleConfig = _chunkW6QSJNDJjs.createTupleConfig.call(void 0, [value1Config, value2Config]);
|
|
39
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, tupleConfig.type).toBe("tuple");
|
|
40
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, tupleConfig.configItems).toEqual([value1Config, value2Config]);
|
|
41
|
+
});
|
|
42
|
+
_chunkGNPP2GGZjs.test.call(void 0, "createObjConfig", () => {
|
|
43
|
+
const value1Config = _chunkW6QSJNDJjs.createValueConfig.call(void 0, () => 32);
|
|
44
|
+
const value2Config = _chunkW6QSJNDJjs.createValueConfig.call(void 0, () => "frank");
|
|
45
|
+
const objConfig = _chunkW6QSJNDJjs.createObjectConfig.call(void 0, {
|
|
46
|
+
name: value2Config,
|
|
47
|
+
age: value1Config
|
|
48
|
+
});
|
|
49
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, objConfig.type).toBe("obj");
|
|
50
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, objConfig.content).toEqual({ name: value2Config, age: value1Config });
|
|
51
|
+
});
|
|
52
|
+
_chunkGNPP2GGZjs.test.call(void 0, "createBoundedSeriesConfig", () => {
|
|
53
|
+
const boundedSeriesConfig = _chunkW6QSJNDJjs.createBoundedSeriesConfig.call(void 0, {
|
|
54
|
+
count: 1,
|
|
55
|
+
upperLimit: 1.2,
|
|
56
|
+
lowerLimit: 1,
|
|
57
|
+
createInitValue: () => 40
|
|
58
|
+
});
|
|
59
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, boundedSeriesConfig.type).toBe("bounded_series");
|
|
60
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, boundedSeriesConfig.upperLimit).toBe(1.2);
|
|
61
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, boundedSeriesConfig.lowerLimit).toBe(1);
|
|
62
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, boundedSeriesConfig.createInitValue).toBeTypeOf("function");
|
|
63
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
globalExpect,
|
|
3
|
+
test
|
|
4
|
+
} from "./chunk-G73JPAKW.mjs";
|
|
5
|
+
import {
|
|
6
|
+
createArrayConfig,
|
|
7
|
+
createBoundedSeriesConfig,
|
|
8
|
+
createObjectConfig,
|
|
9
|
+
createSelectionConfig,
|
|
10
|
+
createTupleConfig,
|
|
11
|
+
createValueConfig
|
|
12
|
+
} from "./chunk-RDATYKAG.mjs";
|
|
13
|
+
import "./chunk-UP3FJ7EK.mjs";
|
|
14
|
+
import "./chunk-XGB3TDIC.mjs";
|
|
15
|
+
|
|
16
|
+
// src/create_config.test.ts
|
|
17
|
+
test("createValueConfig", () => {
|
|
18
|
+
const valueConfig = createValueConfig(() => 44);
|
|
19
|
+
globalExpect(valueConfig.type).toBe("value");
|
|
20
|
+
globalExpect(valueConfig.generateFn).toBeTypeOf("function");
|
|
21
|
+
});
|
|
22
|
+
test("createSelectionConfig", () => {
|
|
23
|
+
const options = [1, 2, 3, 4];
|
|
24
|
+
const selectionConfig = createSelectionConfig([1, 2, 3, 4]);
|
|
25
|
+
globalExpect(selectionConfig.type).toBe("select");
|
|
26
|
+
globalExpect(selectionConfig.items).toEqual(options);
|
|
27
|
+
});
|
|
28
|
+
test("createArrayConfig", () => {
|
|
29
|
+
const valueConfig = createValueConfig(() => 44);
|
|
30
|
+
const arrConfig = createArrayConfig(valueConfig, 20);
|
|
31
|
+
globalExpect(arrConfig.type).toBe("arr");
|
|
32
|
+
globalExpect(arrConfig.len).toBe(20);
|
|
33
|
+
globalExpect(arrConfig.item).toEqual(valueConfig);
|
|
34
|
+
});
|
|
35
|
+
test("createTupleConfig", () => {
|
|
36
|
+
const value1Config = createValueConfig(() => 123);
|
|
37
|
+
const value2Config = createValueConfig(() => "hello");
|
|
38
|
+
const tupleConfig = createTupleConfig([value1Config, value2Config]);
|
|
39
|
+
globalExpect(tupleConfig.type).toBe("tuple");
|
|
40
|
+
globalExpect(tupleConfig.configItems).toEqual([value1Config, value2Config]);
|
|
41
|
+
});
|
|
42
|
+
test("createObjConfig", () => {
|
|
43
|
+
const value1Config = createValueConfig(() => 32);
|
|
44
|
+
const value2Config = createValueConfig(() => "frank");
|
|
45
|
+
const objConfig = createObjectConfig({
|
|
46
|
+
name: value2Config,
|
|
47
|
+
age: value1Config
|
|
48
|
+
});
|
|
49
|
+
globalExpect(objConfig.type).toBe("obj");
|
|
50
|
+
globalExpect(objConfig.content).toEqual({ name: value2Config, age: value1Config });
|
|
51
|
+
});
|
|
52
|
+
test("createBoundedSeriesConfig", () => {
|
|
53
|
+
const boundedSeriesConfig = createBoundedSeriesConfig({
|
|
54
|
+
count: 1,
|
|
55
|
+
upperLimit: 1.2,
|
|
56
|
+
lowerLimit: 1,
|
|
57
|
+
createInitValue: () => 40
|
|
58
|
+
});
|
|
59
|
+
globalExpect(boundedSeriesConfig.type).toBe("bounded_series");
|
|
60
|
+
globalExpect(boundedSeriesConfig.upperLimit).toBe(1.2);
|
|
61
|
+
globalExpect(boundedSeriesConfig.lowerLimit).toBe(1);
|
|
62
|
+
globalExpect(boundedSeriesConfig.createInitValue).toBeTypeOf("function");
|
|
63
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ValueConfig, SelectionConfig, Result, ObjectConfig, ArrayConfig, TupleConfig, BoundedSeriesConfig } from './type.mjs';
|
|
2
|
+
|
|
3
|
+
type AllConfig<T> = ValueConfig<T> | SelectionConfig<T> | ArrayConfig<T> | ObjectConfig<T> | TupleConfig<T> | TupleConfig<T, T> | TupleConfig<T, T, T> | TupleConfig<T, T, T, T> | TupleConfig<T, T, T, T, T> | TupleConfig<T, T, T, T, T, T> | TupleConfig<T, T, T, T, T, T, T> | TupleConfig<T, T, T, T, T, T, T, T> | TupleConfig<T, T, T, T, T, T, T, T, T> | TupleConfig<T, T, T, T, T, T, T, T, T, T> | BoundedSeriesConfig;
|
|
4
|
+
declare const createValueGenerator: <R = unknown>(config: ValueConfig<unknown>) => (() => R);
|
|
5
|
+
declare const createSelectionGenerator: <T extends SelectionConfig<unknown>>(config: T) => (() => Result<T>);
|
|
6
|
+
declare const createObjectGenerator: <T extends ObjectConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
7
|
+
declare const createArrayGenerator: <T extends ArrayConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
8
|
+
declare const createTupleGenerator: <T extends TupleConfig<unknown, unknown, unknown, unknown, unknown> | TupleConfig<unknown, unknown, unknown, unknown> | TupleConfig<unknown, unknown, unknown> | TupleConfig<unknown, unknown> | TupleConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
9
|
+
declare const createBoundedSeriesGenerator: <T extends BoundedSeriesConfig>(config: T) => (() => Result<T>);
|
|
10
|
+
declare const createGeneratorByType: <T extends AllConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
11
|
+
|
|
12
|
+
export { createArrayGenerator, createBoundedSeriesGenerator, createGeneratorByType, createObjectGenerator, createSelectionGenerator, createTupleGenerator, createValueGenerator };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ValueConfig, SelectionConfig, Result, ObjectConfig, ArrayConfig, TupleConfig, BoundedSeriesConfig } from './type.js';
|
|
2
|
+
|
|
3
|
+
type AllConfig<T> = ValueConfig<T> | SelectionConfig<T> | ArrayConfig<T> | ObjectConfig<T> | TupleConfig<T> | TupleConfig<T, T> | TupleConfig<T, T, T> | TupleConfig<T, T, T, T> | TupleConfig<T, T, T, T, T> | TupleConfig<T, T, T, T, T, T> | TupleConfig<T, T, T, T, T, T, T> | TupleConfig<T, T, T, T, T, T, T, T> | TupleConfig<T, T, T, T, T, T, T, T, T> | TupleConfig<T, T, T, T, T, T, T, T, T, T> | BoundedSeriesConfig;
|
|
4
|
+
declare const createValueGenerator: <R = unknown>(config: ValueConfig<unknown>) => (() => R);
|
|
5
|
+
declare const createSelectionGenerator: <T extends SelectionConfig<unknown>>(config: T) => (() => Result<T>);
|
|
6
|
+
declare const createObjectGenerator: <T extends ObjectConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
7
|
+
declare const createArrayGenerator: <T extends ArrayConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
8
|
+
declare const createTupleGenerator: <T extends TupleConfig<unknown, unknown, unknown, unknown, unknown> | TupleConfig<unknown, unknown, unknown, unknown> | TupleConfig<unknown, unknown, unknown> | TupleConfig<unknown, unknown> | TupleConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
9
|
+
declare const createBoundedSeriesGenerator: <T extends BoundedSeriesConfig>(config: T) => (() => Result<T>);
|
|
10
|
+
declare const createGeneratorByType: <T extends AllConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
11
|
+
|
|
12
|
+
export { createArrayGenerator, createBoundedSeriesGenerator, createGeneratorByType, createObjectGenerator, createSelectionGenerator, createTupleGenerator, createValueGenerator };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkHMDAKHLFjs = require('./chunk-HMDAKHLF.js');
|
|
10
|
+
require('./chunk-TZ2RKEBF.js');
|
|
11
|
+
require('./chunk-A4QVPMYT.js');
|
|
12
|
+
require('./chunk-4VNS5WPM.js');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
exports.createArrayGenerator = _chunkHMDAKHLFjs.createArrayGenerator; exports.createBoundedSeriesGenerator = _chunkHMDAKHLFjs.createBoundedSeriesGenerator; exports.createGeneratorByType = _chunkHMDAKHLFjs.createGeneratorByType; exports.createObjectGenerator = _chunkHMDAKHLFjs.createObjectGenerator; exports.createSelectionGenerator = _chunkHMDAKHLFjs.createSelectionGenerator; exports.createTupleGenerator = _chunkHMDAKHLFjs.createTupleGenerator; exports.createValueGenerator = _chunkHMDAKHLFjs.createValueGenerator;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createArrayGenerator,
|
|
3
|
+
createBoundedSeriesGenerator,
|
|
4
|
+
createGeneratorByType,
|
|
5
|
+
createObjectGenerator,
|
|
6
|
+
createSelectionGenerator,
|
|
7
|
+
createTupleGenerator,
|
|
8
|
+
createValueGenerator
|
|
9
|
+
} from "./chunk-6TGTIMX2.mjs";
|
|
10
|
+
import "./chunk-3U6BNHWG.mjs";
|
|
11
|
+
import "./chunk-UP3FJ7EK.mjs";
|
|
12
|
+
import "./chunk-XGB3TDIC.mjs";
|
|
13
|
+
export {
|
|
14
|
+
createArrayGenerator,
|
|
15
|
+
createBoundedSeriesGenerator,
|
|
16
|
+
createGeneratorByType,
|
|
17
|
+
createObjectGenerator,
|
|
18
|
+
createSelectionGenerator,
|
|
19
|
+
createTupleGenerator,
|
|
20
|
+
createValueGenerator
|
|
21
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkGNPP2GGZjs = require('./chunk-GNPP2GGZ.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunkW6QSJNDJjs = require('./chunk-W6QSJNDJ.js');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
var _chunkHMDAKHLFjs = require('./chunk-HMDAKHLF.js');
|
|
21
|
+
require('./chunk-TZ2RKEBF.js');
|
|
22
|
+
require('./chunk-A4QVPMYT.js');
|
|
23
|
+
require('./chunk-4VNS5WPM.js');
|
|
24
|
+
|
|
25
|
+
// src/create_generator_fn.test.ts
|
|
26
|
+
_chunkGNPP2GGZjs.describe.call(void 0, "createValueGenerator", () => {
|
|
27
|
+
_chunkGNPP2GGZjs.test.call(void 0, "normal", () => {
|
|
28
|
+
const value = _chunkHMDAKHLFjs.createValueGenerator.call(void 0, {
|
|
29
|
+
type: "value",
|
|
30
|
+
generateFn: () => 50
|
|
31
|
+
})();
|
|
32
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, value).toBe(50);
|
|
33
|
+
const value2 = _chunkHMDAKHLFjs.createValueGenerator.call(void 0, {
|
|
34
|
+
type: "value",
|
|
35
|
+
generateFn: () => ({ age: 100, name: "hello" })
|
|
36
|
+
})();
|
|
37
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, value2).toEqual({ age: 100, name: "hello" });
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
_chunkGNPP2GGZjs.describe.call(void 0, "createSelectionGenerator", () => {
|
|
41
|
+
_chunkGNPP2GGZjs.test.call(void 0, "normal", () => {
|
|
42
|
+
const value = _chunkHMDAKHLFjs.createSelectionGenerator.call(void 0, {
|
|
43
|
+
type: "select",
|
|
44
|
+
items: [1]
|
|
45
|
+
})();
|
|
46
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, value).toBe(1);
|
|
47
|
+
const value2 = _chunkHMDAKHLFjs.createSelectionGenerator.call(void 0, {
|
|
48
|
+
type: "select",
|
|
49
|
+
items: [30, 30, 30, 30]
|
|
50
|
+
})();
|
|
51
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, value2).toBe(30);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
_chunkGNPP2GGZjs.describe.call(void 0, "createArrayGenerator", () => {
|
|
55
|
+
_chunkGNPP2GGZjs.test.call(void 0, "normal", () => {
|
|
56
|
+
const list = _chunkHMDAKHLFjs.createArrayGenerator.call(void 0, {
|
|
57
|
+
type: "arr",
|
|
58
|
+
len: 5,
|
|
59
|
+
item: { type: "value", generateFn: () => ({ age: 42 }) }
|
|
60
|
+
})();
|
|
61
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, list).toEqual([
|
|
62
|
+
{ age: 42 },
|
|
63
|
+
{ age: 42 },
|
|
64
|
+
{ age: 42 },
|
|
65
|
+
{ age: 42 },
|
|
66
|
+
{ age: 42 }
|
|
67
|
+
]);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
_chunkGNPP2GGZjs.describe.call(void 0, "createTupleGenerator", () => {
|
|
71
|
+
_chunkGNPP2GGZjs.test.call(void 0, "normal", () => {
|
|
72
|
+
const tuple = _chunkHMDAKHLFjs.createTupleGenerator.call(void 0,
|
|
73
|
+
_chunkW6QSJNDJjs.createTupleConfig.call(void 0, [
|
|
74
|
+
_chunkW6QSJNDJjs.createValueConfig.call(void 0, () => 225),
|
|
75
|
+
_chunkW6QSJNDJjs.createValueConfig.call(void 0, () => "hello world")
|
|
76
|
+
])
|
|
77
|
+
)();
|
|
78
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, tuple.length).toBe(2);
|
|
79
|
+
const [num, str] = tuple;
|
|
80
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, num).toBe(225);
|
|
81
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, str).toBe("hello world");
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
_chunkGNPP2GGZjs.describe.call(void 0, "createObjectGenerator", () => {
|
|
85
|
+
_chunkGNPP2GGZjs.test.call(void 0, "normal", () => {
|
|
86
|
+
const obj = _chunkHMDAKHLFjs.createObjectGenerator.call(void 0, {
|
|
87
|
+
type: "obj",
|
|
88
|
+
content: {
|
|
89
|
+
name: { type: "value", generateFn: () => "John" },
|
|
90
|
+
age: { type: "value", generateFn: () => 50 },
|
|
91
|
+
location: { type: "value", generateFn: () => "Taiwan" }
|
|
92
|
+
}
|
|
93
|
+
})();
|
|
94
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, obj).toEqual({ name: "John", age: 50, location: "Taiwan" });
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
_chunkGNPP2GGZjs.describe.call(void 0, "createBoundedSeriesGenerator", () => {
|
|
98
|
+
_chunkGNPP2GGZjs.test.call(void 0, "normal", () => {
|
|
99
|
+
const upperLimit = 1.1;
|
|
100
|
+
const lowerLimit = 0.9;
|
|
101
|
+
const initValue = 100;
|
|
102
|
+
const count = 100;
|
|
103
|
+
const list = _chunkHMDAKHLFjs.createBoundedSeriesGenerator.call(void 0, {
|
|
104
|
+
type: "bounded_series",
|
|
105
|
+
upperLimit,
|
|
106
|
+
lowerLimit,
|
|
107
|
+
createInitValue: () => initValue,
|
|
108
|
+
count
|
|
109
|
+
})();
|
|
110
|
+
for (let i = 0; i < count; i++) {
|
|
111
|
+
const value = list[i];
|
|
112
|
+
if (i === 0) {
|
|
113
|
+
const ratio2 = value / initValue;
|
|
114
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, ratio2).toBeLessThanOrEqual(upperLimit);
|
|
115
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, ratio2).toBeGreaterThanOrEqual(lowerLimit);
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
const prevValue = list[i - 1];
|
|
119
|
+
const ratio = value / prevValue;
|
|
120
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, ratio).toBeLessThanOrEqual(upperLimit);
|
|
121
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, ratio).toBeGreaterThanOrEqual(lowerLimit);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
_chunkGNPP2GGZjs.describe.call(void 0, "createGeneratorByType", () => {
|
|
126
|
+
_chunkGNPP2GGZjs.test.call(void 0, "normal", () => {
|
|
127
|
+
const config = _chunkW6QSJNDJjs.createObjectConfig.call(void 0, {
|
|
128
|
+
name: _chunkW6QSJNDJjs.createValueConfig.call(void 0, () => "John"),
|
|
129
|
+
age: _chunkW6QSJNDJjs.createValueConfig.call(void 0, () => 50),
|
|
130
|
+
locations: _chunkW6QSJNDJjs.createArrayConfig.call(void 0,
|
|
131
|
+
_chunkW6QSJNDJjs.createValueConfig.call(void 0, () => "Taiwan"),
|
|
132
|
+
5
|
|
133
|
+
)
|
|
134
|
+
});
|
|
135
|
+
const result = _chunkHMDAKHLFjs.createGeneratorByType.call(void 0, config)();
|
|
136
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, result).toEqual({
|
|
137
|
+
name: "John",
|
|
138
|
+
age: 50,
|
|
139
|
+
locations: ["Taiwan", "Taiwan", "Taiwan", "Taiwan", "Taiwan"]
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
_chunkGNPP2GGZjs.test.call(void 0, "test error config", () => {
|
|
143
|
+
const config = {
|
|
144
|
+
type: "obj",
|
|
145
|
+
content: {
|
|
146
|
+
name: {
|
|
147
|
+
type: "123",
|
|
148
|
+
generateFn: "John"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, () => _chunkHMDAKHLFjs.createGeneratorByType.call(void 0, config)).toThrowError();
|
|
153
|
+
});
|
|
154
|
+
_chunkGNPP2GGZjs.test.call(void 0, "with custom type match", () => {
|
|
155
|
+
const createIntValueConfig = (option) => _chunkW6QSJNDJjs.createValueConfig.call(void 0, () => 50);
|
|
156
|
+
const createEmailValueConfig = (option) => _chunkW6QSJNDJjs.createValueConfig.call(void 0, () => "xxx@example.com");
|
|
157
|
+
const customTypeMatch = (config2) => {
|
|
158
|
+
if (config2.type === "int") {
|
|
159
|
+
return createIntValueConfig(config2.option);
|
|
160
|
+
}
|
|
161
|
+
if (config2.type === "email") {
|
|
162
|
+
return createEmailValueConfig(config2.option);
|
|
163
|
+
}
|
|
164
|
+
throw Error("error");
|
|
165
|
+
};
|
|
166
|
+
const config = _chunkW6QSJNDJjs.createObjectConfig.call(void 0, {
|
|
167
|
+
name: { type: "value", generateFn: () => "John" },
|
|
168
|
+
age: { type: "int" },
|
|
169
|
+
email: { type: "email" }
|
|
170
|
+
});
|
|
171
|
+
const result = _chunkHMDAKHLFjs.createGeneratorByType.call(void 0, config, customTypeMatch)();
|
|
172
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, result).toEqual({
|
|
173
|
+
name: "John",
|
|
174
|
+
age: 50,
|
|
175
|
+
email: "xxx@example.com"
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
});
|