struct-fakerator 2.5.6 → 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/dist/chunk-25HDDMTE.js +45 -0
- package/dist/chunk-266JLHQ7.mjs +27 -0
- package/dist/chunk-2SF54GZN.mjs +24 -0
- package/dist/chunk-2VTSGFBK.mjs +56 -0
- package/dist/chunk-3U6BNHWG.mjs +2040 -0
- package/dist/chunk-52ZOIHJM.js +26 -0
- package/dist/chunk-5A3HJWPX.mjs +33 -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-6TGTIMX2.mjs +151 -0
- package/dist/chunk-7ZAVU2DI.mjs +81 -0
- package/dist/chunk-ABZZ2Y2O.mjs +45 -0
- package/dist/chunk-C6FQYK5T.js +81 -0
- package/dist/chunk-D74AUXZW.mjs +35 -0
- package/dist/chunk-DX6NQK6H.js +49 -0
- package/dist/chunk-DXVB5THL.js +36 -0
- package/dist/chunk-E7JW4TGQ.mjs +49 -0
- package/dist/chunk-EPWKT75L.js +63 -0
- package/dist/chunk-F4WSUHUB.js +27 -0
- package/dist/chunk-FT5QWXEO.mjs +21 -0
- package/dist/chunk-G73JPAKW.mjs +16831 -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-GUIYTTMP.mjs +24 -0
- package/dist/chunk-HMDAKHLF.js +151 -0
- package/dist/chunk-HVWSAC7Q.js +74 -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-KDRX2A7A.mjs +45 -0
- package/dist/chunk-KSBJZ7PZ.mjs +48 -0
- package/dist/chunk-LSP4VVPM.mjs +45 -0
- package/dist/chunk-MHBVLDC4.js +30 -0
- package/dist/chunk-NBUVTD24.js +24 -0
- package/dist/chunk-NGJNM6BX.mjs +48 -0
- package/dist/chunk-OAPPDES4.js +51 -0
- package/dist/chunk-OKDN5R6M.mjs +78 -0
- package/dist/chunk-OZ5VJVBQ.js +21 -0
- package/dist/chunk-QH2RT36U.js +57 -0
- package/dist/chunk-QHW2YYKY.js +45 -0
- package/dist/chunk-RA35MXTT.mjs +51 -0
- package/dist/chunk-RFTRP37B.mjs +74 -0
- package/dist/chunk-RIOEYYMH.mjs +30 -0
- package/dist/chunk-S2AEEWWW.mjs +36 -0
- package/dist/chunk-SN2ALAEI.mjs +36 -0
- package/dist/chunk-SSZ5GGDT.js +45 -0
- package/dist/chunk-TZ2RKEBF.js +2040 -0
- package/dist/chunk-UJ5Q7MZB.js +78 -0
- package/dist/chunk-UOY5QUAW.js +63 -0
- package/dist/chunk-URX5VRVB.js +24 -0
- package/dist/chunk-VYV7BUJR.js +42 -0
- package/dist/chunk-X7YFEBIL.mjs +28 -0
- package/dist/chunk-XI5L2ENL.js +28 -0
- package/dist/chunk-XUZOVQYC.mjs +42 -0
- package/dist/chunk-XVQOUXV6.js +48 -0
- package/dist/chunk-YUFVOYYX.mjs +57 -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/create_config.d.mts +6 -1
- package/dist/create_config.d.ts +6 -1
- package/dist/create_config.test.js +22 -22
- package/dist/create_config.test.mjs +1 -1
- package/dist/create_generator_fn.d.mts +1 -1
- package/dist/create_generator_fn.d.ts +1 -1
- package/dist/create_generator_fn.js +3 -3
- package/dist/create_generator_fn.mjs +2 -2
- package/dist/create_generator_fn.test.js +46 -46
- package/dist/create_generator_fn.test.mjs +9 -9
- 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/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +14 -6
- package/dist/index.mjs +18 -10
- package/dist/number-BfwwKvTJ.d.mts +48 -0
- package/dist/number-D5QmTRsK.d.ts +48 -0
- package/dist/type.d.mts +56 -4
- package/dist/type.d.ts +56 -4
- package/dist/utils/airline.js +3 -3
- package/dist/utils/airline.mjs +2 -2
- package/dist/utils/animal.js +3 -3
- package/dist/utils/animal.mjs +2 -2
- package/dist/utils/color.js +3 -3
- package/dist/utils/color.mjs +2 -2
- package/dist/utils/commerce.js +3 -3
- package/dist/utils/commerce.mjs +2 -2
- package/dist/utils/company.js +3 -3
- package/dist/utils/company.mjs +2 -2
- package/dist/utils/database.js +3 -3
- package/dist/utils/database.mjs +2 -2
- package/dist/utils/datatype.js +3 -3
- package/dist/utils/datatype.mjs +2 -2
- package/dist/utils/datetime.js +3 -3
- package/dist/utils/datetime.mjs +2 -2
- package/dist/utils/finance.js +3 -3
- package/dist/utils/finance.mjs +2 -2
- package/dist/utils/food.js +3 -3
- package/dist/utils/food.mjs +2 -2
- package/dist/utils/git.js +3 -3
- package/dist/utils/git.mjs +2 -2
- package/dist/utils/hacker.js +3 -3
- package/dist/utils/hacker.mjs +2 -2
- package/dist/utils/image.js +3 -3
- package/dist/utils/image.mjs +2 -2
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +27 -27
- package/dist/utils/index.mjs +36 -36
- package/dist/utils/internet.js +3 -3
- package/dist/utils/internet.mjs +2 -2
- package/dist/utils/location.js +3 -3
- package/dist/utils/location.mjs +2 -2
- package/dist/utils/lorem.js +3 -3
- package/dist/utils/lorem.mjs +2 -2
- package/dist/utils/music.js +3 -3
- package/dist/utils/music.mjs +2 -2
- package/dist/utils/number.d.mts +1 -1
- package/dist/utils/number.d.ts +1 -1
- package/dist/utils/number.js +3 -3
- package/dist/utils/number.mjs +2 -2
- package/dist/utils/person.js +3 -3
- package/dist/utils/person.mjs +2 -2
- package/dist/utils/phone.js +3 -3
- package/dist/utils/phone.mjs +2 -2
- package/dist/utils/science.js +3 -3
- package/dist/utils/science.mjs +2 -2
- package/dist/utils/string.js +3 -3
- package/dist/utils/string.mjs +2 -2
- package/dist/utils/system.js +3 -3
- package/dist/utils/system.mjs +2 -2
- package/dist/utils/vehicle.js +3 -3
- package/dist/utils/vehicle.mjs +2 -2
- package/dist/utils/word.js +10 -10
- package/dist/utils/word.mjs +1 -1
- package/package.json +6 -6
- 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
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
createSelectionGenerator,
|
|
7
7
|
createTupleGenerator,
|
|
8
8
|
createValueGenerator
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-6TGTIMX2.mjs";
|
|
10
|
+
import "./chunk-3U6BNHWG.mjs";
|
|
11
11
|
import "./chunk-UP3FJ7EK.mjs";
|
|
12
12
|
import "./chunk-XGB3TDIC.mjs";
|
|
13
13
|
export {
|
|
@@ -2,63 +2,63 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkGNPP2GGZjs = require('./chunk-GNPP2GGZ.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
var _chunkW6QSJNDJjs = require('./chunk-W6QSJNDJ.js');
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
var _chunkZ46HCVNZjs = require('./chunk-Z46HCVNZ.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
21
|
-
require('./chunk-
|
|
20
|
+
var _chunkHMDAKHLFjs = require('./chunk-HMDAKHLF.js');
|
|
21
|
+
require('./chunk-TZ2RKEBF.js');
|
|
22
22
|
require('./chunk-A4QVPMYT.js');
|
|
23
23
|
require('./chunk-4VNS5WPM.js');
|
|
24
24
|
|
|
25
25
|
// src/create_generator_fn.test.ts
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const value =
|
|
26
|
+
_chunkGNPP2GGZjs.describe.call(void 0, "createValueGenerator", () => {
|
|
27
|
+
_chunkGNPP2GGZjs.test.call(void 0, "normal", () => {
|
|
28
|
+
const value = _chunkHMDAKHLFjs.createValueGenerator.call(void 0, {
|
|
29
29
|
type: "value",
|
|
30
30
|
generateFn: () => 50
|
|
31
31
|
})();
|
|
32
|
-
|
|
33
|
-
const value2 =
|
|
32
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, value).toBe(50);
|
|
33
|
+
const value2 = _chunkHMDAKHLFjs.createValueGenerator.call(void 0, {
|
|
34
34
|
type: "value",
|
|
35
35
|
generateFn: () => ({ age: 100, name: "hello" })
|
|
36
36
|
})();
|
|
37
|
-
|
|
37
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, value2).toEqual({ age: 100, name: "hello" });
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const value =
|
|
40
|
+
_chunkGNPP2GGZjs.describe.call(void 0, "createSelectionGenerator", () => {
|
|
41
|
+
_chunkGNPP2GGZjs.test.call(void 0, "normal", () => {
|
|
42
|
+
const value = _chunkHMDAKHLFjs.createSelectionGenerator.call(void 0, {
|
|
43
43
|
type: "select",
|
|
44
44
|
items: [1]
|
|
45
45
|
})();
|
|
46
|
-
|
|
47
|
-
const value2 =
|
|
46
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, value).toBe(1);
|
|
47
|
+
const value2 = _chunkHMDAKHLFjs.createSelectionGenerator.call(void 0, {
|
|
48
48
|
type: "select",
|
|
49
49
|
items: [30, 30, 30, 30]
|
|
50
50
|
})();
|
|
51
|
-
|
|
51
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, value2).toBe(30);
|
|
52
52
|
});
|
|
53
53
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const list =
|
|
54
|
+
_chunkGNPP2GGZjs.describe.call(void 0, "createArrayGenerator", () => {
|
|
55
|
+
_chunkGNPP2GGZjs.test.call(void 0, "normal", () => {
|
|
56
|
+
const list = _chunkHMDAKHLFjs.createArrayGenerator.call(void 0, {
|
|
57
57
|
type: "arr",
|
|
58
58
|
len: 5,
|
|
59
59
|
item: { type: "value", generateFn: () => ({ age: 42 }) }
|
|
60
60
|
})();
|
|
61
|
-
|
|
61
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, list).toEqual([
|
|
62
62
|
{ age: 42 },
|
|
63
63
|
{ age: 42 },
|
|
64
64
|
{ age: 42 },
|
|
@@ -67,23 +67,23 @@ _chunkRDMAE6F2js.describe.call(void 0, "createArrayGenerator", () => {
|
|
|
67
67
|
]);
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const tuple =
|
|
70
|
+
_chunkGNPP2GGZjs.describe.call(void 0, "createTupleGenerator", () => {
|
|
71
|
+
_chunkGNPP2GGZjs.test.call(void 0, "normal", () => {
|
|
72
|
+
const tuple = _chunkHMDAKHLFjs.createTupleGenerator.call(void 0,
|
|
73
73
|
_chunkW6QSJNDJjs.createTupleConfig.call(void 0, [
|
|
74
74
|
_chunkW6QSJNDJjs.createValueConfig.call(void 0, () => 225),
|
|
75
75
|
_chunkW6QSJNDJjs.createValueConfig.call(void 0, () => "hello world")
|
|
76
76
|
])
|
|
77
77
|
)();
|
|
78
|
-
|
|
78
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, tuple.length).toBe(2);
|
|
79
79
|
const [num, str] = tuple;
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, num).toBe(225);
|
|
81
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, str).toBe("hello world");
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const obj =
|
|
84
|
+
_chunkGNPP2GGZjs.describe.call(void 0, "createObjectGenerator", () => {
|
|
85
|
+
_chunkGNPP2GGZjs.test.call(void 0, "normal", () => {
|
|
86
|
+
const obj = _chunkHMDAKHLFjs.createObjectGenerator.call(void 0, {
|
|
87
87
|
type: "obj",
|
|
88
88
|
content: {
|
|
89
89
|
name: { type: "value", generateFn: () => "John" },
|
|
@@ -91,16 +91,16 @@ _chunkRDMAE6F2js.describe.call(void 0, "createObjectGenerator", () => {
|
|
|
91
91
|
location: { type: "value", generateFn: () => "Taiwan" }
|
|
92
92
|
}
|
|
93
93
|
})();
|
|
94
|
-
|
|
94
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, obj).toEqual({ name: "John", age: 50, location: "Taiwan" });
|
|
95
95
|
});
|
|
96
96
|
});
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
_chunkGNPP2GGZjs.describe.call(void 0, "createBoundedSeriesGenerator", () => {
|
|
98
|
+
_chunkGNPP2GGZjs.test.call(void 0, "normal", () => {
|
|
99
99
|
const upperLimit = 1.1;
|
|
100
100
|
const lowerLimit = 0.9;
|
|
101
101
|
const initValue = 100;
|
|
102
102
|
const count = 100;
|
|
103
|
-
const list =
|
|
103
|
+
const list = _chunkHMDAKHLFjs.createBoundedSeriesGenerator.call(void 0, {
|
|
104
104
|
type: "bounded_series",
|
|
105
105
|
upperLimit,
|
|
106
106
|
lowerLimit,
|
|
@@ -111,19 +111,19 @@ _chunkRDMAE6F2js.describe.call(void 0, "createBoundedSeriesGenerator", () => {
|
|
|
111
111
|
const value = list[i];
|
|
112
112
|
if (i === 0) {
|
|
113
113
|
const ratio2 = value / initValue;
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, ratio2).toBeLessThanOrEqual(upperLimit);
|
|
115
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, ratio2).toBeGreaterThanOrEqual(lowerLimit);
|
|
116
116
|
continue;
|
|
117
117
|
}
|
|
118
118
|
const prevValue = list[i - 1];
|
|
119
119
|
const ratio = value / prevValue;
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, ratio).toBeLessThanOrEqual(upperLimit);
|
|
121
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, ratio).toBeGreaterThanOrEqual(lowerLimit);
|
|
122
122
|
}
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
_chunkGNPP2GGZjs.describe.call(void 0, "createGeneratorByType", () => {
|
|
126
|
+
_chunkGNPP2GGZjs.test.call(void 0, "normal", () => {
|
|
127
127
|
const config = _chunkW6QSJNDJjs.createObjectConfig.call(void 0, {
|
|
128
128
|
name: _chunkW6QSJNDJjs.createValueConfig.call(void 0, () => "John"),
|
|
129
129
|
age: _chunkW6QSJNDJjs.createValueConfig.call(void 0, () => 50),
|
|
@@ -132,14 +132,14 @@ _chunkRDMAE6F2js.describe.call(void 0, "createGeneratorByType", () => {
|
|
|
132
132
|
5
|
|
133
133
|
)
|
|
134
134
|
});
|
|
135
|
-
const result =
|
|
136
|
-
|
|
135
|
+
const result = _chunkHMDAKHLFjs.createGeneratorByType.call(void 0, config)();
|
|
136
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, result).toEqual({
|
|
137
137
|
name: "John",
|
|
138
138
|
age: 50,
|
|
139
139
|
locations: ["Taiwan", "Taiwan", "Taiwan", "Taiwan", "Taiwan"]
|
|
140
140
|
});
|
|
141
141
|
});
|
|
142
|
-
|
|
142
|
+
_chunkGNPP2GGZjs.test.call(void 0, "test error config", () => {
|
|
143
143
|
const config = {
|
|
144
144
|
type: "obj",
|
|
145
145
|
content: {
|
|
@@ -149,9 +149,9 @@ _chunkRDMAE6F2js.describe.call(void 0, "createGeneratorByType", () => {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
|
-
|
|
152
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, () => _chunkHMDAKHLFjs.createGeneratorByType.call(void 0, config)).toThrowError();
|
|
153
153
|
});
|
|
154
|
-
|
|
154
|
+
_chunkGNPP2GGZjs.test.call(void 0, "with custom type match", () => {
|
|
155
155
|
const createIntValueConfig = (option) => _chunkW6QSJNDJjs.createValueConfig.call(void 0, () => 50);
|
|
156
156
|
const createEmailValueConfig = (option) => _chunkW6QSJNDJjs.createValueConfig.call(void 0, () => "xxx@example.com");
|
|
157
157
|
const customTypeMatch = (config2) => {
|
|
@@ -168,8 +168,8 @@ _chunkRDMAE6F2js.describe.call(void 0, "createGeneratorByType", () => {
|
|
|
168
168
|
age: { type: "int" },
|
|
169
169
|
email: { type: "email" }
|
|
170
170
|
});
|
|
171
|
-
const result =
|
|
172
|
-
|
|
171
|
+
const result = _chunkHMDAKHLFjs.createGeneratorByType.call(void 0, config, customTypeMatch)();
|
|
172
|
+
_chunkGNPP2GGZjs.globalExpect.call(void 0, result).toEqual({
|
|
173
173
|
name: "John",
|
|
174
174
|
age: 50,
|
|
175
175
|
email: "xxx@example.com"
|
|
@@ -2,7 +2,13 @@ import {
|
|
|
2
2
|
describe,
|
|
3
3
|
globalExpect,
|
|
4
4
|
test
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-G73JPAKW.mjs";
|
|
6
|
+
import {
|
|
7
|
+
createArrayConfig,
|
|
8
|
+
createObjectConfig,
|
|
9
|
+
createTupleConfig,
|
|
10
|
+
createValueConfig
|
|
11
|
+
} from "./chunk-RDATYKAG.mjs";
|
|
6
12
|
import {
|
|
7
13
|
createArrayGenerator,
|
|
8
14
|
createBoundedSeriesGenerator,
|
|
@@ -11,14 +17,8 @@ import {
|
|
|
11
17
|
createSelectionGenerator,
|
|
12
18
|
createTupleGenerator,
|
|
13
19
|
createValueGenerator
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import
|
|
16
|
-
createArrayConfig,
|
|
17
|
-
createObjectConfig,
|
|
18
|
-
createTupleConfig,
|
|
19
|
-
createValueConfig
|
|
20
|
-
} from "./chunk-RDATYKAG.mjs";
|
|
21
|
-
import "./chunk-Q6CVTFPU.mjs";
|
|
20
|
+
} from "./chunk-6TGTIMX2.mjs";
|
|
21
|
+
import "./chunk-3U6BNHWG.mjs";
|
|
22
22
|
import "./chunk-UP3FJ7EK.mjs";
|
|
23
23
|
import "./chunk-XGB3TDIC.mjs";
|
|
24
24
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createArrayGenerator, createBoundedSeriesGenerator, createGeneratorByType, createObjectGenerator, createSelectionGenerator, createTupleGenerator, createValueGenerator } from './create_generator_fn.mjs';
|
|
2
|
+
|
|
3
|
+
declare namespace generator_fn {
|
|
4
|
+
export { createArrayGenerator as genArrayFn, createBoundedSeriesGenerator as genBoundedSeriesFn, createGeneratorByType as genFn, createObjectGenerator as genObjectFn, createSelectionGenerator as genSelectFn, createTupleGenerator as genTupleFn, createValueGenerator as genValueFn };
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { generator_fn as g };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createArrayGenerator, createBoundedSeriesGenerator, createGeneratorByType, createObjectGenerator, createSelectionGenerator, createTupleGenerator, createValueGenerator } from './create_generator_fn.js';
|
|
2
|
+
|
|
3
|
+
declare namespace generator_fn {
|
|
4
|
+
export { createArrayGenerator as genArrayFn, createBoundedSeriesGenerator as genBoundedSeriesFn, createGeneratorByType as genFn, createObjectGenerator as genObjectFn, createSelectionGenerator as genSelectFn, createTupleGenerator as genTupleFn, createValueGenerator as genValueFn };
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { generator_fn as g };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { createArrayGenerator as genArrayFn, createBoundedSeriesGenerator as genBoundedSeriesFn, createGeneratorByType as genFn, createObjectGenerator as genObjectFn, createSelectionGenerator as genSelectFn, createTupleGenerator as genTupleFn, createValueGenerator as genValueFn } from './create_generator_fn.mjs';
|
|
2
|
+
import './type.mjs';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { createArrayGenerator as genArrayFn, createBoundedSeriesGenerator as genBoundedSeriesFn, createGeneratorByType as genFn, createObjectGenerator as genObjectFn, createSelectionGenerator as genSelectFn, createTupleGenerator as genTupleFn, createValueGenerator as genValueFn } from './create_generator_fn.js';
|
|
2
|
+
import './type.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-XI5L2ENL.js');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkHMDAKHLFjs = require('./chunk-HMDAKHLF.js');
|
|
11
|
+
require('./chunk-TZ2RKEBF.js');
|
|
12
|
+
require('./chunk-A4QVPMYT.js');
|
|
13
|
+
require('./chunk-4VNS5WPM.js');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
exports.genArrayFn = _chunkHMDAKHLFjs.createArrayGenerator; exports.genBoundedSeriesFn = _chunkHMDAKHLFjs.createBoundedSeriesGenerator; exports.genFn = _chunkHMDAKHLFjs.createGeneratorByType; exports.genObjectFn = _chunkHMDAKHLFjs.createObjectGenerator; exports.genSelectFn = _chunkHMDAKHLFjs.createSelectionGenerator; exports.genTupleFn = _chunkHMDAKHLFjs.createTupleGenerator; exports.genValueFn = _chunkHMDAKHLFjs.createValueGenerator;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "./chunk-X7YFEBIL.mjs";
|
|
2
|
+
import {
|
|
3
|
+
createArrayGenerator,
|
|
4
|
+
createBoundedSeriesGenerator,
|
|
5
|
+
createGeneratorByType,
|
|
6
|
+
createObjectGenerator,
|
|
7
|
+
createSelectionGenerator,
|
|
8
|
+
createTupleGenerator,
|
|
9
|
+
createValueGenerator
|
|
10
|
+
} from "./chunk-6TGTIMX2.mjs";
|
|
11
|
+
import "./chunk-3U6BNHWG.mjs";
|
|
12
|
+
import "./chunk-UP3FJ7EK.mjs";
|
|
13
|
+
import "./chunk-XGB3TDIC.mjs";
|
|
14
|
+
export {
|
|
15
|
+
createArrayGenerator as genArrayFn,
|
|
16
|
+
createBoundedSeriesGenerator as genBoundedSeriesFn,
|
|
17
|
+
createGeneratorByType as genFn,
|
|
18
|
+
createObjectGenerator as genObjectFn,
|
|
19
|
+
createSelectionGenerator as genSelectFn,
|
|
20
|
+
createTupleGenerator as genTupleFn,
|
|
21
|
+
createValueGenerator as genValueFn
|
|
22
|
+
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { createArrayConfig, createBoundedSeriesConfig, createObjectConfig, createSelectionConfig, createTupleConfig, createValueConfig } from './create_config.mjs';
|
|
2
2
|
export { createArrayGenerator, createBoundedSeriesGenerator, createGeneratorByType, createObjectGenerator, createSelectionGenerator, createTupleGenerator, createValueGenerator } from './create_generator_fn.mjs';
|
|
3
|
-
export { ArrayConfig, BoundedSeriesConfig, ObjectConfig, Result, SelectionConfig, TupleConfig, ValueConfig } from './type.mjs';
|
|
3
|
+
export { ArrayConfig, BoundedSeriesConfig, ObjectConfig, Result, SelectionConfig, TupleConfig, TupleItems, ValueConfig } from './type.mjs';
|
|
4
|
+
export { c as StructConfig } from './config-C1N2Brw-.mjs';
|
|
5
|
+
export { g as StructGenerator } from './generator_fn-CJDbnCZl.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { createArrayConfig, createBoundedSeriesConfig, createObjectConfig, createSelectionConfig, createTupleConfig, createValueConfig } from './create_config.js';
|
|
2
2
|
export { createArrayGenerator, createBoundedSeriesGenerator, createGeneratorByType, createObjectGenerator, createSelectionGenerator, createTupleGenerator, createValueGenerator } from './create_generator_fn.js';
|
|
3
|
-
export { ArrayConfig, BoundedSeriesConfig, ObjectConfig, Result, SelectionConfig, TupleConfig, ValueConfig } from './type.js';
|
|
3
|
+
export { ArrayConfig, BoundedSeriesConfig, ObjectConfig, Result, SelectionConfig, TupleConfig, TupleItems, ValueConfig } from './type.js';
|
|
4
|
+
export { c as StructConfig } from './config-BTjogu5M.js';
|
|
5
|
+
export { g as StructGenerator } from './generator_fn-D-npAfnC.js';
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-SN4QTD6R.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
var _chunk52ZOIHJMjs = require('./chunk-52ZOIHJM.js');
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
var _chunkZ46HCVNZjs = require('./chunk-Z46HCVNZ.js');
|
|
10
|
-
require('./chunk-SN4QTD6R.js');
|
|
11
10
|
|
|
12
11
|
|
|
12
|
+
var _chunkW6QSJNDJjs = require('./chunk-W6QSJNDJ.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
var _chunkXI5L2ENLjs = require('./chunk-XI5L2ENL.js');
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
var _chunkHMDAKHLFjs = require('./chunk-HMDAKHLF.js');
|
|
25
|
+
require('./chunk-TZ2RKEBF.js');
|
|
20
26
|
require('./chunk-A4QVPMYT.js');
|
|
21
27
|
require('./chunk-4VNS5WPM.js');
|
|
22
28
|
|
|
@@ -33,4 +39,6 @@ require('./chunk-4VNS5WPM.js');
|
|
|
33
39
|
|
|
34
40
|
|
|
35
41
|
|
|
36
|
-
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
exports.StructConfig = _chunk52ZOIHJMjs.config_exports; exports.StructGenerator = _chunkXI5L2ENLjs.generator_fn_exports; exports.createArrayConfig = _chunkW6QSJNDJjs.createArrayConfig; exports.createArrayGenerator = _chunkHMDAKHLFjs.createArrayGenerator; exports.createBoundedSeriesConfig = _chunkW6QSJNDJjs.createBoundedSeriesConfig; exports.createBoundedSeriesGenerator = _chunkHMDAKHLFjs.createBoundedSeriesGenerator; exports.createGeneratorByType = _chunkHMDAKHLFjs.createGeneratorByType; exports.createObjectConfig = _chunkW6QSJNDJjs.createObjectConfig; exports.createObjectGenerator = _chunkHMDAKHLFjs.createObjectGenerator; exports.createSelectionConfig = _chunkW6QSJNDJjs.createSelectionConfig; exports.createSelectionGenerator = _chunkHMDAKHLFjs.createSelectionGenerator; exports.createTupleConfig = _chunkW6QSJNDJjs.createTupleConfig; exports.createTupleGenerator = _chunkHMDAKHLFjs.createTupleGenerator; exports.createValueConfig = _chunkW6QSJNDJjs.createValueConfig; exports.createValueGenerator = _chunkHMDAKHLFjs.createValueGenerator;
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createArrayGenerator,
|
|
3
|
-
createBoundedSeriesGenerator,
|
|
4
|
-
createGeneratorByType,
|
|
5
|
-
createObjectGenerator,
|
|
6
|
-
createSelectionGenerator,
|
|
7
|
-
createTupleGenerator,
|
|
8
|
-
createValueGenerator
|
|
9
|
-
} from "./chunk-4OB35J4Q.mjs";
|
|
10
1
|
import "./chunk-7UQSPUCL.mjs";
|
|
2
|
+
import {
|
|
3
|
+
config_exports
|
|
4
|
+
} from "./chunk-5UFZ4NET.mjs";
|
|
11
5
|
import {
|
|
12
6
|
createArrayConfig,
|
|
13
7
|
createBoundedSeriesConfig,
|
|
@@ -16,10 +10,24 @@ import {
|
|
|
16
10
|
createTupleConfig,
|
|
17
11
|
createValueConfig
|
|
18
12
|
} from "./chunk-RDATYKAG.mjs";
|
|
19
|
-
import
|
|
13
|
+
import {
|
|
14
|
+
generator_fn_exports
|
|
15
|
+
} from "./chunk-X7YFEBIL.mjs";
|
|
16
|
+
import {
|
|
17
|
+
createArrayGenerator,
|
|
18
|
+
createBoundedSeriesGenerator,
|
|
19
|
+
createGeneratorByType,
|
|
20
|
+
createObjectGenerator,
|
|
21
|
+
createSelectionGenerator,
|
|
22
|
+
createTupleGenerator,
|
|
23
|
+
createValueGenerator
|
|
24
|
+
} from "./chunk-6TGTIMX2.mjs";
|
|
25
|
+
import "./chunk-3U6BNHWG.mjs";
|
|
20
26
|
import "./chunk-UP3FJ7EK.mjs";
|
|
21
27
|
import "./chunk-XGB3TDIC.mjs";
|
|
22
28
|
export {
|
|
29
|
+
config_exports as StructConfig,
|
|
30
|
+
generator_fn_exports as StructGenerator,
|
|
23
31
|
createArrayConfig,
|
|
24
32
|
createArrayGenerator,
|
|
25
33
|
createBoundedSeriesConfig,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ValueConfig } from './type.mjs';
|
|
2
|
+
|
|
3
|
+
/** Number [bigInt](https://fakerjs.dev/api/number.html#bigInt) */
|
|
4
|
+
declare const bigInt: (options?: string | number | bigint | boolean | {
|
|
5
|
+
min?: bigint | number | string | boolean;
|
|
6
|
+
max?: bigint | number | string | boolean;
|
|
7
|
+
multipleOf?: bigint | number | string | boolean;
|
|
8
|
+
}) => ValueConfig<bigint>;
|
|
9
|
+
/** Number [binary](https://fakerjs.dev/api/number.html#binary) */
|
|
10
|
+
declare const binary: (options?: number | {
|
|
11
|
+
min?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
}) => ValueConfig<string>;
|
|
14
|
+
/** Number [float](https://fakerjs.dev/api/number.html#float) */
|
|
15
|
+
declare const float: (options?: number | {
|
|
16
|
+
min?: number;
|
|
17
|
+
max?: number;
|
|
18
|
+
fractionDigits?: number;
|
|
19
|
+
multipleOf?: number;
|
|
20
|
+
}) => ValueConfig<number>;
|
|
21
|
+
/** Number [hex](https://fakerjs.dev/api/number.html#hex) */
|
|
22
|
+
declare const hex: (options?: number | {
|
|
23
|
+
min?: number;
|
|
24
|
+
max?: number;
|
|
25
|
+
}) => ValueConfig<string>;
|
|
26
|
+
/** Number [int](https://fakerjs.dev/api/number.html#int) */
|
|
27
|
+
declare const int: (options?: number | {
|
|
28
|
+
min?: number;
|
|
29
|
+
max?: number;
|
|
30
|
+
multipleOf?: number;
|
|
31
|
+
}) => ValueConfig<number>;
|
|
32
|
+
/** Number [octal](https://fakerjs.dev/api/number.html#octal) */
|
|
33
|
+
declare const octal: (options?: number | {
|
|
34
|
+
min?: number;
|
|
35
|
+
max?: number;
|
|
36
|
+
}) => ValueConfig<string>;
|
|
37
|
+
|
|
38
|
+
declare const number_bigInt: typeof bigInt;
|
|
39
|
+
declare const number_binary: typeof binary;
|
|
40
|
+
declare const number_float: typeof float;
|
|
41
|
+
declare const number_hex: typeof hex;
|
|
42
|
+
declare const number_int: typeof int;
|
|
43
|
+
declare const number_octal: typeof octal;
|
|
44
|
+
declare namespace number {
|
|
45
|
+
export { number_bigInt as bigInt, number_binary as binary, number_float as float, number_hex as hex, number_int as int, number_octal as octal };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { binary as a, bigInt as b, float as f, hex as h, int as i, number as n, octal as o };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ValueConfig } from './type.js';
|
|
2
|
+
|
|
3
|
+
/** Number [bigInt](https://fakerjs.dev/api/number.html#bigInt) */
|
|
4
|
+
declare const bigInt: (options?: string | number | bigint | boolean | {
|
|
5
|
+
min?: bigint | number | string | boolean;
|
|
6
|
+
max?: bigint | number | string | boolean;
|
|
7
|
+
multipleOf?: bigint | number | string | boolean;
|
|
8
|
+
}) => ValueConfig<bigint>;
|
|
9
|
+
/** Number [binary](https://fakerjs.dev/api/number.html#binary) */
|
|
10
|
+
declare const binary: (options?: number | {
|
|
11
|
+
min?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
}) => ValueConfig<string>;
|
|
14
|
+
/** Number [float](https://fakerjs.dev/api/number.html#float) */
|
|
15
|
+
declare const float: (options?: number | {
|
|
16
|
+
min?: number;
|
|
17
|
+
max?: number;
|
|
18
|
+
fractionDigits?: number;
|
|
19
|
+
multipleOf?: number;
|
|
20
|
+
}) => ValueConfig<number>;
|
|
21
|
+
/** Number [hex](https://fakerjs.dev/api/number.html#hex) */
|
|
22
|
+
declare const hex: (options?: number | {
|
|
23
|
+
min?: number;
|
|
24
|
+
max?: number;
|
|
25
|
+
}) => ValueConfig<string>;
|
|
26
|
+
/** Number [int](https://fakerjs.dev/api/number.html#int) */
|
|
27
|
+
declare const int: (options?: number | {
|
|
28
|
+
min?: number;
|
|
29
|
+
max?: number;
|
|
30
|
+
multipleOf?: number;
|
|
31
|
+
}) => ValueConfig<number>;
|
|
32
|
+
/** Number [octal](https://fakerjs.dev/api/number.html#octal) */
|
|
33
|
+
declare const octal: (options?: number | {
|
|
34
|
+
min?: number;
|
|
35
|
+
max?: number;
|
|
36
|
+
}) => ValueConfig<string>;
|
|
37
|
+
|
|
38
|
+
declare const number_bigInt: typeof bigInt;
|
|
39
|
+
declare const number_binary: typeof binary;
|
|
40
|
+
declare const number_float: typeof float;
|
|
41
|
+
declare const number_hex: typeof hex;
|
|
42
|
+
declare const number_int: typeof int;
|
|
43
|
+
declare const number_octal: typeof octal;
|
|
44
|
+
declare namespace number {
|
|
45
|
+
export { number_bigInt as bigInt, number_binary as binary, number_float as float, number_hex as hex, number_int as int, number_octal as octal };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { binary as a, bigInt as b, float as f, hex as h, int as i, number as n, octal as o };
|
package/dist/type.d.mts
CHANGED
|
@@ -22,12 +22,64 @@ type ObjectConfig<T> = {
|
|
|
22
22
|
type: "obj";
|
|
23
23
|
content: T;
|
|
24
24
|
};
|
|
25
|
-
type
|
|
25
|
+
type TupleItems<A, B, C, D, E, F, G, H, I, J> = J extends undefined ? I extends undefined ? H extends undefined ? G extends undefined ? F extends undefined ? E extends undefined ? D extends undefined ? C extends undefined ? B extends undefined ? [A] : [A, B] : [A, B, C] : [A, B, C, D] : [A, B, C, D, E] : [A, B, C, D, E, F] : [A, B, C, D, E, F, G] : [A, B, C, D, E, F, G, H] : [A, B, C, D, E, F, G, H, I] : [A, B, C, D, E, F, G, H, I, J];
|
|
26
|
+
type TupleConfig<A, B = undefined, C = undefined, D = undefined, E = undefined, F = undefined, G = undefined, H = undefined, I = undefined, J = undefined> = {
|
|
26
27
|
type: "tuple";
|
|
27
|
-
configItems:
|
|
28
|
+
configItems: TupleItems<A, B, C, D, E, F, G, H, I, J>;
|
|
28
29
|
};
|
|
29
30
|
type Result<T> = T extends ValueConfig<infer U> ? U : T extends SelectionConfig<infer S> ? S : T extends BoundedSeriesConfig ? number[] : T extends ArrayConfig<infer W> ? Array<Result<W>> : T extends ObjectConfig<infer O> ? {
|
|
30
31
|
[K in keyof O]: Result<O[K]>;
|
|
31
|
-
} : T extends TupleConfig<infer A, infer B, infer C, infer D, infer E> ? E extends undefined ? D extends undefined ? C extends undefined ? B extends undefined ? [Result<A>] : [Result<A>, Result<B>] : [Result<A>, Result<B>, Result<C>] : [Result<A>, Result<B>, Result<C>, Result<D>] : [
|
|
32
|
+
} : T extends TupleConfig<infer A, infer B, infer C, infer D, infer E, infer F, infer G, infer H, infer I, infer J> ? J extends undefined ? I extends undefined ? H extends undefined ? G extends undefined ? F extends undefined ? E extends undefined ? D extends undefined ? C extends undefined ? B extends undefined ? [Result<A>] : [Result<A>, Result<B>] : [Result<A>, Result<B>, Result<C>] : [Result<A>, Result<B>, Result<C>, Result<D>] : [
|
|
33
|
+
Result<A>,
|
|
34
|
+
Result<B>,
|
|
35
|
+
Result<C>,
|
|
36
|
+
Result<D>,
|
|
37
|
+
Result<E>
|
|
38
|
+
] : [
|
|
39
|
+
Result<A>,
|
|
40
|
+
Result<B>,
|
|
41
|
+
Result<C>,
|
|
42
|
+
Result<D>,
|
|
43
|
+
Result<E>,
|
|
44
|
+
Result<F>
|
|
45
|
+
] : [
|
|
46
|
+
Result<A>,
|
|
47
|
+
Result<B>,
|
|
48
|
+
Result<C>,
|
|
49
|
+
Result<D>,
|
|
50
|
+
Result<E>,
|
|
51
|
+
Result<F>,
|
|
52
|
+
Result<G>
|
|
53
|
+
] : [
|
|
54
|
+
Result<A>,
|
|
55
|
+
Result<B>,
|
|
56
|
+
Result<C>,
|
|
57
|
+
Result<D>,
|
|
58
|
+
Result<E>,
|
|
59
|
+
Result<F>,
|
|
60
|
+
Result<G>,
|
|
61
|
+
Result<H>
|
|
62
|
+
] : [
|
|
63
|
+
Result<A>,
|
|
64
|
+
Result<B>,
|
|
65
|
+
Result<C>,
|
|
66
|
+
Result<D>,
|
|
67
|
+
Result<E>,
|
|
68
|
+
Result<F>,
|
|
69
|
+
Result<G>,
|
|
70
|
+
Result<H>,
|
|
71
|
+
Result<I>
|
|
72
|
+
] : [
|
|
73
|
+
Result<A>,
|
|
74
|
+
Result<B>,
|
|
75
|
+
Result<C>,
|
|
76
|
+
Result<D>,
|
|
77
|
+
Result<E>,
|
|
78
|
+
Result<F>,
|
|
79
|
+
Result<G>,
|
|
80
|
+
Result<H>,
|
|
81
|
+
Result<I>,
|
|
82
|
+
Result<J>
|
|
83
|
+
] : never;
|
|
32
84
|
|
|
33
|
-
export type { ArrayConfig, BoundedSeriesConfig, ObjectConfig, Result, SelectionConfig, TupleConfig, ValueConfig };
|
|
85
|
+
export type { ArrayConfig, BoundedSeriesConfig, ObjectConfig, Result, SelectionConfig, TupleConfig, TupleItems, ValueConfig };
|