struct-fakerator 2.4.4 → 2.4.6

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.
Files changed (246) hide show
  1. package/package.json +19 -1
  2. package/src/utils/airline.ts +4 -9
  3. package/src/utils/animal.ts +16 -33
  4. package/src/utils/color.ts +18 -26
  5. package/src/utils/commerce.ts +15 -23
  6. package/src/utils/company.ts +14 -27
  7. package/src/utils/database.ts +8 -13
  8. package/src/utils/datatype.ts +2 -4
  9. package/src/utils/datetime.ts +12 -24
  10. package/src/utils/finance.ts +26 -54
  11. package/src/utils/food.ts +10 -24
  12. package/src/utils/git.ts +6 -14
  13. package/src/utils/hacker.ts +7 -15
  14. package/src/utils/image.ts +9 -22
  15. package/src/utils/index.ts +2 -0
  16. package/src/utils/internet.ts +21 -52
  17. package/src/utils/location.ts +25 -45
  18. package/src/utils/lorem.ts +10 -22
  19. package/src/utils/music.ts +5 -9
  20. package/src/utils/number.ts +7 -13
  21. package/src/utils/person.ts +16 -38
  22. package/src/utils/phone.ts +3 -5
  23. package/src/utils/science.ts +3 -6
  24. package/src/utils/string.ts +11 -24
  25. package/src/utils/system.ts +15 -34
  26. package/src/utils/utils.ts +8 -0
  27. package/src/utils/vehicle.ts +10 -20
  28. package/src/utils/word.ts +10 -23
  29. package/dist/airline-BUwgrfsj.d.ts +0 -26
  30. package/dist/airline-C0ManYED.d.mts +0 -26
  31. package/dist/animal-arG64NM6.d.mts +0 -53
  32. package/dist/animal-erAZXs_d.d.ts +0 -53
  33. package/dist/chunk-2R3Q64AD.mjs +0 -28
  34. package/dist/chunk-3HQMGDUF.js +0 -98
  35. package/dist/chunk-4UGSTE5Q.js +0 -1968
  36. package/dist/chunk-5U5KT6H4.js +0 -61
  37. package/dist/chunk-7GE2A5VT.mjs +0 -43
  38. package/dist/chunk-7R4M2AAS.js +0 -25
  39. package/dist/chunk-7YNCYSJY.js +0 -19
  40. package/dist/chunk-A5HM6XTD.js +0 -76
  41. package/dist/chunk-AONYMB6O.mjs +0 -40
  42. package/dist/chunk-ARUJ7L4V.mjs +0 -64
  43. package/dist/chunk-BB5LVHI7.mjs +0 -46
  44. package/dist/chunk-BELV2S6H.js +0 -46
  45. package/dist/chunk-BS7IEV74.mjs +0 -1968
  46. package/dist/chunk-BXJJGEM5.js +0 -22
  47. package/dist/chunk-CFX43E3I.mjs +0 -22
  48. package/dist/chunk-D7PC2EQM.mjs +0 -73
  49. package/dist/chunk-DF3HCW6W.js +0 -43
  50. package/dist/chunk-DVBKP7FB.mjs +0 -31
  51. package/dist/chunk-EDATUWC4.js +0 -40
  52. package/dist/chunk-FLNVEEY2.mjs +0 -34
  53. package/dist/chunk-GE7QO474.js +0 -64
  54. package/dist/chunk-H4XUR4CP.mjs +0 -34
  55. package/dist/chunk-HADENNJW.js +0 -22
  56. package/dist/chunk-HHL3SY7A.js +0 -34
  57. package/dist/chunk-HOVGSNA4.js +0 -73
  58. package/dist/chunk-J266ZY25.mjs +0 -22
  59. package/dist/chunk-J3IXKUJK.js +0 -61
  60. package/dist/chunk-J5ZX7PK3.js +0 -34
  61. package/dist/chunk-L7PFM742.mjs +0 -49
  62. package/dist/chunk-LBQLRQOQ.js +0 -28
  63. package/dist/chunk-LJKI4ZZ5.mjs +0 -43
  64. package/dist/chunk-M2J3MAM7.mjs +0 -52
  65. package/dist/chunk-NEE5QKPY.mjs +0 -40
  66. package/dist/chunk-OLSCXZ3D.mjs +0 -98
  67. package/dist/chunk-P65FYBLE.mjs +0 -61
  68. package/dist/chunk-PVPH6A5C.mjs +0 -43
  69. package/dist/chunk-RKTNWUZK.js +0 -43
  70. package/dist/chunk-S73SWVKV.js +0 -31
  71. package/dist/chunk-SYSS7JTS.js +0 -49
  72. package/dist/chunk-T5JPOARU.js +0 -40
  73. package/dist/chunk-TX7HRLKE.mjs +0 -19
  74. package/dist/chunk-USSK73G6.js +0 -43
  75. package/dist/chunk-VCWW76K4.mjs +0 -61
  76. package/dist/chunk-WJ5EC6UN.js +0 -49
  77. package/dist/chunk-X5TOZB77.mjs +0 -43
  78. package/dist/chunk-XG6RUZSI.mjs +0 -16
  79. package/dist/chunk-XL5V4E3Z.js +0 -16
  80. package/dist/chunk-XPZ47TRN.js +0 -52
  81. package/dist/chunk-YJWVP2PN.mjs +0 -31
  82. package/dist/chunk-YQWQUNOA.js +0 -31
  83. package/dist/chunk-YTTIRC5J.mjs +0 -49
  84. package/dist/chunk-YY2TF7WC.mjs +0 -25
  85. package/dist/chunk-ZPQWZLYI.js +0 -43
  86. package/dist/chunk-ZRQDW34U.mjs +0 -76
  87. package/dist/color-BmTZnKiW.d.mts +0 -61
  88. package/dist/color-WFinq_Y4.d.ts +0 -61
  89. package/dist/commerce-Ch71_dd2.d.ts +0 -40
  90. package/dist/commerce-IGFkOXjQ.d.mts +0 -40
  91. package/dist/common-CbuXAeQ-.d.mts +0 -11
  92. package/dist/common-Kp8LaAzK.d.ts +0 -11
  93. package/dist/company---O1IwYo.d.ts +0 -35
  94. package/dist/company-D7Cc_hsx.d.mts +0 -35
  95. package/dist/database-B8Wr1oXH.d.mts +0 -23
  96. package/dist/database-Dnsy3cQb.d.ts +0 -23
  97. package/dist/datatype-CAu_sc1g.d.ts +0 -13
  98. package/dist/datatype-gjFHrdMj.d.mts +0 -13
  99. package/dist/datetime-BDgsnqq_.d.mts +0 -78
  100. package/dist/datetime-BkidbR1O.d.ts +0 -78
  101. package/dist/finance-BZEmlfNQ.d.mts +0 -90
  102. package/dist/finance-Cn3DFbX4.d.ts +0 -90
  103. package/dist/food-CfxZX81O.d.mts +0 -35
  104. package/dist/food-tr11e_Qp.d.ts +0 -35
  105. package/dist/git-DoCI9ZYT.d.ts +0 -31
  106. package/dist/git-Feo1ntKa.d.mts +0 -31
  107. package/dist/hacker-X3zBTMoE.d.ts +0 -26
  108. package/dist/hacker-mGVIO_wL.d.mts +0 -26
  109. package/dist/image-BeZbZlyo.d.ts +0 -56
  110. package/dist/image-govZ7HjA.d.mts +0 -56
  111. package/dist/index.d.mts +0 -57
  112. package/dist/index.d.ts +0 -57
  113. package/dist/index.js +0 -162
  114. package/dist/index.mjs +0 -162
  115. package/dist/internet-CJEETk0v.d.mts +0 -101
  116. package/dist/internet-jHHnqVJG.d.ts +0 -101
  117. package/dist/location-CTA_Bq7w.d.mts +0 -80
  118. package/dist/location-CsVekxIU.d.ts +0 -80
  119. package/dist/lorem-BE4n3dVs.d.mts +0 -62
  120. package/dist/lorem-Btv0fltY.d.ts +0 -62
  121. package/dist/music-CQ3lnDvg.d.mts +0 -20
  122. package/dist/music-D3zj5REe.d.ts +0 -20
  123. package/dist/number-Bj9ydAOH.d.ts +0 -47
  124. package/dist/number-D9Wn_qjS.d.mts +0 -47
  125. package/dist/person-LLleVozS.d.ts +0 -58
  126. package/dist/person-OKRyYmeX.d.mts +0 -58
  127. package/dist/phone-Bc8UXPF3.d.ts +0 -16
  128. package/dist/phone-QbHXAqVF.d.mts +0 -16
  129. package/dist/science-BgXAZ3YR.d.ts +0 -15
  130. package/dist/science-CSN41yUZ.d.mts +0 -15
  131. package/dist/string-9w976kVk.d.mts +0 -87
  132. package/dist/string-Cm9TczI6.d.ts +0 -87
  133. package/dist/system-DOyHjHxs.d.mts +0 -55
  134. package/dist/system-DipW6DYb.d.ts +0 -55
  135. package/dist/type-C8Ny1fB6.d.mts +0 -33
  136. package/dist/type-C8Ny1fB6.d.ts +0 -33
  137. package/dist/utils/airline.d.mts +0 -3
  138. package/dist/utils/airline.d.ts +0 -3
  139. package/dist/utils/airline.js +0 -12
  140. package/dist/utils/airline.mjs +0 -12
  141. package/dist/utils/animal.d.mts +0 -2
  142. package/dist/utils/animal.d.ts +0 -2
  143. package/dist/utils/animal.js +0 -36
  144. package/dist/utils/animal.mjs +0 -36
  145. package/dist/utils/color.d.mts +0 -3
  146. package/dist/utils/color.d.ts +0 -3
  147. package/dist/utils/color.js +0 -28
  148. package/dist/utils/color.mjs +0 -28
  149. package/dist/utils/commerce.d.mts +0 -2
  150. package/dist/utils/commerce.d.ts +0 -2
  151. package/dist/utils/commerce.js +0 -22
  152. package/dist/utils/commerce.mjs +0 -22
  153. package/dist/utils/common.d.mts +0 -2
  154. package/dist/utils/common.d.ts +0 -2
  155. package/dist/utils/common.js +0 -7
  156. package/dist/utils/common.mjs +0 -7
  157. package/dist/utils/company.d.mts +0 -2
  158. package/dist/utils/company.d.ts +0 -2
  159. package/dist/utils/company.js +0 -24
  160. package/dist/utils/company.mjs +0 -24
  161. package/dist/utils/database.d.mts +0 -2
  162. package/dist/utils/database.d.ts +0 -2
  163. package/dist/utils/database.js +0 -16
  164. package/dist/utils/database.mjs +0 -16
  165. package/dist/utils/datatype.d.mts +0 -2
  166. package/dist/utils/datatype.d.ts +0 -2
  167. package/dist/utils/datatype.js +0 -8
  168. package/dist/utils/datatype.mjs +0 -8
  169. package/dist/utils/datetime.d.mts +0 -2
  170. package/dist/utils/datetime.d.ts +0 -2
  171. package/dist/utils/datetime.js +0 -28
  172. package/dist/utils/datetime.mjs +0 -28
  173. package/dist/utils/finance.d.mts +0 -3
  174. package/dist/utils/finance.d.ts +0 -3
  175. package/dist/utils/finance.js +0 -44
  176. package/dist/utils/finance.mjs +0 -44
  177. package/dist/utils/food.d.mts +0 -2
  178. package/dist/utils/food.d.ts +0 -2
  179. package/dist/utils/food.js +0 -24
  180. package/dist/utils/food.mjs +0 -24
  181. package/dist/utils/git.d.mts +0 -2
  182. package/dist/utils/git.d.ts +0 -2
  183. package/dist/utils/git.js +0 -16
  184. package/dist/utils/git.mjs +0 -16
  185. package/dist/utils/hacker.d.mts +0 -2
  186. package/dist/utils/hacker.d.ts +0 -2
  187. package/dist/utils/hacker.js +0 -18
  188. package/dist/utils/hacker.mjs +0 -18
  189. package/dist/utils/image.d.mts +0 -2
  190. package/dist/utils/image.d.ts +0 -2
  191. package/dist/utils/image.js +0 -22
  192. package/dist/utils/image.mjs +0 -22
  193. package/dist/utils/index.d.mts +0 -27
  194. package/dist/utils/index.d.ts +0 -27
  195. package/dist/utils/index.js +0 -104
  196. package/dist/utils/index.mjs +0 -104
  197. package/dist/utils/internet.d.mts +0 -2
  198. package/dist/utils/internet.d.ts +0 -2
  199. package/dist/utils/internet.js +0 -46
  200. package/dist/utils/internet.mjs +0 -46
  201. package/dist/utils/location.d.mts +0 -2
  202. package/dist/utils/location.d.ts +0 -2
  203. package/dist/utils/location.js +0 -38
  204. package/dist/utils/location.mjs +0 -38
  205. package/dist/utils/lorem.d.mts +0 -2
  206. package/dist/utils/lorem.d.ts +0 -2
  207. package/dist/utils/lorem.js +0 -24
  208. package/dist/utils/lorem.mjs +0 -24
  209. package/dist/utils/music.d.mts +0 -2
  210. package/dist/utils/music.d.ts +0 -2
  211. package/dist/utils/music.js +0 -14
  212. package/dist/utils/music.mjs +0 -14
  213. package/dist/utils/number.d.mts +0 -2
  214. package/dist/utils/number.d.ts +0 -2
  215. package/dist/utils/number.js +0 -18
  216. package/dist/utils/number.mjs +0 -18
  217. package/dist/utils/person.d.mts +0 -3
  218. package/dist/utils/person.d.ts +0 -3
  219. package/dist/utils/person.js +0 -36
  220. package/dist/utils/person.mjs +0 -36
  221. package/dist/utils/phone.d.mts +0 -2
  222. package/dist/utils/phone.d.ts +0 -2
  223. package/dist/utils/phone.js +0 -10
  224. package/dist/utils/phone.mjs +0 -10
  225. package/dist/utils/science.d.mts +0 -3
  226. package/dist/utils/science.d.ts +0 -3
  227. package/dist/utils/science.js +0 -10
  228. package/dist/utils/science.mjs +0 -10
  229. package/dist/utils/string.d.mts +0 -2
  230. package/dist/utils/string.d.ts +0 -2
  231. package/dist/utils/string.js +0 -26
  232. package/dist/utils/string.mjs +0 -26
  233. package/dist/utils/system.d.mts +0 -2
  234. package/dist/utils/system.d.ts +0 -2
  235. package/dist/utils/system.js +0 -30
  236. package/dist/utils/system.mjs +0 -30
  237. package/dist/utils/vehicle.d.mts +0 -2
  238. package/dist/utils/vehicle.d.ts +0 -2
  239. package/dist/utils/vehicle.js +0 -24
  240. package/dist/utils/vehicle.mjs +0 -24
  241. package/dist/utils/word.d.mts +0 -75
  242. package/dist/utils/word.d.ts +0 -75
  243. package/dist/utils/word.js +0 -28
  244. package/dist/utils/word.mjs +0 -28
  245. package/dist/vehicle-DmBDda98.d.mts +0 -35
  246. package/dist/vehicle-rnBz1Za2.d.ts +0 -35
@@ -1,45 +1,32 @@
1
1
  import { faker } from "@faker-js/faker";
2
- import { createValueConfig } from "../create_config";
2
+ import { makeValueConfigFn } from "./utils";
3
3
 
4
4
  /** String [alpha](https://fakerjs.dev/api/string.html#alpha) */
5
- export const alpha = (...options: Parameters<typeof faker.string.alpha>) =>
6
- createValueConfig(() => faker.string.alpha(...options));
5
+ export const alpha = makeValueConfigFn(faker.string.alpha);
7
6
 
8
7
  /** String [alphanumeric](https://fakerjs.dev/api/string.html#alphanumeric) */
9
- export const alphanumeric = (
10
- ...options: Parameters<typeof faker.string.alphanumeric>
11
- ) => createValueConfig(() => faker.string.alphanumeric(...options));
8
+ export const alphanumeric = makeValueConfigFn(faker.string.alphanumeric);
12
9
 
13
10
  /** String [binary](https://fakerjs.dev/api/string.html#binary) */
14
- export const binary = (...options: Parameters<typeof faker.string.binary>) =>
15
- createValueConfig(() => faker.string.binary(...options));
11
+ export const binary = makeValueConfigFn(faker.string.binary);
16
12
 
17
13
  /** String [fromCharacters](https://fakerjs.dev/api/string.html#fromCharacters) */
18
- export const fromCharacters = (
19
- ...options: Parameters<typeof faker.string.fromCharacters>
20
- ) => createValueConfig(() => faker.string.fromCharacters(...options));
14
+ export const fromCharacters = makeValueConfigFn(faker.string.fromCharacters);
21
15
 
22
16
  /** String [hexadecimal](https://fakerjs.dev/api/string.html#hexadecimal) */
23
- export const hexadecimal = (
24
- ...options: Parameters<typeof faker.string.hexadecimal>
25
- ) => createValueConfig(() => faker.string.hexadecimal(...options));
17
+ export const hexadecimal = makeValueConfigFn(faker.string.hexadecimal);
26
18
 
27
19
  /** String [nanoid](https://fakerjs.dev/api/string.html#nanoid) */
28
- export const nanoid = (...options: Parameters<typeof faker.string.nanoid>) =>
29
- createValueConfig(() => faker.string.nanoid(...options));
20
+ export const nanoid = makeValueConfigFn(faker.string.nanoid);
30
21
 
31
22
  /** String [octal](https://fakerjs.dev/api/string.html#octal) */
32
- export const octal = (...options: Parameters<typeof faker.string.octal>) =>
33
- createValueConfig(() => faker.string.octal(...options));
23
+ export const octal = makeValueConfigFn(faker.string.octal);
34
24
 
35
25
  /** String [sample](https://fakerjs.dev/api/string.html#sample) */
36
- export const sample = (...options: Parameters<typeof faker.string.sample>) =>
37
- createValueConfig(() => faker.string.sample(...options));
26
+ export const sample = makeValueConfigFn(faker.string.sample);
38
27
 
39
28
  /** String [symbol](https://fakerjs.dev/api/string.html#symbol) */
40
- export const symbol = (...options: Parameters<typeof faker.string.symbol>) =>
41
- createValueConfig(() => faker.string.symbol(...options));
29
+ export const symbol = makeValueConfigFn(faker.string.symbol);
42
30
 
43
31
  /** String [uuid](https://fakerjs.dev/api/string.html#uuid) */
44
- export const uuid = (...options: Parameters<typeof faker.string.uuid>) =>
45
- createValueConfig(() => faker.string.uuid(...options));
32
+ export const uuid = makeValueConfigFn(faker.string.uuid);
@@ -1,59 +1,40 @@
1
1
  import { faker } from "@faker-js/faker";
2
- import { createValueConfig } from "../create_config";
2
+ import { makeValueConfigFn } from "./utils";
3
3
 
4
4
  /** System [commonFileExt](https://fakerjs.dev/api/system.html#commonFileExt) */
5
- export const commonFileExt = (
6
- ...options: Parameters<typeof faker.system.commonFileExt>
7
- ) => createValueConfig(() => faker.system.commonFileExt(...options));
5
+ export const commonFileExt = makeValueConfigFn(faker.system.commonFileExt);
8
6
 
9
7
  /** System [commonFileName](https://fakerjs.dev/api/system.html#commonFileName) */
10
- export const commonFileName = (
11
- ...options: Parameters<typeof faker.system.commonFileName>
12
- ) => createValueConfig(() => faker.system.commonFileName(...options));
8
+ export const commonFileName = makeValueConfigFn(faker.system.commonFileName);
13
9
 
14
10
  /** System [commonFileType](https://fakerjs.dev/api/system.html#commonFileType) */
15
- export const commonFileType = (
16
- ...options: Parameters<typeof faker.system.commonFileType>
17
- ) => createValueConfig(() => faker.system.commonFileType(...options));
11
+ export const commonFileType = makeValueConfigFn(faker.system.commonFileType);
18
12
 
19
13
  /** System [cron](https://fakerjs.dev/api/system.html#cron) */
20
- export const cron = (...options: Parameters<typeof faker.system.cron>) =>
21
- createValueConfig(() => faker.system.cron(...options));
14
+ export const cron = makeValueConfigFn(faker.system.cron);
22
15
 
23
16
  /** System [directoryPath](https://fakerjs.dev/api/system.html#directoryPath) */
24
- export const directoryPath = (
25
- ...options: Parameters<typeof faker.system.directoryPath>
26
- ) => createValueConfig(() => faker.system.directoryPath(...options));
17
+ export const directoryPath = makeValueConfigFn(faker.system.directoryPath);
27
18
 
28
19
  /** System [fileExt](https://fakerjs.dev/api/system.html#fileExt) */
29
- export const fileExt = (...options: Parameters<typeof faker.system.fileExt>) =>
30
- createValueConfig(() => faker.system.fileExt(...options));
20
+ export const fileExt = makeValueConfigFn(faker.system.fileExt);
31
21
 
32
22
  /** System [fileName](https://fakerjs.dev/api/system.html#fileName) */
33
- export const fileName = (
34
- ...options: Parameters<typeof faker.system.fileName>
35
- ) => createValueConfig(() => faker.system.fileName(...options));
23
+ export const fileName = makeValueConfigFn(faker.system.fileName);
36
24
 
37
25
  /** System [filePath](https://fakerjs.dev/api/system.html#filePath) */
38
- export const filePath = (
39
- ...options: Parameters<typeof faker.system.filePath>
40
- ) => createValueConfig(() => faker.system.filePath(...options));
26
+ export const filePath = makeValueConfigFn(faker.system.filePath);
41
27
 
42
28
  /** System [fileType](https://fakerjs.dev/api/system.html#fileType) */
43
- export const fileType = (
44
- ...options: Parameters<typeof faker.system.fileType>
45
- ) => createValueConfig(() => faker.system.fileType(...options));
29
+ export const fileType = makeValueConfigFn(faker.system.fileType);
46
30
 
47
31
  /** System [mimeType](https://fakerjs.dev/api/system.html#mimeType) */
48
- export const mimeType = (
49
- ...options: Parameters<typeof faker.system.mimeType>
50
- ) => createValueConfig(() => faker.system.mimeType(...options));
32
+ export const mimeType = makeValueConfigFn(faker.system.mimeType);
51
33
 
52
34
  /** System [networkInterface](https://fakerjs.dev/api/system.html#networkInterface) */
53
- export const networkInterface = (
54
- ...options: Parameters<typeof faker.system.networkInterface>
55
- ) => createValueConfig(() => faker.system.networkInterface(...options));
35
+ export const networkInterface = makeValueConfigFn(
36
+ faker.system.networkInterface,
37
+ );
56
38
 
57
39
  /** System [semver](https://fakerjs.dev/api/system.html#semver) */
58
- export const semver = (...options: Parameters<typeof faker.system.semver>) =>
59
- createValueConfig(() => faker.system.semver(...options));
40
+ export const semver = makeValueConfigFn(faker.system.semver);
@@ -0,0 +1,8 @@
1
+ import type { ValueConfig } from "../type";
2
+ import { createValueConfig } from "../create_config";
3
+
4
+ export function makeValueConfigFn<Args extends Array<unknown>, R>(
5
+ fn: (...options: Args) => R,
6
+ ): (...options: Args) => ValueConfig<R> {
7
+ return (...options) => createValueConfig(() => fn(...options));
8
+ }
@@ -1,39 +1,29 @@
1
1
  import { faker } from "@faker-js/faker";
2
- import { createValueConfig } from "../create_config";
2
+ import { makeValueConfigFn } from "./utils";
3
3
 
4
4
  /** Vehicle [bicycle](https://fakerjs.dev/api/vehicle.html#bicycle) */
5
- export const bicycle = (...options: Parameters<typeof faker.vehicle.bicycle>) =>
6
- createValueConfig(() => faker.vehicle.bicycle(...options));
5
+ export const bicycle = makeValueConfigFn(faker.vehicle.bicycle);
7
6
 
8
7
  /** Vehicle [color](https://fakerjs.dev/api/vehicle.html#color) */
9
- export const color = (...options: Parameters<typeof faker.vehicle.color>) =>
10
- createValueConfig(() => faker.vehicle.color(...options));
8
+ export const color = makeValueConfigFn(faker.vehicle.color);
11
9
 
12
10
  /** Vehicle [fuel](https://fakerjs.dev/api/vehicle.html#fuel) */
13
- export const fuel = (...options: Parameters<typeof faker.vehicle.fuel>) =>
14
- createValueConfig(() => faker.vehicle.fuel(...options));
11
+ export const fuel = makeValueConfigFn(faker.vehicle.fuel);
15
12
 
16
13
  /** Vehicle [manufacturer](https://fakerjs.dev/api/vehicle.html#manufacturer) */
17
- export const manufacturer = (
18
- ...options: Parameters<typeof faker.vehicle.manufacturer>
19
- ) => createValueConfig(() => faker.vehicle.manufacturer(...options));
14
+ export const manufacturer = makeValueConfigFn(faker.vehicle.manufacturer);
20
15
 
21
16
  /** Vehicle [model](https://fakerjs.dev/api/vehicle.html#model) */
22
- export const model = (...options: Parameters<typeof faker.vehicle.model>) =>
23
- createValueConfig(() => faker.vehicle.model(...options));
17
+ export const model = makeValueConfigFn(faker.vehicle.model);
24
18
 
25
19
  /** Vehicle [type](https://fakerjs.dev/api/vehicle.html#type) */
26
- export const type = (...options: Parameters<typeof faker.vehicle.type>) =>
27
- createValueConfig(() => faker.vehicle.type(...options));
20
+ export const type = makeValueConfigFn(faker.vehicle.type);
28
21
 
29
22
  /** Vehicle [vehicle](https://fakerjs.dev/api/vehicle.html#vehicle) */
30
- export const vehicle = (...options: Parameters<typeof faker.vehicle.vehicle>) =>
31
- createValueConfig(() => faker.vehicle.vehicle(...options));
23
+ export const vehicle = makeValueConfigFn(faker.vehicle.vehicle);
32
24
 
33
25
  /** Vehicle [vin](https://fakerjs.dev/api/vehicle.html#vin) */
34
- export const vin = (...options: Parameters<typeof faker.vehicle.vin>) =>
35
- createValueConfig(() => faker.vehicle.vin(...options));
26
+ export const vin = makeValueConfigFn(faker.vehicle.vin);
36
27
 
37
28
  /** Vehicle [vrm](https://fakerjs.dev/api/vehicle.html#vrm) */
38
- export const vrm = (...options: Parameters<typeof faker.vehicle.vrm>) =>
39
- createValueConfig(() => faker.vehicle.vrm(...options));
29
+ export const vrm = makeValueConfigFn(faker.vehicle.vrm);
package/src/utils/word.ts CHANGED
@@ -1,42 +1,29 @@
1
1
  import { faker } from "@faker-js/faker";
2
- import { createValueConfig } from "../create_config";
2
+ import { makeValueConfigFn } from "./utils";
3
3
 
4
4
  /** Word [adjective](https://fakerjs.dev/word.html#adjective) */
5
- export const adjective = (
6
- ...options: Parameters<typeof faker.word.adjective>
7
- ) => createValueConfig(() => faker.word.adjective(...options));
5
+ export const adjective = makeValueConfigFn(faker.word.adjective);
8
6
 
9
7
  /** Word [adverb](https://fakerjs.dev/word.html#adverb) */
10
- export const adverb = (...options: Parameters<typeof faker.word.adverb>) =>
11
- createValueConfig(() => faker.word.adverb(...options));
8
+ export const adverb = makeValueConfigFn(faker.word.adverb);
12
9
 
13
10
  /** Word [conjunction](https://fakerjs.dev/word.html#conjunction) */
14
- export const conjunction = (
15
- ...options: Parameters<typeof faker.word.conjunction>
16
- ) => createValueConfig(() => faker.word.conjunction(...options));
11
+ export const conjunction = makeValueConfigFn(faker.word.conjunction);
17
12
 
18
13
  /** Word [interjection](https://fakerjs.dev/word.html#interjection) */
19
- export const interjection = (
20
- ...options: Parameters<typeof faker.word.interjection>
21
- ) => createValueConfig(() => faker.word.interjection(...options));
14
+ export const interjection = makeValueConfigFn(faker.word.interjection);
22
15
 
23
16
  /** Word [noun](https://fakerjs.dev/word.html#noun) */
24
- export const noun = (...options: Parameters<typeof faker.word.noun>) =>
25
- createValueConfig(() => faker.word.noun(...options));
17
+ export const noun = makeValueConfigFn(faker.word.noun);
26
18
 
27
19
  /** Word [preposition](https://fakerjs.dev/word.html#preposition) */
28
- export const preposition = (
29
- ...options: Parameters<typeof faker.word.preposition>
30
- ) => createValueConfig(() => faker.word.preposition(...options));
20
+ export const preposition = makeValueConfigFn(faker.word.preposition);
31
21
 
32
22
  /** Word [sample](https://fakerjs.dev/word.html#sample) */
33
- export const sample = (...options: Parameters<typeof faker.word.sample>) =>
34
- createValueConfig(() => faker.word.sample(...options));
23
+ export const sample = makeValueConfigFn(faker.word.sample);
35
24
 
36
25
  /** Word [verb](https://fakerjs.dev/word.html#verb) */
37
- export const verb = (...options: Parameters<typeof faker.word.verb>) =>
38
- createValueConfig(() => faker.word.verb(...options));
26
+ export const verb = makeValueConfigFn(faker.word.verb);
39
27
 
40
28
  /** Word [words](https://fakerjs.dev/word.html#words) */
41
- export const words = (...options: Parameters<typeof faker.word.words>) =>
42
- createValueConfig(() => faker.word.words(...options));
29
+ export const words = makeValueConfigFn(faker.word.words);
@@ -1,26 +0,0 @@
1
- import * as _faker_js_faker__ from '@faker-js/faker/.';
2
- import { V as ValueConfig } from './type-C8Ny1fB6.js';
3
-
4
- /** Airline [aircraftType](https://fakerjs.dev/api/airline.html#aircraftType) */
5
- declare const aircraftType: () => ValueConfig<"narrowbody" | "regional" | "widebody">;
6
- /** Airline [flightNumber](https://fakerjs.dev/api/airline.html#flightNumber) */
7
- declare const flightNumber: (options?: {
8
- length?: number | {
9
- min: number;
10
- max: number;
11
- };
12
- addLeadingZeros?: boolean;
13
- }) => ValueConfig<string>;
14
- /** Airline [seat](https://fakerjs.dev/api/airline.html#seat) */
15
- declare const seat: (options?: {
16
- aircraftType?: _faker_js_faker__.AircraftType;
17
- }) => ValueConfig<string>;
18
-
19
- declare const airline_aircraftType: typeof aircraftType;
20
- declare const airline_flightNumber: typeof flightNumber;
21
- declare const airline_seat: typeof seat;
22
- declare namespace airline {
23
- export { airline_aircraftType as aircraftType, airline_flightNumber as flightNumber, airline_seat as seat };
24
- }
25
-
26
- export { airline as a, aircraftType as b, flightNumber as f, seat as s };
@@ -1,26 +0,0 @@
1
- import * as _faker_js_faker__ from '@faker-js/faker/.';
2
- import { V as ValueConfig } from './type-C8Ny1fB6.mjs';
3
-
4
- /** Airline [aircraftType](https://fakerjs.dev/api/airline.html#aircraftType) */
5
- declare const aircraftType: () => ValueConfig<"narrowbody" | "regional" | "widebody">;
6
- /** Airline [flightNumber](https://fakerjs.dev/api/airline.html#flightNumber) */
7
- declare const flightNumber: (options?: {
8
- length?: number | {
9
- min: number;
10
- max: number;
11
- };
12
- addLeadingZeros?: boolean;
13
- }) => ValueConfig<string>;
14
- /** Airline [seat](https://fakerjs.dev/api/airline.html#seat) */
15
- declare const seat: (options?: {
16
- aircraftType?: _faker_js_faker__.AircraftType;
17
- }) => ValueConfig<string>;
18
-
19
- declare const airline_aircraftType: typeof aircraftType;
20
- declare const airline_flightNumber: typeof flightNumber;
21
- declare const airline_seat: typeof seat;
22
- declare namespace airline {
23
- export { airline_aircraftType as aircraftType, airline_flightNumber as flightNumber, airline_seat as seat };
24
- }
25
-
26
- export { airline as a, aircraftType as b, flightNumber as f, seat as s };
@@ -1,53 +0,0 @@
1
- import { V as ValueConfig } from './type-C8Ny1fB6.mjs';
2
-
3
- /** Animal [bear](https://fakerjs.dev/api/animal.html#bear) */
4
- declare const bear: () => ValueConfig<string>;
5
- /** Animal [bird](https://fakerjs.dev/api/animal.html#bird) */
6
- declare const bird: () => ValueConfig<string>;
7
- /** Animal [cat](https://fakerjs.dev/api/animal.html#cat) */
8
- declare const cat: () => ValueConfig<string>;
9
- /** Animal [cetacean](https://fakerjs.dev/api/animal.html#cetacean) */
10
- declare const cetacean: () => ValueConfig<string>;
11
- /** Animal [cow](https://fakerjs.dev/api/animal.html#cow) */
12
- declare const cow: () => ValueConfig<string>;
13
- /** Animal [crocodilia](https://fakerjs.dev/api/animal.html#crocodilia) */
14
- declare const crocodilia: () => ValueConfig<string>;
15
- /** Animal [dog](https://fakerjs.dev/api/animal.html#dog) */
16
- declare const dog: () => ValueConfig<string>;
17
- /** Animal [fish](https://fakerjs.dev/api/animal.html#fish) */
18
- declare const fish: () => ValueConfig<string>;
19
- /** Animal [horse](https://fakerjs.dev/api/animal.html#horse) */
20
- declare const horse: () => ValueConfig<string>;
21
- /** Animal [insect](https://fakerjs.dev/api/animal.html#insect) */
22
- declare const insect: () => ValueConfig<string>;
23
- /** Animal [lion](https://fakerjs.dev/api/animal.html#lion) */
24
- declare const lion: () => ValueConfig<string>;
25
- /** Animal [rabbit](https://fakerjs.dev/api/animal.html#rabbit) */
26
- declare const rabbit: () => ValueConfig<string>;
27
- /** Animal [rodent](https://fakerjs.dev/api/animal.html#rodent) */
28
- declare const rodent: () => ValueConfig<string>;
29
- /** Animal [snake](https://fakerjs.dev/api/animal.html#snake) */
30
- declare const snake: () => ValueConfig<string>;
31
- /** Animal [type](https://fakerjs.dev/api/animal.html#type) */
32
- declare const type: () => ValueConfig<string>;
33
-
34
- declare const animal_bear: typeof bear;
35
- declare const animal_bird: typeof bird;
36
- declare const animal_cat: typeof cat;
37
- declare const animal_cetacean: typeof cetacean;
38
- declare const animal_cow: typeof cow;
39
- declare const animal_crocodilia: typeof crocodilia;
40
- declare const animal_dog: typeof dog;
41
- declare const animal_fish: typeof fish;
42
- declare const animal_horse: typeof horse;
43
- declare const animal_insect: typeof insect;
44
- declare const animal_lion: typeof lion;
45
- declare const animal_rabbit: typeof rabbit;
46
- declare const animal_rodent: typeof rodent;
47
- declare const animal_snake: typeof snake;
48
- declare const animal_type: typeof type;
49
- declare namespace animal {
50
- export { animal_bear as bear, animal_bird as bird, animal_cat as cat, animal_cetacean as cetacean, animal_cow as cow, animal_crocodilia as crocodilia, animal_dog as dog, animal_fish as fish, animal_horse as horse, animal_insect as insect, animal_lion as lion, animal_rabbit as rabbit, animal_rodent as rodent, animal_snake as snake, animal_type as type };
51
- }
52
-
53
- export { animal as a, bear as b, bird as c, cat as d, cetacean as e, cow as f, crocodilia as g, dog as h, fish as i, horse as j, insect as k, lion as l, rodent as m, rabbit as r, snake as s, type as t };
@@ -1,53 +0,0 @@
1
- import { V as ValueConfig } from './type-C8Ny1fB6.js';
2
-
3
- /** Animal [bear](https://fakerjs.dev/api/animal.html#bear) */
4
- declare const bear: () => ValueConfig<string>;
5
- /** Animal [bird](https://fakerjs.dev/api/animal.html#bird) */
6
- declare const bird: () => ValueConfig<string>;
7
- /** Animal [cat](https://fakerjs.dev/api/animal.html#cat) */
8
- declare const cat: () => ValueConfig<string>;
9
- /** Animal [cetacean](https://fakerjs.dev/api/animal.html#cetacean) */
10
- declare const cetacean: () => ValueConfig<string>;
11
- /** Animal [cow](https://fakerjs.dev/api/animal.html#cow) */
12
- declare const cow: () => ValueConfig<string>;
13
- /** Animal [crocodilia](https://fakerjs.dev/api/animal.html#crocodilia) */
14
- declare const crocodilia: () => ValueConfig<string>;
15
- /** Animal [dog](https://fakerjs.dev/api/animal.html#dog) */
16
- declare const dog: () => ValueConfig<string>;
17
- /** Animal [fish](https://fakerjs.dev/api/animal.html#fish) */
18
- declare const fish: () => ValueConfig<string>;
19
- /** Animal [horse](https://fakerjs.dev/api/animal.html#horse) */
20
- declare const horse: () => ValueConfig<string>;
21
- /** Animal [insect](https://fakerjs.dev/api/animal.html#insect) */
22
- declare const insect: () => ValueConfig<string>;
23
- /** Animal [lion](https://fakerjs.dev/api/animal.html#lion) */
24
- declare const lion: () => ValueConfig<string>;
25
- /** Animal [rabbit](https://fakerjs.dev/api/animal.html#rabbit) */
26
- declare const rabbit: () => ValueConfig<string>;
27
- /** Animal [rodent](https://fakerjs.dev/api/animal.html#rodent) */
28
- declare const rodent: () => ValueConfig<string>;
29
- /** Animal [snake](https://fakerjs.dev/api/animal.html#snake) */
30
- declare const snake: () => ValueConfig<string>;
31
- /** Animal [type](https://fakerjs.dev/api/animal.html#type) */
32
- declare const type: () => ValueConfig<string>;
33
-
34
- declare const animal_bear: typeof bear;
35
- declare const animal_bird: typeof bird;
36
- declare const animal_cat: typeof cat;
37
- declare const animal_cetacean: typeof cetacean;
38
- declare const animal_cow: typeof cow;
39
- declare const animal_crocodilia: typeof crocodilia;
40
- declare const animal_dog: typeof dog;
41
- declare const animal_fish: typeof fish;
42
- declare const animal_horse: typeof horse;
43
- declare const animal_insect: typeof insect;
44
- declare const animal_lion: typeof lion;
45
- declare const animal_rabbit: typeof rabbit;
46
- declare const animal_rodent: typeof rodent;
47
- declare const animal_snake: typeof snake;
48
- declare const animal_type: typeof type;
49
- declare namespace animal {
50
- export { animal_bear as bear, animal_bird as bird, animal_cat as cat, animal_cetacean as cetacean, animal_cow as cow, animal_crocodilia as crocodilia, animal_dog as dog, animal_fish as fish, animal_horse as horse, animal_insect as insect, animal_lion as lion, animal_rabbit as rabbit, animal_rodent as rodent, animal_snake as snake, animal_type as type };
51
- }
52
-
53
- export { animal as a, bear as b, bird as c, cat as d, cetacean as e, cow as f, crocodilia as g, dog as h, fish as i, horse as j, insect as k, lion as l, rodent as m, rabbit as r, snake as s, type as t };
@@ -1,28 +0,0 @@
1
- import {
2
- f
3
- } from "./chunk-BS7IEV74.mjs";
4
- import {
5
- __export,
6
- createValueConfig
7
- } from "./chunk-OLSCXZ3D.mjs";
8
-
9
- // src/utils/music.ts
10
- var music_exports = {};
11
- __export(music_exports, {
12
- album: () => album,
13
- artist: () => artist,
14
- genre: () => genre,
15
- songName: () => songName
16
- });
17
- var album = (...options) => createValueConfig(() => f.music.album(...options));
18
- var artist = (...options) => createValueConfig(() => f.music.artist(...options));
19
- var genre = (...options) => createValueConfig(() => f.music.genre(...options));
20
- var songName = (...options) => createValueConfig(() => f.music.songName(...options));
21
-
22
- export {
23
- album,
24
- artist,
25
- genre,
26
- songName,
27
- music_exports
28
- };
@@ -1,98 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name in all)
4
- __defProp(target, name, { get: all[name], enumerable: true });
5
- };
6
-
7
- // src/config_scheme.ts
8
- var _zod = require('zod');
9
- var valueConfigScheme = _zod.z.object({
10
- type: _zod.z.string().regex(/^value$/, { message: "invalid type string" }),
11
- generateFn: _zod.z.function()
12
- });
13
- var selectionConfigScheme = _zod.z.object({
14
- type: _zod.z.string().regex(/^select$/, { message: "invalid type string" }),
15
- items: _zod.z.any().array().nonempty({ message: "items can not be empty" })
16
- });
17
- var arrayConfigScheme = _zod.z.object({
18
- type: _zod.z.string().regex(/^arr$/, { message: "invalid type string" }),
19
- item: _zod.z.object({}),
20
- len: _zod.z.number().nonnegative()
21
- });
22
- var tupleConfigScheme = _zod.z.object({
23
- type: _zod.z.string().regex(/^tuple$/, { message: "invalid type string" }),
24
- configItems: _zod.z.any().array()
25
- });
26
- var objConfigScheme = _zod.z.object({
27
- type: _zod.z.string().regex(/^obj$/, { message: "invalid type string" }),
28
- content: _zod.z.object({})
29
- });
30
- var boundedSeriesScheme = _zod.z.object({
31
- type: _zod.z.string().regex(/^bounded_series$/, { message: "invalid type string" }),
32
- upperLimit: _zod.z.number().nonnegative(),
33
- lowerLimit: _zod.z.number().nonnegative(),
34
- createInitValue: _zod.z.function().args().returns(_zod.z.number()),
35
- count: _zod.z.number().nonnegative()
36
- }).refine(({ upperLimit, lowerLimit }) => upperLimit >= lowerLimit, {
37
- message: "lowerLimit can not greater then upperLimit"
38
- }).refine(({ createInitValue }) => typeof createInitValue() === "number", {
39
- message: "createInitValue is not return number",
40
- path: ["createInitValue"]
41
- });
42
-
43
- // src/create_config.ts
44
- var createValueConfig = (generateFn) => {
45
- const config = {
46
- type: "value",
47
- generateFn
48
- };
49
- valueConfigScheme.parse(config);
50
- return config;
51
- };
52
- var createSelectionConfig = (items) => {
53
- const config = { type: "select", items };
54
- selectionConfigScheme.parse(config);
55
- return config;
56
- };
57
- var createObjectConfig = (content) => {
58
- const config = { type: "obj", content };
59
- objConfigScheme.parse(config);
60
- return config;
61
- };
62
- var createArrayConfig = (item, len) => {
63
- const config = { type: "arr", item, len };
64
- arrayConfigScheme.parse(config);
65
- return config;
66
- };
67
- var createTupleConfig = (configItems) => {
68
- const config = {
69
- type: "tuple",
70
- configItems
71
- };
72
- tupleConfigScheme.parse(config);
73
- return config;
74
- };
75
- var createBoundedSeriesConfig = (config) => {
76
- const newConfig = {
77
- type: "bounded_series",
78
- ...config
79
- };
80
- boundedSeriesScheme.parse(newConfig);
81
- return newConfig;
82
- };
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
- exports.__export = __export; exports.valueConfigScheme = valueConfigScheme; exports.selectionConfigScheme = selectionConfigScheme; exports.arrayConfigScheme = arrayConfigScheme; exports.tupleConfigScheme = tupleConfigScheme; exports.objConfigScheme = objConfigScheme; exports.boundedSeriesScheme = boundedSeriesScheme; exports.createValueConfig = createValueConfig; exports.createSelectionConfig = createSelectionConfig; exports.createObjectConfig = createObjectConfig; exports.createArrayConfig = createArrayConfig; exports.createTupleConfig = createTupleConfig; exports.createBoundedSeriesConfig = createBoundedSeriesConfig;