struct-fakerator 2.6.9 → 2.8.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/README.md +148 -93
- package/biome.json +30 -26
- package/dist/config.d.ts +1 -2
- package/dist/config.js +51 -19
- package/dist/config.mjs +2 -19
- package/dist/config_scheme.d.ts +7 -10
- package/dist/config_scheme.js +95 -17
- package/dist/config_scheme.mjs +46 -17
- package/dist/create_config.d.ts +9 -11
- package/dist/create_config.js +110 -18
- package/dist/create_config.mjs +60 -17
- package/dist/create_config.test.d.ts +1 -2
- package/dist/create_generator_fn.d.ts +9 -11
- package/dist/create_generator_fn.js +168 -21
- package/dist/create_generator_fn.mjs +115 -20
- package/dist/create_generator_fn.test.d.ts +1 -2
- package/dist/generator_fn.d.ts +1 -2
- package/dist/generator_fn.js +54 -22
- package/dist/generator_fn.mjs +2 -22
- package/dist/index.d.ts +5 -5
- package/dist/index.js +107 -44
- package/dist/index.mjs +6 -44
- package/dist/type.d.ts +10 -12
- package/dist/type.js +18 -1
- package/dist/type.mjs +0 -1
- package/dist/utils/airline.d.ts +14 -3
- package/dist/utils/airline.js +46 -15
- package/dist/utils/airline.mjs +6 -15
- package/dist/utils/animal.d.ts +30 -2
- package/dist/utils/animal.js +94 -39
- package/dist/utils/animal.mjs +18 -39
- package/dist/utils/color.d.ts +41 -3
- package/dist/utils/color.js +78 -31
- package/dist/utils/color.mjs +14 -31
- package/dist/utils/commerce.d.ts +24 -2
- package/dist/utils/commerce.js +66 -25
- package/dist/utils/commerce.mjs +11 -25
- package/dist/utils/common.d.ts +2 -2
- package/dist/utils/common.js +37 -9
- package/dist/utils/common.mjs +3 -9
- package/dist/utils/company.d.ts +18 -2
- package/dist/utils/company.js +70 -27
- package/dist/utils/company.mjs +12 -27
- package/dist/utils/database.d.ts +10 -2
- package/dist/utils/database.js +54 -19
- package/dist/utils/database.mjs +8 -19
- package/dist/utils/datatype.d.ts +4 -2
- package/dist/utils/datatype.js +38 -11
- package/dist/utils/datatype.mjs +4 -11
- package/dist/utils/datetime.d.ts +59 -2
- package/dist/utils/datetime.js +78 -31
- package/dist/utils/datetime.mjs +14 -31
- package/dist/utils/finance.d.ts +62 -3
- package/dist/utils/finance.js +110 -47
- package/dist/utils/finance.mjs +22 -47
- package/dist/utils/food.d.ts +18 -2
- package/dist/utils/food.js +70 -27
- package/dist/utils/food.mjs +12 -27
- package/dist/utils/git.d.ts +18 -2
- package/dist/utils/git.js +54 -19
- package/dist/utils/git.mjs +8 -19
- package/dist/utils/hacker.d.ts +12 -2
- package/dist/utils/hacker.js +58 -21
- package/dist/utils/hacker.mjs +9 -21
- package/dist/utils/image.d.ts +40 -2
- package/dist/utils/image.js +66 -25
- package/dist/utils/image.mjs +11 -25
- package/dist/utils/index.d.ts +26 -28
- package/dist/utils/index.js +136 -110
- package/dist/utils/index.mjs +27 -110
- package/dist/utils/internet.d.ts +77 -3
- package/dist/utils/internet.js +114 -49
- package/dist/utils/internet.mjs +23 -49
- package/dist/utils/location.d.ts +56 -2
- package/dist/utils/location.js +98 -41
- package/dist/utils/location.mjs +19 -41
- package/dist/utils/lorem.d.ts +45 -2
- package/dist/utils/lorem.js +70 -27
- package/dist/utils/lorem.mjs +12 -27
- package/dist/utils/music.d.ts +8 -2
- package/dist/utils/music.js +50 -17
- package/dist/utils/music.mjs +7 -17
- package/dist/utils/number.d.ts +34 -2
- package/dist/utils/number.js +58 -21
- package/dist/utils/number.mjs +9 -21
- package/dist/utils/person.d.ts +34 -3
- package/dist/utils/person.js +94 -39
- package/dist/utils/person.mjs +18 -39
- package/dist/utils/phone.d.ts +6 -2
- package/dist/utils/phone.js +42 -13
- package/dist/utils/phone.mjs +5 -13
- package/dist/utils/science.d.ts +4 -3
- package/dist/utils/science.js +42 -13
- package/dist/utils/science.mjs +5 -13
- package/dist/utils/string.d.ts +69 -2
- package/dist/utils/string.js +74 -29
- package/dist/utils/string.mjs +13 -29
- package/dist/utils/system.d.ts +35 -2
- package/dist/utils/system.js +82 -33
- package/dist/utils/system.mjs +15 -33
- package/dist/utils/utils.d.ts +2 -2
- package/dist/utils/utils.js +39 -9
- package/dist/utils/utils.mjs +5 -9
- package/dist/utils/vehicle.d.ts +18 -2
- package/dist/utils/vehicle.js +70 -27
- package/dist/utils/vehicle.mjs +12 -27
- package/dist/utils/word.d.ts +18 -22
- package/dist/utils/word.js +70 -31
- package/dist/utils/word.mjs +12 -31
- package/package.json +10 -31
- package/pnpm-workspace.yaml +2 -0
- package/rslib.config.ts +26 -0
- package/src/config.ts +3 -3
- package/src/config_scheme.ts +1 -1
- package/src/create_config.test.ts +0 -1
- package/src/create_config.ts +1 -1
- package/src/create_generator_fn.test.ts +13 -2
- package/src/create_generator_fn.ts +5 -5
- package/src/generator_fn.ts +1 -1
- package/src/index.ts +2 -2
- package/src/type.ts +1 -1
- package/src/utils/index.ts +1 -2
- package/src/utils/internet.ts +1 -1
- package/src/utils/utils.ts +1 -1
- package/tsconfig.json +2 -1
- package/dist/airline-98MCzMN8.d.ts +0 -26
- package/dist/airline-CuAxOEYH.d.mts +0 -26
- package/dist/animal-BohQ7s0w.d.mts +0 -53
- package/dist/animal-o8BFF7gd.d.ts +0 -53
- package/dist/chunk-23I6D5SJ.js +0 -57
- package/dist/chunk-3KXIZTCT.mjs +0 -20
- package/dist/chunk-3U6BNHWG.mjs +0 -2040
- package/dist/chunk-4DDCMYY5.mjs +0 -57
- package/dist/chunk-4VNS5WPM.js +0 -42
- package/dist/chunk-5KF6D2RT.js +0 -63
- package/dist/chunk-5O3L5474.mjs +0 -45
- package/dist/chunk-5PCDQHI5.mjs +0 -21
- package/dist/chunk-62INTWCD.mjs +0 -36
- package/dist/chunk-6HRHPVPM.js +0 -35
- package/dist/chunk-6UFUX7X4.js +0 -51
- package/dist/chunk-6ZK2LMFM.js +0 -21
- package/dist/chunk-7BIWHK77.js +0 -42
- package/dist/chunk-7UQSPUCL.mjs +0 -0
- package/dist/chunk-7VOPOQZO.js +0 -45
- package/dist/chunk-C3RGM3CB.js +0 -67
- package/dist/chunk-DGW666Q6.mjs +0 -48
- package/dist/chunk-DM5VFX6B.js +0 -17008
- package/dist/chunk-DTC7Q7P5.js +0 -45
- package/dist/chunk-EM67LVYX.mjs +0 -18
- package/dist/chunk-EMCK2BLM.js +0 -45
- package/dist/chunk-ES2CYGB7.js +0 -24
- package/dist/chunk-ET6EJB33.js +0 -36
- package/dist/chunk-EYOBG3PQ.mjs +0 -45
- package/dist/chunk-F4GVSNLH.js +0 -30
- package/dist/chunk-G43WDHZO.mjs +0 -63
- package/dist/chunk-GJSTX6ZS.mjs +0 -24
- package/dist/chunk-GYF6YSNX.js +0 -74
- package/dist/chunk-HBJP434N.mjs +0 -78
- package/dist/chunk-IAR3DUKD.js +0 -49
- package/dist/chunk-IL4E3ZNB.js +0 -78
- package/dist/chunk-IOXGSFEU.js +0 -20
- package/dist/chunk-JB6NCVX3.mjs +0 -63
- package/dist/chunk-JGY3KVDU.mjs +0 -45
- package/dist/chunk-JWCDEYMY.js +0 -48
- package/dist/chunk-LSFOERXQ.js +0 -18
- package/dist/chunk-MGR2M7BS.mjs +0 -56
- package/dist/chunk-MLJAHDYX.mjs +0 -167
- package/dist/chunk-MROZIQOV.mjs +0 -51
- package/dist/chunk-NHYNERHW.js +0 -56
- package/dist/chunk-PGSJJESY.js +0 -27
- package/dist/chunk-QTVSUA5W.mjs +0 -24
- package/dist/chunk-QZQ32UPU.mjs +0 -28
- package/dist/chunk-R2MQ3IW5.mjs +0 -33
- package/dist/chunk-RD2SB2KT.js +0 -36
- package/dist/chunk-RDZI4CMI.mjs +0 -42
- package/dist/chunk-RTYV5XDU.mjs +0 -36
- package/dist/chunk-RZPUHXXO.mjs +0 -49
- package/dist/chunk-SD3HVRQN.mjs +0 -48
- package/dist/chunk-SN4QTD6R.js +0 -1
- package/dist/chunk-TA725QXR.mjs +0 -35
- package/dist/chunk-TXAOQHVV.mjs +0 -27
- package/dist/chunk-TZ2RKEBF.js +0 -2040
- package/dist/chunk-U7MLTDS4.js +0 -167
- package/dist/chunk-UIYW7U2O.js +0 -28
- package/dist/chunk-UP2JIDGZ.js +0 -81
- package/dist/chunk-USLYTOPD.mjs +0 -41
- package/dist/chunk-V2AWKRQI.js +0 -26
- package/dist/chunk-VE3Q5LC3.mjs +0 -26
- package/dist/chunk-VG6JYCUC.mjs +0 -74
- package/dist/chunk-VMSMHNPY.js +0 -48
- package/dist/chunk-VSZRD7CB.js +0 -33
- package/dist/chunk-VX2IFBCP.mjs +0 -17008
- package/dist/chunk-WLKNXHFN.mjs +0 -30
- package/dist/chunk-XGB3TDIC.mjs +0 -42
- package/dist/chunk-YXGKUR3R.js +0 -63
- package/dist/chunk-Z5BNMPTX.mjs +0 -81
- package/dist/chunk-ZQA42PYM.mjs +0 -67
- package/dist/chunk-ZSR4TJQG.js +0 -24
- package/dist/chunk-ZWLHVT5O.js +0 -41
- package/dist/color-BT6BF8oV.d.mts +0 -61
- package/dist/color-lBH29suB.d.ts +0 -61
- package/dist/commerce-BqVjXEhQ.d.mts +0 -40
- package/dist/commerce-mdOpchjx.d.ts +0 -40
- package/dist/common-IR_KozaJ.d.mts +0 -11
- package/dist/common-t-ZQebCq.d.ts +0 -11
- package/dist/company-C3EU1J7k.d.ts +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_scheme.d.mts +0 -32
- package/dist/create_config.d.mts +0 -58
- 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.test.d.mts +0 -2
- package/dist/create_generator_fn.test.js +0 -191
- package/dist/create_generator_fn.test.mjs +0 -191
- package/dist/database-DV9wgnca.d.ts +0 -23
- package/dist/database-UzO1Lwec.d.mts +0 -23
- package/dist/datatype-C92TZLxo.d.ts +0 -13
- package/dist/datatype-DZjmP0fA.d.mts +0 -13
- package/dist/datetime-CSUpnUXU.d.ts +0 -78
- package/dist/datetime-dnPA_lnt.d.mts +0 -78
- 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-Dk3-40CY.d.mts +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/git-BHL1ppL4.d.ts +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/image-B5OPCNhD.d.mts +0 -56
- package/dist/image-IyGCgqNf.d.ts +0 -56
- package/dist/index.d.mts +0 -5
- package/dist/internet-BukCBMX-.d.ts +0 -106
- package/dist/internet-C2ElurWb.d.mts +0 -106
- package/dist/location-BIZ-KsaI.d.ts +0 -80
- package/dist/location-WU_nRdjx.d.mts +0 -80
- 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/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-D5QmTRsK.d.ts +0 -48
- package/dist/person-DXne2mKX.d.ts +0 -58
- package/dist/person-Si_vy67g.d.mts +0 -58
- package/dist/phone-Cbxvm_Qv.d.ts +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/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/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.d.mts +0 -93
- package/dist/utils/airline.d.mts +0 -3
- package/dist/utils/animal.d.mts +0 -2
- package/dist/utils/color.d.mts +0 -3
- package/dist/utils/commerce.d.mts +0 -2
- package/dist/utils/common.d.mts +0 -2
- package/dist/utils/company.d.mts +0 -2
- package/dist/utils/database.d.mts +0 -2
- package/dist/utils/datatype.d.mts +0 -2
- package/dist/utils/datetime.d.mts +0 -2
- package/dist/utils/finance.d.mts +0 -3
- package/dist/utils/food.d.mts +0 -2
- package/dist/utils/git.d.mts +0 -2
- package/dist/utils/hacker.d.mts +0 -2
- package/dist/utils/image.d.mts +0 -2
- package/dist/utils/index.d.mts +0 -28
- package/dist/utils/internet.d.mts +0 -3
- package/dist/utils/location.d.mts +0 -2
- package/dist/utils/lorem.d.mts +0 -2
- package/dist/utils/music.d.mts +0 -2
- package/dist/utils/number.d.mts +0 -2
- package/dist/utils/person.d.mts +0 -3
- package/dist/utils/phone.d.mts +0 -2
- package/dist/utils/science.d.mts +0 -3
- package/dist/utils/string.d.mts +0 -2
- package/dist/utils/system.d.mts +0 -2
- package/dist/utils/utils.d.mts +0 -2
- package/dist/utils/vehicle.d.mts +0 -2
- package/dist/utils/word.d.mts +0 -75
- package/dist/utils-BImnOpvp.d.ts +0 -10
- package/dist/utils-zJKwaMUY.d.mts +0 -10
- package/dist/vehicle-D4yBDYMc.d.mts +0 -35
- package/dist/vehicle-Ufz4AoXu.d.ts +0 -35
- package/src/test.ts +0 -10
- package/tsup.config.ts +0 -8
package/dist/utils/utils.mjs
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import "../chunk-XGB3TDIC.mjs";
|
|
7
|
-
export {
|
|
8
|
-
makeValueConfigFn
|
|
9
|
-
};
|
|
1
|
+
import { createValueConfig } from "../create_config.mjs";
|
|
2
|
+
function makeValueConfigFn(fn) {
|
|
3
|
+
return (...options)=>createValueConfig(()=>fn(...options));
|
|
4
|
+
}
|
|
5
|
+
export { makeValueConfigFn };
|
package/dist/utils/vehicle.d.ts
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
/** Vehicle [bicycle](https://fakerjs.dev/api/vehicle.html#bicycle) */
|
|
2
|
+
export declare const bicycle: () => import("..").ValueConfig<string>;
|
|
3
|
+
/** Vehicle [color](https://fakerjs.dev/api/vehicle.html#color) */
|
|
4
|
+
export declare const color: () => import("..").ValueConfig<string>;
|
|
5
|
+
/** Vehicle [fuel](https://fakerjs.dev/api/vehicle.html#fuel) */
|
|
6
|
+
export declare const fuel: () => import("..").ValueConfig<string>;
|
|
7
|
+
/** Vehicle [manufacturer](https://fakerjs.dev/api/vehicle.html#manufacturer) */
|
|
8
|
+
export declare const manufacturer: () => import("..").ValueConfig<string>;
|
|
9
|
+
/** Vehicle [model](https://fakerjs.dev/api/vehicle.html#model) */
|
|
10
|
+
export declare const model: () => import("..").ValueConfig<string>;
|
|
11
|
+
/** Vehicle [type](https://fakerjs.dev/api/vehicle.html#type) */
|
|
12
|
+
export declare const type: () => import("..").ValueConfig<string>;
|
|
13
|
+
/** Vehicle [vehicle](https://fakerjs.dev/api/vehicle.html#vehicle) */
|
|
14
|
+
export declare const vehicle: () => import("..").ValueConfig<string>;
|
|
15
|
+
/** Vehicle [vin](https://fakerjs.dev/api/vehicle.html#vin) */
|
|
16
|
+
export declare const vin: () => import("..").ValueConfig<string>;
|
|
17
|
+
/** Vehicle [vrm](https://fakerjs.dev/api/vehicle.html#vrm) */
|
|
18
|
+
export declare const vrm: () => import("..").ValueConfig<string>;
|
package/dist/utils/vehicle.js
CHANGED
|
@@ -1,27 +1,70 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
type: ()=>type,
|
|
28
|
+
manufacturer: ()=>manufacturer,
|
|
29
|
+
vehicle: ()=>vehicle,
|
|
30
|
+
bicycle: ()=>bicycle,
|
|
31
|
+
vrm: ()=>vrm,
|
|
32
|
+
color: ()=>color,
|
|
33
|
+
fuel: ()=>fuel,
|
|
34
|
+
model: ()=>model,
|
|
35
|
+
vin: ()=>vin
|
|
36
|
+
});
|
|
37
|
+
const faker_namespaceObject = require("@faker-js/faker");
|
|
38
|
+
const external_utils_js_namespaceObject = require("./utils.js");
|
|
39
|
+
const bicycle = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.vehicle.bicycle);
|
|
40
|
+
const color = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.vehicle.color);
|
|
41
|
+
const fuel = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.vehicle.fuel);
|
|
42
|
+
const manufacturer = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.vehicle.manufacturer);
|
|
43
|
+
const model = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.vehicle.model);
|
|
44
|
+
const type = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.vehicle.type);
|
|
45
|
+
const vehicle = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.vehicle.vehicle);
|
|
46
|
+
const vin = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.vehicle.vin);
|
|
47
|
+
const vrm = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.vehicle.vrm);
|
|
48
|
+
exports.bicycle = __webpack_exports__.bicycle;
|
|
49
|
+
exports.color = __webpack_exports__.color;
|
|
50
|
+
exports.fuel = __webpack_exports__.fuel;
|
|
51
|
+
exports.manufacturer = __webpack_exports__.manufacturer;
|
|
52
|
+
exports.model = __webpack_exports__.model;
|
|
53
|
+
exports.type = __webpack_exports__.type;
|
|
54
|
+
exports.vehicle = __webpack_exports__.vehicle;
|
|
55
|
+
exports.vin = __webpack_exports__.vin;
|
|
56
|
+
exports.vrm = __webpack_exports__.vrm;
|
|
57
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
58
|
+
"bicycle",
|
|
59
|
+
"color",
|
|
60
|
+
"fuel",
|
|
61
|
+
"manufacturer",
|
|
62
|
+
"model",
|
|
63
|
+
"type",
|
|
64
|
+
"vehicle",
|
|
65
|
+
"vin",
|
|
66
|
+
"vrm"
|
|
67
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
68
|
+
Object.defineProperty(exports, '__esModule', {
|
|
69
|
+
value: true
|
|
70
|
+
});
|
package/dist/utils/vehicle.mjs
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import "../chunk-ZQA42PYM.mjs";
|
|
14
|
-
import "../chunk-3U6BNHWG.mjs";
|
|
15
|
-
import "../chunk-USLYTOPD.mjs";
|
|
16
|
-
import "../chunk-XGB3TDIC.mjs";
|
|
17
|
-
export {
|
|
18
|
-
bicycle,
|
|
19
|
-
color,
|
|
20
|
-
fuel,
|
|
21
|
-
manufacturer,
|
|
22
|
-
model,
|
|
23
|
-
type,
|
|
24
|
-
vehicle,
|
|
25
|
-
vin,
|
|
26
|
-
vrm
|
|
27
|
-
};
|
|
1
|
+
import { faker } from "@faker-js/faker";
|
|
2
|
+
import { makeValueConfigFn } from "./utils.mjs";
|
|
3
|
+
const bicycle = makeValueConfigFn(faker.vehicle.bicycle);
|
|
4
|
+
const color = makeValueConfigFn(faker.vehicle.color);
|
|
5
|
+
const fuel = makeValueConfigFn(faker.vehicle.fuel);
|
|
6
|
+
const manufacturer = makeValueConfigFn(faker.vehicle.manufacturer);
|
|
7
|
+
const model = makeValueConfigFn(faker.vehicle.model);
|
|
8
|
+
const type = makeValueConfigFn(faker.vehicle.type);
|
|
9
|
+
const vehicle = makeValueConfigFn(faker.vehicle.vehicle);
|
|
10
|
+
const vin = makeValueConfigFn(faker.vehicle.vin);
|
|
11
|
+
const vrm = makeValueConfigFn(faker.vehicle.vrm);
|
|
12
|
+
export { bicycle, color, fuel, manufacturer, model, type, vehicle, vin, vrm };
|
package/dist/utils/word.d.ts
CHANGED
|
@@ -1,75 +1,71 @@
|
|
|
1
|
-
import { ValueConfig } from '../type.js';
|
|
2
|
-
|
|
3
1
|
/** Word [adjective](https://fakerjs.dev/word.html#adjective) */
|
|
4
|
-
declare const adjective: (options?: number | {
|
|
2
|
+
export declare const adjective: (options?: number | {
|
|
5
3
|
length?: number | {
|
|
6
4
|
min: number;
|
|
7
5
|
max: number;
|
|
8
6
|
};
|
|
9
7
|
strategy?: "fail" | "closest" | "shortest" | "longest" | "any-length";
|
|
10
|
-
}) => ValueConfig<string>;
|
|
8
|
+
}) => import("..").ValueConfig<string>;
|
|
11
9
|
/** Word [adverb](https://fakerjs.dev/word.html#adverb) */
|
|
12
|
-
declare const adverb: (options?: number | {
|
|
10
|
+
export declare const adverb: (options?: number | {
|
|
13
11
|
length?: number | {
|
|
14
12
|
min: number;
|
|
15
13
|
max: number;
|
|
16
14
|
};
|
|
17
15
|
strategy?: "fail" | "closest" | "shortest" | "longest" | "any-length";
|
|
18
|
-
}) => ValueConfig<string>;
|
|
16
|
+
}) => import("..").ValueConfig<string>;
|
|
19
17
|
/** Word [conjunction](https://fakerjs.dev/word.html#conjunction) */
|
|
20
|
-
declare const conjunction: (options?: number | {
|
|
18
|
+
export declare const conjunction: (options?: number | {
|
|
21
19
|
length?: number | {
|
|
22
20
|
min: number;
|
|
23
21
|
max: number;
|
|
24
22
|
};
|
|
25
23
|
strategy?: "fail" | "closest" | "shortest" | "longest" | "any-length";
|
|
26
|
-
}) => ValueConfig<string>;
|
|
24
|
+
}) => import("..").ValueConfig<string>;
|
|
27
25
|
/** Word [interjection](https://fakerjs.dev/word.html#interjection) */
|
|
28
|
-
declare const interjection: (options?: number | {
|
|
26
|
+
export declare const interjection: (options?: number | {
|
|
29
27
|
length?: number | {
|
|
30
28
|
min: number;
|
|
31
29
|
max: number;
|
|
32
30
|
};
|
|
33
31
|
strategy?: "fail" | "closest" | "shortest" | "longest" | "any-length";
|
|
34
|
-
}) => ValueConfig<string>;
|
|
32
|
+
}) => import("..").ValueConfig<string>;
|
|
35
33
|
/** Word [noun](https://fakerjs.dev/word.html#noun) */
|
|
36
|
-
declare const noun: (options?: number | {
|
|
34
|
+
export declare const noun: (options?: number | {
|
|
37
35
|
length?: number | {
|
|
38
36
|
min: number;
|
|
39
37
|
max: number;
|
|
40
38
|
};
|
|
41
39
|
strategy?: "fail" | "closest" | "shortest" | "longest" | "any-length";
|
|
42
|
-
}) => ValueConfig<string>;
|
|
40
|
+
}) => import("..").ValueConfig<string>;
|
|
43
41
|
/** Word [preposition](https://fakerjs.dev/word.html#preposition) */
|
|
44
|
-
declare const preposition: (options?: number | {
|
|
42
|
+
export declare const preposition: (options?: number | {
|
|
45
43
|
length?: number | {
|
|
46
44
|
min: number;
|
|
47
45
|
max: number;
|
|
48
46
|
};
|
|
49
47
|
strategy?: "fail" | "closest" | "shortest" | "longest" | "any-length";
|
|
50
|
-
}) => ValueConfig<string>;
|
|
48
|
+
}) => import("..").ValueConfig<string>;
|
|
51
49
|
/** Word [sample](https://fakerjs.dev/word.html#sample) */
|
|
52
|
-
declare const sample: (options?: number | {
|
|
50
|
+
export declare const sample: (options?: number | {
|
|
53
51
|
length?: number | {
|
|
54
52
|
min: number;
|
|
55
53
|
max: number;
|
|
56
54
|
};
|
|
57
55
|
strategy?: "fail" | "closest" | "shortest" | "longest" | "any-length";
|
|
58
|
-
}) => ValueConfig<string>;
|
|
56
|
+
}) => import("..").ValueConfig<string>;
|
|
59
57
|
/** Word [verb](https://fakerjs.dev/word.html#verb) */
|
|
60
|
-
declare const verb: (options?: number | {
|
|
58
|
+
export declare const verb: (options?: number | {
|
|
61
59
|
length?: number | {
|
|
62
60
|
min: number;
|
|
63
61
|
max: number;
|
|
64
62
|
};
|
|
65
63
|
strategy?: "fail" | "closest" | "shortest" | "longest" | "any-length";
|
|
66
|
-
}) => ValueConfig<string>;
|
|
64
|
+
}) => import("..").ValueConfig<string>;
|
|
67
65
|
/** Word [words](https://fakerjs.dev/word.html#words) */
|
|
68
|
-
declare const words: (options?: number | {
|
|
66
|
+
export declare const words: (options?: number | {
|
|
69
67
|
count?: number | {
|
|
70
68
|
min: number;
|
|
71
69
|
max: number;
|
|
72
70
|
};
|
|
73
|
-
}) => ValueConfig<string>;
|
|
74
|
-
|
|
75
|
-
export { adjective, adverb, conjunction, interjection, noun, preposition, sample, verb, words };
|
|
71
|
+
}) => import("..").ValueConfig<string>;
|
package/dist/utils/word.js
CHANGED
|
@@ -1,31 +1,70 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
words: ()=>words,
|
|
28
|
+
noun: ()=>noun,
|
|
29
|
+
verb: ()=>verb,
|
|
30
|
+
sample: ()=>sample,
|
|
31
|
+
conjunction: ()=>conjunction,
|
|
32
|
+
adjective: ()=>adjective,
|
|
33
|
+
interjection: ()=>interjection,
|
|
34
|
+
preposition: ()=>preposition,
|
|
35
|
+
adverb: ()=>adverb
|
|
36
|
+
});
|
|
37
|
+
const faker_namespaceObject = require("@faker-js/faker");
|
|
38
|
+
const external_utils_js_namespaceObject = require("./utils.js");
|
|
39
|
+
const adjective = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.word.adjective);
|
|
40
|
+
const adverb = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.word.adverb);
|
|
41
|
+
const conjunction = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.word.conjunction);
|
|
42
|
+
const interjection = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.word.interjection);
|
|
43
|
+
const noun = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.word.noun);
|
|
44
|
+
const preposition = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.word.preposition);
|
|
45
|
+
const sample = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.word.sample);
|
|
46
|
+
const verb = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.word.verb);
|
|
47
|
+
const words = (0, external_utils_js_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.word.words);
|
|
48
|
+
exports.adjective = __webpack_exports__.adjective;
|
|
49
|
+
exports.adverb = __webpack_exports__.adverb;
|
|
50
|
+
exports.conjunction = __webpack_exports__.conjunction;
|
|
51
|
+
exports.interjection = __webpack_exports__.interjection;
|
|
52
|
+
exports.noun = __webpack_exports__.noun;
|
|
53
|
+
exports.preposition = __webpack_exports__.preposition;
|
|
54
|
+
exports.sample = __webpack_exports__.sample;
|
|
55
|
+
exports.verb = __webpack_exports__.verb;
|
|
56
|
+
exports.words = __webpack_exports__.words;
|
|
57
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
58
|
+
"adjective",
|
|
59
|
+
"adverb",
|
|
60
|
+
"conjunction",
|
|
61
|
+
"interjection",
|
|
62
|
+
"noun",
|
|
63
|
+
"preposition",
|
|
64
|
+
"sample",
|
|
65
|
+
"verb",
|
|
66
|
+
"words"
|
|
67
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
68
|
+
Object.defineProperty(exports, '__esModule', {
|
|
69
|
+
value: true
|
|
70
|
+
});
|
package/dist/utils/word.mjs
CHANGED
|
@@ -1,31 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var adverb = makeValueConfigFn(f.word.adverb);
|
|
14
|
-
var conjunction = makeValueConfigFn(f.word.conjunction);
|
|
15
|
-
var interjection = makeValueConfigFn(f.word.interjection);
|
|
16
|
-
var noun = makeValueConfigFn(f.word.noun);
|
|
17
|
-
var preposition = makeValueConfigFn(f.word.preposition);
|
|
18
|
-
var sample = makeValueConfigFn(f.word.sample);
|
|
19
|
-
var verb = makeValueConfigFn(f.word.verb);
|
|
20
|
-
var words = makeValueConfigFn(f.word.words);
|
|
21
|
-
export {
|
|
22
|
-
adjective,
|
|
23
|
-
adverb,
|
|
24
|
-
conjunction,
|
|
25
|
-
interjection,
|
|
26
|
-
noun,
|
|
27
|
-
preposition,
|
|
28
|
-
sample,
|
|
29
|
-
verb,
|
|
30
|
-
words
|
|
31
|
-
};
|
|
1
|
+
import { faker } from "@faker-js/faker";
|
|
2
|
+
import { makeValueConfigFn } from "./utils.mjs";
|
|
3
|
+
const adjective = makeValueConfigFn(faker.word.adjective);
|
|
4
|
+
const adverb = makeValueConfigFn(faker.word.adverb);
|
|
5
|
+
const conjunction = makeValueConfigFn(faker.word.conjunction);
|
|
6
|
+
const interjection = makeValueConfigFn(faker.word.interjection);
|
|
7
|
+
const noun = makeValueConfigFn(faker.word.noun);
|
|
8
|
+
const preposition = makeValueConfigFn(faker.word.preposition);
|
|
9
|
+
const sample = makeValueConfigFn(faker.word.sample);
|
|
10
|
+
const verb = makeValueConfigFn(faker.word.verb);
|
|
11
|
+
const words = makeValueConfigFn(faker.word.words);
|
|
12
|
+
export { adjective, adverb, conjunction, interjection, noun, preposition, sample, verb, words };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "struct-fakerator",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -14,14 +14,6 @@
|
|
|
14
14
|
"import": {
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"default": "./dist/index.mjs"
|
|
17
|
-
},
|
|
18
|
-
"module": {
|
|
19
|
-
"types": "./dist/index.d.ts",
|
|
20
|
-
"default": "./dist/index.mjs"
|
|
21
|
-
},
|
|
22
|
-
"default": {
|
|
23
|
-
"types": "./dist/index.d.ts",
|
|
24
|
-
"default": "./dist/index.mjs"
|
|
25
17
|
}
|
|
26
18
|
},
|
|
27
19
|
"./utils": {
|
|
@@ -32,14 +24,6 @@
|
|
|
32
24
|
"import": {
|
|
33
25
|
"types": "./dist/utils/index.d.ts",
|
|
34
26
|
"default": "./dist/utils/index.mjs"
|
|
35
|
-
},
|
|
36
|
-
"module": {
|
|
37
|
-
"types": "./dist/utils/index.d.ts",
|
|
38
|
-
"default": "./dist/utils/index.mjs"
|
|
39
|
-
},
|
|
40
|
-
"default": {
|
|
41
|
-
"types": "./dist/utils/index.d.ts",
|
|
42
|
-
"default": "./dist/utils/index.mjs"
|
|
43
27
|
}
|
|
44
28
|
},
|
|
45
29
|
"./utils/*": {
|
|
@@ -50,37 +34,32 @@
|
|
|
50
34
|
"import": {
|
|
51
35
|
"types": "./dist/utils/*.d.ts",
|
|
52
36
|
"default": "./dist/utils/*.mjs"
|
|
53
|
-
},
|
|
54
|
-
"module": {
|
|
55
|
-
"types": "./dist/utils/*.d.ts",
|
|
56
|
-
"default": "./dist/utils/*.mjs"
|
|
57
|
-
},
|
|
58
|
-
"default": {
|
|
59
|
-
"types": "./dist/utils/*.d.ts",
|
|
60
|
-
"default": "./dist/utils/*.mjs"
|
|
61
37
|
}
|
|
62
38
|
}
|
|
63
39
|
},
|
|
64
|
-
"keywords": [
|
|
40
|
+
"keywords": [
|
|
41
|
+
"fake data",
|
|
42
|
+
"generator"
|
|
43
|
+
],
|
|
65
44
|
"author": "FizzyElt",
|
|
66
45
|
"homepage": "https://github.com/FizzyElt/fakerator",
|
|
67
46
|
"license": "ISC",
|
|
68
47
|
"devDependencies": {
|
|
69
|
-
"@biomejs/biome": "^
|
|
70
|
-
"@
|
|
71
|
-
"tsup": "^8.5.0",
|
|
48
|
+
"@biomejs/biome": "^2.0.5",
|
|
49
|
+
"@rslib/core": "^0.11.0",
|
|
72
50
|
"typescript": "^5.8.3",
|
|
73
51
|
"vitest": "^3.2.2"
|
|
74
52
|
},
|
|
75
53
|
"dependencies": {
|
|
76
|
-
"
|
|
54
|
+
"@faker-js/faker": "^9.8.0",
|
|
55
|
+
"zod": "^4.0.14"
|
|
77
56
|
},
|
|
78
57
|
"publishConfig": {
|
|
79
58
|
"access": "public"
|
|
80
59
|
},
|
|
81
60
|
"scripts": {
|
|
82
61
|
"type_check": "tsc --noEmit",
|
|
83
|
-
"build": "pnpm type_check &&
|
|
62
|
+
"build": "pnpm type_check && rslib build src",
|
|
84
63
|
"test": "vitest src"
|
|
85
64
|
}
|
|
86
65
|
}
|
package/rslib.config.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineConfig } from "@rslib/core";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
lib: [
|
|
5
|
+
{
|
|
6
|
+
format: "esm",
|
|
7
|
+
syntax: "esnext",
|
|
8
|
+
bundle: false,
|
|
9
|
+
dts: true,
|
|
10
|
+
outBase: "./src",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
format: "cjs",
|
|
14
|
+
syntax: "esnext",
|
|
15
|
+
bundle: false,
|
|
16
|
+
dts: true,
|
|
17
|
+
outBase: "./src",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
source: {
|
|
21
|
+
entry: {
|
|
22
|
+
index: ["src/*.ts", "!src/*.test.ts"],
|
|
23
|
+
utils: "src/utils/*.ts",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
package/src/config.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export {
|
|
2
|
-
createValueConfig as value,
|
|
3
2
|
createArrayConfig as array,
|
|
3
|
+
createBoundedSeriesConfig as boundedSeries,
|
|
4
4
|
createObjectConfig as object,
|
|
5
|
-
createTupleConfig as tuple,
|
|
6
5
|
createSelectionConfig as select,
|
|
7
|
-
|
|
6
|
+
createTupleConfig as tuple,
|
|
7
|
+
createValueConfig as value,
|
|
8
8
|
} from "./create_config";
|
package/src/config_scheme.ts
CHANGED
package/src/create_config.ts
CHANGED
|
@@ -91,7 +91,7 @@ export function createObjectConfig<T extends object, R>(
|
|
|
91
91
|
export const createArrayConfig = <T>(
|
|
92
92
|
item: T,
|
|
93
93
|
len: number,
|
|
94
|
-
next?: (
|
|
94
|
+
next?: (prev: Result<T>, current: Result<T>) => Result<T>,
|
|
95
95
|
): ArrayConfig<T> => {
|
|
96
96
|
const config: ArrayConfig<T> = { type: "arr", item, len, next };
|
|
97
97
|
|
|
@@ -68,6 +68,17 @@ describe("createArrayGenerator", () => {
|
|
|
68
68
|
{ age: 42 },
|
|
69
69
|
]);
|
|
70
70
|
});
|
|
71
|
+
test("with next function", () => {
|
|
72
|
+
const list = createArrayGenerator(
|
|
73
|
+
createArrayConfig(
|
|
74
|
+
createValueConfig(() => 100),
|
|
75
|
+
5,
|
|
76
|
+
(prev) => prev + 1,
|
|
77
|
+
),
|
|
78
|
+
)();
|
|
79
|
+
|
|
80
|
+
expect(list).toEqual([101, 102, 103, 104, 105]);
|
|
81
|
+
});
|
|
71
82
|
});
|
|
72
83
|
|
|
73
84
|
describe("createTupleGenerator", () => {
|
|
@@ -186,8 +197,8 @@ describe("createGeneratorByType", () => {
|
|
|
186
197
|
});
|
|
187
198
|
|
|
188
199
|
test("with custom type match", () => {
|
|
189
|
-
const createIntValueConfig = (
|
|
190
|
-
const createEmailValueConfig = (
|
|
200
|
+
const createIntValueConfig = (_option) => createValueConfig(() => 50);
|
|
201
|
+
const createEmailValueConfig = (_option) =>
|
|
191
202
|
createValueConfig(() => "xxx@example.com");
|
|
192
203
|
|
|
193
204
|
const customTypeMatch = (config) => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { faker } from "@faker-js/faker";
|
|
2
|
-
|
|
3
2
|
import {
|
|
4
3
|
arrayConfigScheme,
|
|
5
4
|
boundedSeriesScheme,
|
|
@@ -129,15 +128,16 @@ const _createArrayGenerator = <T extends ArrayConfig<unknown>>(
|
|
|
129
128
|
config.item as AllConfig<unknown>,
|
|
130
129
|
`${path}.arr`,
|
|
131
130
|
customTypeMatch,
|
|
132
|
-
)
|
|
131
|
+
) as () => Result<T>;
|
|
133
132
|
|
|
134
133
|
if (config.next) {
|
|
135
|
-
const next: (
|
|
134
|
+
const next: (prev: Result<T>, current: Result<T>) => Result<T> =
|
|
135
|
+
config.next;
|
|
136
136
|
return () => {
|
|
137
|
-
let prev = itemGeneratorFn()
|
|
137
|
+
let prev = itemGeneratorFn();
|
|
138
138
|
const result = [];
|
|
139
139
|
for (let i = 0; i < config.len; i++) {
|
|
140
|
-
const nextValue = next(prev);
|
|
140
|
+
const nextValue = next(prev, itemGeneratorFn());
|
|
141
141
|
result.push(nextValue);
|
|
142
142
|
prev = nextValue;
|
|
143
143
|
}
|
package/src/generator_fn.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export {
|
|
2
|
-
createGeneratorByType as genFn,
|
|
3
2
|
createArrayGenerator as genArrayFn,
|
|
4
3
|
createBoundedSeriesGenerator as genBoundedSeriesFn,
|
|
4
|
+
createGeneratorByType as genFn,
|
|
5
5
|
createObjectGenerator as genObjectFn,
|
|
6
6
|
createSelectionGenerator as genSelectFn,
|
|
7
7
|
createTupleGenerator as genTupleFn,
|
package/src/index.ts
CHANGED