struct-fakerator 2.4.5 → 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.
- package/package.json +1 -1
- package/src/utils/airline.ts +4 -9
- package/src/utils/animal.ts +16 -33
- package/src/utils/color.ts +18 -26
- package/src/utils/commerce.ts +15 -23
- package/src/utils/company.ts +14 -27
- package/src/utils/database.ts +8 -13
- package/src/utils/datatype.ts +2 -4
- package/src/utils/datetime.ts +12 -24
- package/src/utils/finance.ts +26 -54
- package/src/utils/food.ts +10 -24
- package/src/utils/git.ts +6 -14
- package/src/utils/hacker.ts +7 -15
- package/src/utils/image.ts +9 -22
- package/src/utils/index.ts +2 -0
- package/src/utils/internet.ts +21 -52
- package/src/utils/location.ts +25 -45
- package/src/utils/lorem.ts +10 -22
- package/src/utils/music.ts +5 -9
- package/src/utils/number.ts +7 -13
- package/src/utils/person.ts +16 -38
- package/src/utils/phone.ts +3 -5
- package/src/utils/science.ts +3 -6
- package/src/utils/string.ts +11 -24
- package/src/utils/system.ts +15 -34
- package/src/utils/utils.ts +8 -0
- package/src/utils/vehicle.ts +10 -20
- package/src/utils/word.ts +10 -23
- package/dist/airline-BUwgrfsj.d.ts +0 -26
- package/dist/airline-C0ManYED.d.mts +0 -26
- package/dist/animal-arG64NM6.d.mts +0 -53
- package/dist/animal-erAZXs_d.d.ts +0 -53
- package/dist/chunk-2R3Q64AD.mjs +0 -28
- package/dist/chunk-3HQMGDUF.js +0 -98
- package/dist/chunk-4UGSTE5Q.js +0 -1968
- package/dist/chunk-5U5KT6H4.js +0 -61
- package/dist/chunk-7GE2A5VT.mjs +0 -43
- package/dist/chunk-7R4M2AAS.js +0 -25
- package/dist/chunk-7YNCYSJY.js +0 -19
- package/dist/chunk-A5HM6XTD.js +0 -76
- package/dist/chunk-AONYMB6O.mjs +0 -40
- package/dist/chunk-ARUJ7L4V.mjs +0 -64
- package/dist/chunk-BB5LVHI7.mjs +0 -46
- package/dist/chunk-BELV2S6H.js +0 -46
- package/dist/chunk-BS7IEV74.mjs +0 -1968
- package/dist/chunk-BXJJGEM5.js +0 -22
- package/dist/chunk-CFX43E3I.mjs +0 -22
- package/dist/chunk-D7PC2EQM.mjs +0 -73
- package/dist/chunk-DF3HCW6W.js +0 -43
- package/dist/chunk-DVBKP7FB.mjs +0 -31
- package/dist/chunk-EDATUWC4.js +0 -40
- package/dist/chunk-FLNVEEY2.mjs +0 -34
- package/dist/chunk-GE7QO474.js +0 -64
- package/dist/chunk-H4XUR4CP.mjs +0 -34
- package/dist/chunk-HADENNJW.js +0 -22
- package/dist/chunk-HHL3SY7A.js +0 -34
- package/dist/chunk-HOVGSNA4.js +0 -73
- package/dist/chunk-J266ZY25.mjs +0 -22
- package/dist/chunk-J3IXKUJK.js +0 -61
- package/dist/chunk-J5ZX7PK3.js +0 -34
- package/dist/chunk-L7PFM742.mjs +0 -49
- package/dist/chunk-LBQLRQOQ.js +0 -28
- package/dist/chunk-LJKI4ZZ5.mjs +0 -43
- package/dist/chunk-M2J3MAM7.mjs +0 -52
- package/dist/chunk-NEE5QKPY.mjs +0 -40
- package/dist/chunk-OLSCXZ3D.mjs +0 -98
- package/dist/chunk-P65FYBLE.mjs +0 -61
- package/dist/chunk-PVPH6A5C.mjs +0 -43
- package/dist/chunk-RKTNWUZK.js +0 -43
- package/dist/chunk-S73SWVKV.js +0 -31
- package/dist/chunk-SYSS7JTS.js +0 -49
- package/dist/chunk-T5JPOARU.js +0 -40
- package/dist/chunk-TX7HRLKE.mjs +0 -19
- package/dist/chunk-USSK73G6.js +0 -43
- package/dist/chunk-VCWW76K4.mjs +0 -61
- package/dist/chunk-WJ5EC6UN.js +0 -49
- package/dist/chunk-X5TOZB77.mjs +0 -43
- package/dist/chunk-XG6RUZSI.mjs +0 -16
- package/dist/chunk-XL5V4E3Z.js +0 -16
- package/dist/chunk-XPZ47TRN.js +0 -52
- package/dist/chunk-YJWVP2PN.mjs +0 -31
- package/dist/chunk-YQWQUNOA.js +0 -31
- package/dist/chunk-YTTIRC5J.mjs +0 -49
- package/dist/chunk-YY2TF7WC.mjs +0 -25
- package/dist/chunk-ZPQWZLYI.js +0 -43
- package/dist/chunk-ZRQDW34U.mjs +0 -76
- package/dist/color-BmTZnKiW.d.mts +0 -61
- package/dist/color-WFinq_Y4.d.ts +0 -61
- package/dist/commerce-Ch71_dd2.d.ts +0 -40
- package/dist/commerce-IGFkOXjQ.d.mts +0 -40
- package/dist/common-CbuXAeQ-.d.mts +0 -11
- package/dist/common-Kp8LaAzK.d.ts +0 -11
- package/dist/company---O1IwYo.d.ts +0 -35
- package/dist/company-D7Cc_hsx.d.mts +0 -35
- package/dist/database-B8Wr1oXH.d.mts +0 -23
- package/dist/database-Dnsy3cQb.d.ts +0 -23
- package/dist/datatype-CAu_sc1g.d.ts +0 -13
- package/dist/datatype-gjFHrdMj.d.mts +0 -13
- package/dist/datetime-BDgsnqq_.d.mts +0 -78
- package/dist/datetime-BkidbR1O.d.ts +0 -78
- package/dist/finance-BZEmlfNQ.d.mts +0 -90
- package/dist/finance-Cn3DFbX4.d.ts +0 -90
- package/dist/food-CfxZX81O.d.mts +0 -35
- package/dist/food-tr11e_Qp.d.ts +0 -35
- package/dist/git-DoCI9ZYT.d.ts +0 -31
- package/dist/git-Feo1ntKa.d.mts +0 -31
- package/dist/hacker-X3zBTMoE.d.ts +0 -26
- package/dist/hacker-mGVIO_wL.d.mts +0 -26
- package/dist/image-BeZbZlyo.d.ts +0 -56
- package/dist/image-govZ7HjA.d.mts +0 -56
- package/dist/index.d.mts +0 -57
- package/dist/index.d.ts +0 -57
- package/dist/index.js +0 -162
- package/dist/index.mjs +0 -162
- package/dist/internet-CJEETk0v.d.mts +0 -101
- package/dist/internet-jHHnqVJG.d.ts +0 -101
- package/dist/location-CTA_Bq7w.d.mts +0 -80
- package/dist/location-CsVekxIU.d.ts +0 -80
- package/dist/lorem-BE4n3dVs.d.mts +0 -62
- package/dist/lorem-Btv0fltY.d.ts +0 -62
- package/dist/music-CQ3lnDvg.d.mts +0 -20
- package/dist/music-D3zj5REe.d.ts +0 -20
- package/dist/number-Bj9ydAOH.d.ts +0 -47
- package/dist/number-D9Wn_qjS.d.mts +0 -47
- package/dist/person-LLleVozS.d.ts +0 -58
- package/dist/person-OKRyYmeX.d.mts +0 -58
- package/dist/phone-Bc8UXPF3.d.ts +0 -16
- package/dist/phone-QbHXAqVF.d.mts +0 -16
- package/dist/science-BgXAZ3YR.d.ts +0 -15
- package/dist/science-CSN41yUZ.d.mts +0 -15
- package/dist/string-9w976kVk.d.mts +0 -87
- package/dist/string-Cm9TczI6.d.ts +0 -87
- package/dist/system-DOyHjHxs.d.mts +0 -55
- package/dist/system-DipW6DYb.d.ts +0 -55
- package/dist/type-C8Ny1fB6.d.mts +0 -33
- package/dist/type-C8Ny1fB6.d.ts +0 -33
- package/dist/utils/airline.d.mts +0 -3
- package/dist/utils/airline.d.ts +0 -3
- package/dist/utils/airline.js +0 -12
- package/dist/utils/airline.mjs +0 -12
- package/dist/utils/animal.d.mts +0 -2
- package/dist/utils/animal.d.ts +0 -2
- package/dist/utils/animal.js +0 -36
- package/dist/utils/animal.mjs +0 -36
- package/dist/utils/color.d.mts +0 -3
- package/dist/utils/color.d.ts +0 -3
- package/dist/utils/color.js +0 -28
- package/dist/utils/color.mjs +0 -28
- package/dist/utils/commerce.d.mts +0 -2
- package/dist/utils/commerce.d.ts +0 -2
- package/dist/utils/commerce.js +0 -22
- package/dist/utils/commerce.mjs +0 -22
- package/dist/utils/common.d.mts +0 -2
- package/dist/utils/common.d.ts +0 -2
- package/dist/utils/common.js +0 -7
- package/dist/utils/common.mjs +0 -7
- package/dist/utils/company.d.mts +0 -2
- package/dist/utils/company.d.ts +0 -2
- package/dist/utils/company.js +0 -24
- package/dist/utils/company.mjs +0 -24
- package/dist/utils/database.d.mts +0 -2
- package/dist/utils/database.d.ts +0 -2
- package/dist/utils/database.js +0 -16
- package/dist/utils/database.mjs +0 -16
- package/dist/utils/datatype.d.mts +0 -2
- package/dist/utils/datatype.d.ts +0 -2
- package/dist/utils/datatype.js +0 -8
- package/dist/utils/datatype.mjs +0 -8
- package/dist/utils/datetime.d.mts +0 -2
- package/dist/utils/datetime.d.ts +0 -2
- package/dist/utils/datetime.js +0 -28
- package/dist/utils/datetime.mjs +0 -28
- package/dist/utils/finance.d.mts +0 -3
- package/dist/utils/finance.d.ts +0 -3
- package/dist/utils/finance.js +0 -44
- package/dist/utils/finance.mjs +0 -44
- package/dist/utils/food.d.mts +0 -2
- package/dist/utils/food.d.ts +0 -2
- package/dist/utils/food.js +0 -24
- package/dist/utils/food.mjs +0 -24
- package/dist/utils/git.d.mts +0 -2
- package/dist/utils/git.d.ts +0 -2
- package/dist/utils/git.js +0 -16
- package/dist/utils/git.mjs +0 -16
- package/dist/utils/hacker.d.mts +0 -2
- package/dist/utils/hacker.d.ts +0 -2
- package/dist/utils/hacker.js +0 -18
- package/dist/utils/hacker.mjs +0 -18
- package/dist/utils/image.d.mts +0 -2
- package/dist/utils/image.d.ts +0 -2
- package/dist/utils/image.js +0 -22
- package/dist/utils/image.mjs +0 -22
- package/dist/utils/index.d.mts +0 -27
- package/dist/utils/index.d.ts +0 -27
- package/dist/utils/index.js +0 -104
- package/dist/utils/index.mjs +0 -104
- package/dist/utils/internet.d.mts +0 -2
- package/dist/utils/internet.d.ts +0 -2
- package/dist/utils/internet.js +0 -46
- package/dist/utils/internet.mjs +0 -46
- package/dist/utils/location.d.mts +0 -2
- package/dist/utils/location.d.ts +0 -2
- package/dist/utils/location.js +0 -38
- package/dist/utils/location.mjs +0 -38
- package/dist/utils/lorem.d.mts +0 -2
- package/dist/utils/lorem.d.ts +0 -2
- package/dist/utils/lorem.js +0 -24
- package/dist/utils/lorem.mjs +0 -24
- package/dist/utils/music.d.mts +0 -2
- package/dist/utils/music.d.ts +0 -2
- package/dist/utils/music.js +0 -14
- package/dist/utils/music.mjs +0 -14
- package/dist/utils/number.d.mts +0 -2
- package/dist/utils/number.d.ts +0 -2
- package/dist/utils/number.js +0 -18
- package/dist/utils/number.mjs +0 -18
- package/dist/utils/person.d.mts +0 -3
- package/dist/utils/person.d.ts +0 -3
- package/dist/utils/person.js +0 -36
- package/dist/utils/person.mjs +0 -36
- package/dist/utils/phone.d.mts +0 -2
- package/dist/utils/phone.d.ts +0 -2
- package/dist/utils/phone.js +0 -10
- package/dist/utils/phone.mjs +0 -10
- package/dist/utils/science.d.mts +0 -3
- package/dist/utils/science.d.ts +0 -3
- package/dist/utils/science.js +0 -10
- package/dist/utils/science.mjs +0 -10
- package/dist/utils/string.d.mts +0 -2
- package/dist/utils/string.d.ts +0 -2
- package/dist/utils/string.js +0 -26
- package/dist/utils/string.mjs +0 -26
- package/dist/utils/system.d.mts +0 -2
- package/dist/utils/system.d.ts +0 -2
- package/dist/utils/system.js +0 -30
- package/dist/utils/system.mjs +0 -30
- package/dist/utils/vehicle.d.mts +0 -2
- package/dist/utils/vehicle.d.ts +0 -2
- package/dist/utils/vehicle.js +0 -24
- package/dist/utils/vehicle.mjs +0 -24
- package/dist/utils/word.d.mts +0 -75
- package/dist/utils/word.d.ts +0 -75
- package/dist/utils/word.js +0 -28
- package/dist/utils/word.mjs +0 -28
- package/dist/vehicle-DmBDda98.d.mts +0 -35
- package/dist/vehicle-rnBz1Za2.d.ts +0 -35
package/dist/git-DoCI9ZYT.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { V as ValueConfig } from './type-C8Ny1fB6.js';
|
|
2
|
-
|
|
3
|
-
/** Git [branch](https://fakerjs.dev/api/git.html#branch) */
|
|
4
|
-
declare const branch: () => ValueConfig<string>;
|
|
5
|
-
/** Git [commitDate](https://fakerjs.dev/api/git.html#commitDate) */
|
|
6
|
-
declare const commitDate: (options?: {
|
|
7
|
-
refDate?: string | Date | number;
|
|
8
|
-
}) => ValueConfig<string>;
|
|
9
|
-
/** Git [commitEntry](https://fakerjs.dev/api/git.html#commitEntry) */
|
|
10
|
-
declare const commitEntry: (options?: {
|
|
11
|
-
merge?: boolean;
|
|
12
|
-
eol?: "LF" | "CRLF";
|
|
13
|
-
refDate?: string | Date | number;
|
|
14
|
-
}) => ValueConfig<string>;
|
|
15
|
-
/** Git [commitMessage](https://fakerjs.dev/api/git.html#commitMessage) */
|
|
16
|
-
declare const commitMessage: () => ValueConfig<string>;
|
|
17
|
-
/** Git [commitSha](https://fakerjs.dev/api/git.html#commitSha) */
|
|
18
|
-
declare const commitSha: (options?: {
|
|
19
|
-
length?: number;
|
|
20
|
-
}) => ValueConfig<string>;
|
|
21
|
-
|
|
22
|
-
declare const git_branch: typeof branch;
|
|
23
|
-
declare const git_commitDate: typeof commitDate;
|
|
24
|
-
declare const git_commitEntry: typeof commitEntry;
|
|
25
|
-
declare const git_commitMessage: typeof commitMessage;
|
|
26
|
-
declare const git_commitSha: typeof commitSha;
|
|
27
|
-
declare namespace git {
|
|
28
|
-
export { git_branch as branch, git_commitDate as commitDate, git_commitEntry as commitEntry, git_commitMessage as commitMessage, git_commitSha as commitSha };
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { commitEntry as a, branch as b, commitDate as c, commitMessage as d, commitSha as e, git as g };
|
package/dist/git-Feo1ntKa.d.mts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { V as ValueConfig } from './type-C8Ny1fB6.mjs';
|
|
2
|
-
|
|
3
|
-
/** Git [branch](https://fakerjs.dev/api/git.html#branch) */
|
|
4
|
-
declare const branch: () => ValueConfig<string>;
|
|
5
|
-
/** Git [commitDate](https://fakerjs.dev/api/git.html#commitDate) */
|
|
6
|
-
declare const commitDate: (options?: {
|
|
7
|
-
refDate?: string | Date | number;
|
|
8
|
-
}) => ValueConfig<string>;
|
|
9
|
-
/** Git [commitEntry](https://fakerjs.dev/api/git.html#commitEntry) */
|
|
10
|
-
declare const commitEntry: (options?: {
|
|
11
|
-
merge?: boolean;
|
|
12
|
-
eol?: "LF" | "CRLF";
|
|
13
|
-
refDate?: string | Date | number;
|
|
14
|
-
}) => ValueConfig<string>;
|
|
15
|
-
/** Git [commitMessage](https://fakerjs.dev/api/git.html#commitMessage) */
|
|
16
|
-
declare const commitMessage: () => ValueConfig<string>;
|
|
17
|
-
/** Git [commitSha](https://fakerjs.dev/api/git.html#commitSha) */
|
|
18
|
-
declare const commitSha: (options?: {
|
|
19
|
-
length?: number;
|
|
20
|
-
}) => ValueConfig<string>;
|
|
21
|
-
|
|
22
|
-
declare const git_branch: typeof branch;
|
|
23
|
-
declare const git_commitDate: typeof commitDate;
|
|
24
|
-
declare const git_commitEntry: typeof commitEntry;
|
|
25
|
-
declare const git_commitMessage: typeof commitMessage;
|
|
26
|
-
declare const git_commitSha: typeof commitSha;
|
|
27
|
-
declare namespace git {
|
|
28
|
-
export { git_branch as branch, git_commitDate as commitDate, git_commitEntry as commitEntry, git_commitMessage as commitMessage, git_commitSha as commitSha };
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { commitEntry as a, branch as b, commitDate as c, commitMessage as d, commitSha as e, git as g };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { V as ValueConfig } from './type-C8Ny1fB6.js';
|
|
2
|
-
|
|
3
|
-
/** Hacker [abbreviation](https://fakerjs.dev/api/hacker.html#abbreviation) */
|
|
4
|
-
declare const abbreviation: () => ValueConfig<string>;
|
|
5
|
-
/** Hacker [adjective](https://fakerjs.dev/api/hacker.html#adjective) */
|
|
6
|
-
declare const adjective: () => ValueConfig<string>;
|
|
7
|
-
/** Hacker [ingverb](https://fakerjs.dev/api/hacker.html#ingverb) */
|
|
8
|
-
declare const ingverb: () => ValueConfig<string>;
|
|
9
|
-
/** Hacker [noun](https://fakerjs.dev/api/hacker.html#noun) */
|
|
10
|
-
declare const noun: () => ValueConfig<string>;
|
|
11
|
-
/** Hacker [phrase](https://fakerjs.dev/api/hacker.html#phrase) */
|
|
12
|
-
declare const phrase: () => ValueConfig<string>;
|
|
13
|
-
/** Hacker [verb](https://fakerjs.dev/api/hacker.html#verb) */
|
|
14
|
-
declare const verb: () => ValueConfig<string>;
|
|
15
|
-
|
|
16
|
-
declare const hacker_abbreviation: typeof abbreviation;
|
|
17
|
-
declare const hacker_adjective: typeof adjective;
|
|
18
|
-
declare const hacker_ingverb: typeof ingverb;
|
|
19
|
-
declare const hacker_noun: typeof noun;
|
|
20
|
-
declare const hacker_phrase: typeof phrase;
|
|
21
|
-
declare const hacker_verb: typeof verb;
|
|
22
|
-
declare namespace hacker {
|
|
23
|
-
export { hacker_abbreviation as abbreviation, hacker_adjective as adjective, hacker_ingverb as ingverb, hacker_noun as noun, hacker_phrase as phrase, hacker_verb as verb };
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { abbreviation as a, adjective as b, hacker as h, ingverb as i, noun as n, phrase as p, verb as v };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { V as ValueConfig } from './type-C8Ny1fB6.mjs';
|
|
2
|
-
|
|
3
|
-
/** Hacker [abbreviation](https://fakerjs.dev/api/hacker.html#abbreviation) */
|
|
4
|
-
declare const abbreviation: () => ValueConfig<string>;
|
|
5
|
-
/** Hacker [adjective](https://fakerjs.dev/api/hacker.html#adjective) */
|
|
6
|
-
declare const adjective: () => ValueConfig<string>;
|
|
7
|
-
/** Hacker [ingverb](https://fakerjs.dev/api/hacker.html#ingverb) */
|
|
8
|
-
declare const ingverb: () => ValueConfig<string>;
|
|
9
|
-
/** Hacker [noun](https://fakerjs.dev/api/hacker.html#noun) */
|
|
10
|
-
declare const noun: () => ValueConfig<string>;
|
|
11
|
-
/** Hacker [phrase](https://fakerjs.dev/api/hacker.html#phrase) */
|
|
12
|
-
declare const phrase: () => ValueConfig<string>;
|
|
13
|
-
/** Hacker [verb](https://fakerjs.dev/api/hacker.html#verb) */
|
|
14
|
-
declare const verb: () => ValueConfig<string>;
|
|
15
|
-
|
|
16
|
-
declare const hacker_abbreviation: typeof abbreviation;
|
|
17
|
-
declare const hacker_adjective: typeof adjective;
|
|
18
|
-
declare const hacker_ingverb: typeof ingverb;
|
|
19
|
-
declare const hacker_noun: typeof noun;
|
|
20
|
-
declare const hacker_phrase: typeof phrase;
|
|
21
|
-
declare const hacker_verb: typeof verb;
|
|
22
|
-
declare namespace hacker {
|
|
23
|
-
export { hacker_abbreviation as abbreviation, hacker_adjective as adjective, hacker_ingverb as ingverb, hacker_noun as noun, hacker_phrase as phrase, hacker_verb as verb };
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { abbreviation as a, adjective as b, hacker as h, ingverb as i, noun as n, phrase as p, verb as v };
|
package/dist/image-BeZbZlyo.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { V as ValueConfig } from './type-C8Ny1fB6.js';
|
|
2
|
-
|
|
3
|
-
/** Image [avatar](https://fakerjs.dev/api/image.html#avatar) */
|
|
4
|
-
declare const avatar: () => ValueConfig<string>;
|
|
5
|
-
/** Image [avatarGitHub](https://fakerjs.dev/api/image.html#avatarGitHub) */
|
|
6
|
-
declare const avatarGitHub: () => ValueConfig<string>;
|
|
7
|
-
/** Image [avatarLegacy](https://fakerjs.dev/api/image.html#avatarLegacy) */
|
|
8
|
-
declare const avatarLegacy: () => ValueConfig<string>;
|
|
9
|
-
/** Image [dataUri](https://fakerjs.dev/api/image.html#dataUri) */
|
|
10
|
-
declare const dataUri: (options?: {
|
|
11
|
-
width?: number;
|
|
12
|
-
height?: number;
|
|
13
|
-
color?: string;
|
|
14
|
-
type?: "svg-uri" | "svg-base64";
|
|
15
|
-
}) => ValueConfig<string>;
|
|
16
|
-
/** Image [url](https://fakerjs.dev/api/image.html#url) */
|
|
17
|
-
declare const url: (options?: {
|
|
18
|
-
width?: number;
|
|
19
|
-
height?: number;
|
|
20
|
-
}) => ValueConfig<string>;
|
|
21
|
-
/** Image [urlLoremFlickr](https://fakerjs.dev/api/image.html#urlLoremFlickr) */
|
|
22
|
-
declare const urlLoremFlickr: (options?: {
|
|
23
|
-
width?: number;
|
|
24
|
-
height?: number;
|
|
25
|
-
category?: string;
|
|
26
|
-
}) => ValueConfig<string>;
|
|
27
|
-
/** Image [urlPicsumPhotos](https://fakerjs.dev/api/image.html#urlPicsumPhotos) */
|
|
28
|
-
declare const urlPicsumPhotos: (options?: {
|
|
29
|
-
width?: number;
|
|
30
|
-
height?: number;
|
|
31
|
-
grayscale?: boolean;
|
|
32
|
-
blur?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
|
33
|
-
}) => ValueConfig<string>;
|
|
34
|
-
/** Image [urlPlaceholder](https://fakerjs.dev/api/image.html#urlPlaceholder) */
|
|
35
|
-
declare const urlPlaceholder: (options?: {
|
|
36
|
-
width?: number;
|
|
37
|
-
height?: number;
|
|
38
|
-
backgroundColor?: string;
|
|
39
|
-
textColor?: string;
|
|
40
|
-
format?: "gif" | "jpeg" | "jpg" | "png" | "webp";
|
|
41
|
-
text?: string;
|
|
42
|
-
}) => ValueConfig<string>;
|
|
43
|
-
|
|
44
|
-
declare const image_avatar: typeof avatar;
|
|
45
|
-
declare const image_avatarGitHub: typeof avatarGitHub;
|
|
46
|
-
declare const image_avatarLegacy: typeof avatarLegacy;
|
|
47
|
-
declare const image_dataUri: typeof dataUri;
|
|
48
|
-
declare const image_url: typeof url;
|
|
49
|
-
declare const image_urlLoremFlickr: typeof urlLoremFlickr;
|
|
50
|
-
declare const image_urlPicsumPhotos: typeof urlPicsumPhotos;
|
|
51
|
-
declare const image_urlPlaceholder: typeof urlPlaceholder;
|
|
52
|
-
declare namespace image {
|
|
53
|
-
export { image_avatar as avatar, image_avatarGitHub as avatarGitHub, image_avatarLegacy as avatarLegacy, image_dataUri as dataUri, image_url as url, image_urlLoremFlickr as urlLoremFlickr, image_urlPicsumPhotos as urlPicsumPhotos, image_urlPlaceholder as urlPlaceholder };
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { avatar as a, avatarGitHub as b, avatarLegacy as c, dataUri as d, urlLoremFlickr as e, urlPicsumPhotos as f, urlPlaceholder as g, image as i, url as u };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { V as ValueConfig } from './type-C8Ny1fB6.mjs';
|
|
2
|
-
|
|
3
|
-
/** Image [avatar](https://fakerjs.dev/api/image.html#avatar) */
|
|
4
|
-
declare const avatar: () => ValueConfig<string>;
|
|
5
|
-
/** Image [avatarGitHub](https://fakerjs.dev/api/image.html#avatarGitHub) */
|
|
6
|
-
declare const avatarGitHub: () => ValueConfig<string>;
|
|
7
|
-
/** Image [avatarLegacy](https://fakerjs.dev/api/image.html#avatarLegacy) */
|
|
8
|
-
declare const avatarLegacy: () => ValueConfig<string>;
|
|
9
|
-
/** Image [dataUri](https://fakerjs.dev/api/image.html#dataUri) */
|
|
10
|
-
declare const dataUri: (options?: {
|
|
11
|
-
width?: number;
|
|
12
|
-
height?: number;
|
|
13
|
-
color?: string;
|
|
14
|
-
type?: "svg-uri" | "svg-base64";
|
|
15
|
-
}) => ValueConfig<string>;
|
|
16
|
-
/** Image [url](https://fakerjs.dev/api/image.html#url) */
|
|
17
|
-
declare const url: (options?: {
|
|
18
|
-
width?: number;
|
|
19
|
-
height?: number;
|
|
20
|
-
}) => ValueConfig<string>;
|
|
21
|
-
/** Image [urlLoremFlickr](https://fakerjs.dev/api/image.html#urlLoremFlickr) */
|
|
22
|
-
declare const urlLoremFlickr: (options?: {
|
|
23
|
-
width?: number;
|
|
24
|
-
height?: number;
|
|
25
|
-
category?: string;
|
|
26
|
-
}) => ValueConfig<string>;
|
|
27
|
-
/** Image [urlPicsumPhotos](https://fakerjs.dev/api/image.html#urlPicsumPhotos) */
|
|
28
|
-
declare const urlPicsumPhotos: (options?: {
|
|
29
|
-
width?: number;
|
|
30
|
-
height?: number;
|
|
31
|
-
grayscale?: boolean;
|
|
32
|
-
blur?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
|
33
|
-
}) => ValueConfig<string>;
|
|
34
|
-
/** Image [urlPlaceholder](https://fakerjs.dev/api/image.html#urlPlaceholder) */
|
|
35
|
-
declare const urlPlaceholder: (options?: {
|
|
36
|
-
width?: number;
|
|
37
|
-
height?: number;
|
|
38
|
-
backgroundColor?: string;
|
|
39
|
-
textColor?: string;
|
|
40
|
-
format?: "gif" | "jpeg" | "jpg" | "png" | "webp";
|
|
41
|
-
text?: string;
|
|
42
|
-
}) => ValueConfig<string>;
|
|
43
|
-
|
|
44
|
-
declare const image_avatar: typeof avatar;
|
|
45
|
-
declare const image_avatarGitHub: typeof avatarGitHub;
|
|
46
|
-
declare const image_avatarLegacy: typeof avatarLegacy;
|
|
47
|
-
declare const image_dataUri: typeof dataUri;
|
|
48
|
-
declare const image_url: typeof url;
|
|
49
|
-
declare const image_urlLoremFlickr: typeof urlLoremFlickr;
|
|
50
|
-
declare const image_urlPicsumPhotos: typeof urlPicsumPhotos;
|
|
51
|
-
declare const image_urlPlaceholder: typeof urlPlaceholder;
|
|
52
|
-
declare namespace image {
|
|
53
|
-
export { image_avatar as avatar, image_avatarGitHub as avatarGitHub, image_avatarLegacy as avatarLegacy, image_dataUri as dataUri, image_url as url, image_urlLoremFlickr as urlLoremFlickr, image_urlPicsumPhotos as urlPicsumPhotos, image_urlPlaceholder as urlPlaceholder };
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { avatar as a, avatarGitHub as b, avatarLegacy as c, dataUri as d, urlLoremFlickr as e, urlPicsumPhotos as f, urlPlaceholder as g, image as i, url as u };
|
package/dist/index.d.mts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { V as ValueConfig, S as SelectionConfig, O as ObjectConfig, A as ArrayConfig, B as BoundedSeriesConfig, T as TupleConfig, R as Result } from './type-C8Ny1fB6.mjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* value
|
|
5
|
-
* @param {function} generateFn - The function used to generate the value.
|
|
6
|
-
* @return {ValueConfig} The configuration object with the type "value" and the provided generate function.
|
|
7
|
-
*/
|
|
8
|
-
declare const createValueConfig: <T>(generateFn: () => T) => ValueConfig<T>;
|
|
9
|
-
/**
|
|
10
|
-
* selection
|
|
11
|
-
* @param {Array} items - The array of items to choose from.
|
|
12
|
-
* @return {SelectionConfig} The configuration object with the type "select" and the provided items.
|
|
13
|
-
*/
|
|
14
|
-
declare const createSelectionConfig: <T>(items: T[]) => SelectionConfig<T>;
|
|
15
|
-
/**
|
|
16
|
-
* object
|
|
17
|
-
* @param {object} content
|
|
18
|
-
* @return {ObjectConfig}
|
|
19
|
-
*/
|
|
20
|
-
declare const createObjectConfig: <T extends object>(content: T) => ObjectConfig<T>;
|
|
21
|
-
/**
|
|
22
|
-
* array
|
|
23
|
-
* @param {object} item
|
|
24
|
-
* @param {number} len
|
|
25
|
-
* @return {ArrayConfig}
|
|
26
|
-
*/
|
|
27
|
-
declare const createArrayConfig: <T>(item: T, len: number) => ArrayConfig<T>;
|
|
28
|
-
/**
|
|
29
|
-
* tuple
|
|
30
|
-
* @param {Array} configItems
|
|
31
|
-
* @return {TupleConfig}
|
|
32
|
-
*/
|
|
33
|
-
interface CreateTupleConfig {
|
|
34
|
-
<A, B, C, D, E>(configItems: [A, B, C, D, E]): TupleConfig<A, B, C, D, E>;
|
|
35
|
-
<A, B, C, D>(configItems: [A, B, C, D]): TupleConfig<A, B, C, D>;
|
|
36
|
-
<A, B, C>(configItems: [A, B, C]): TupleConfig<A, B, C>;
|
|
37
|
-
<A, B>(configItems: [A, B]): TupleConfig<A, B>;
|
|
38
|
-
<A>(configItems: [A]): TupleConfig<A>;
|
|
39
|
-
}
|
|
40
|
-
declare const createTupleConfig: CreateTupleConfig;
|
|
41
|
-
/**
|
|
42
|
-
* bounded series
|
|
43
|
-
* @param {{ upperLimit: number, lowerLimit: number, createInitValue: () => number, count: number }} config
|
|
44
|
-
* @return {BoundedSeriesConfig}
|
|
45
|
-
*/
|
|
46
|
-
declare const createBoundedSeriesConfig: (config: Omit<BoundedSeriesConfig, "type">) => BoundedSeriesConfig;
|
|
47
|
-
|
|
48
|
-
type AllConfig<T> = ValueConfig<T> | SelectionConfig<T> | ArrayConfig<T> | ObjectConfig<T> | TupleConfig<T> | TupleConfig<T, T> | TupleConfig<T, T, T> | TupleConfig<T, T, T, T> | TupleConfig<T, T, T, T, T> | BoundedSeriesConfig;
|
|
49
|
-
declare const createValueGenerator: <R = unknown>(config: ValueConfig<unknown>) => (() => R);
|
|
50
|
-
declare const createSelectionGenerator: <T extends SelectionConfig<unknown>>(config: T) => (() => Result<T>);
|
|
51
|
-
declare const createObjectGenerator: <T extends ObjectConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
52
|
-
declare const createArrayGenerator: <T extends ArrayConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
53
|
-
declare const createTupleGenerator: <T extends TupleConfig<unknown, unknown, unknown, unknown, unknown> | TupleConfig<unknown, unknown, unknown, unknown> | TupleConfig<unknown, unknown, unknown> | TupleConfig<unknown, unknown> | TupleConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
54
|
-
declare const createBoundedSeriesGenerator: <T extends BoundedSeriesConfig>(config: T) => (() => Result<T>);
|
|
55
|
-
declare const createGeneratorByType: <T extends AllConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
56
|
-
|
|
57
|
-
export { ArrayConfig, BoundedSeriesConfig, ObjectConfig, Result, SelectionConfig, TupleConfig, ValueConfig, createArrayConfig, createArrayGenerator, createBoundedSeriesConfig, createBoundedSeriesGenerator, createGeneratorByType, createObjectConfig, createObjectGenerator, createSelectionConfig, createSelectionGenerator, createTupleConfig, createTupleGenerator, createValueConfig, createValueGenerator };
|
package/dist/index.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { V as ValueConfig, S as SelectionConfig, O as ObjectConfig, A as ArrayConfig, B as BoundedSeriesConfig, T as TupleConfig, R as Result } from './type-C8Ny1fB6.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* value
|
|
5
|
-
* @param {function} generateFn - The function used to generate the value.
|
|
6
|
-
* @return {ValueConfig} The configuration object with the type "value" and the provided generate function.
|
|
7
|
-
*/
|
|
8
|
-
declare const createValueConfig: <T>(generateFn: () => T) => ValueConfig<T>;
|
|
9
|
-
/**
|
|
10
|
-
* selection
|
|
11
|
-
* @param {Array} items - The array of items to choose from.
|
|
12
|
-
* @return {SelectionConfig} The configuration object with the type "select" and the provided items.
|
|
13
|
-
*/
|
|
14
|
-
declare const createSelectionConfig: <T>(items: T[]) => SelectionConfig<T>;
|
|
15
|
-
/**
|
|
16
|
-
* object
|
|
17
|
-
* @param {object} content
|
|
18
|
-
* @return {ObjectConfig}
|
|
19
|
-
*/
|
|
20
|
-
declare const createObjectConfig: <T extends object>(content: T) => ObjectConfig<T>;
|
|
21
|
-
/**
|
|
22
|
-
* array
|
|
23
|
-
* @param {object} item
|
|
24
|
-
* @param {number} len
|
|
25
|
-
* @return {ArrayConfig}
|
|
26
|
-
*/
|
|
27
|
-
declare const createArrayConfig: <T>(item: T, len: number) => ArrayConfig<T>;
|
|
28
|
-
/**
|
|
29
|
-
* tuple
|
|
30
|
-
* @param {Array} configItems
|
|
31
|
-
* @return {TupleConfig}
|
|
32
|
-
*/
|
|
33
|
-
interface CreateTupleConfig {
|
|
34
|
-
<A, B, C, D, E>(configItems: [A, B, C, D, E]): TupleConfig<A, B, C, D, E>;
|
|
35
|
-
<A, B, C, D>(configItems: [A, B, C, D]): TupleConfig<A, B, C, D>;
|
|
36
|
-
<A, B, C>(configItems: [A, B, C]): TupleConfig<A, B, C>;
|
|
37
|
-
<A, B>(configItems: [A, B]): TupleConfig<A, B>;
|
|
38
|
-
<A>(configItems: [A]): TupleConfig<A>;
|
|
39
|
-
}
|
|
40
|
-
declare const createTupleConfig: CreateTupleConfig;
|
|
41
|
-
/**
|
|
42
|
-
* bounded series
|
|
43
|
-
* @param {{ upperLimit: number, lowerLimit: number, createInitValue: () => number, count: number }} config
|
|
44
|
-
* @return {BoundedSeriesConfig}
|
|
45
|
-
*/
|
|
46
|
-
declare const createBoundedSeriesConfig: (config: Omit<BoundedSeriesConfig, "type">) => BoundedSeriesConfig;
|
|
47
|
-
|
|
48
|
-
type AllConfig<T> = ValueConfig<T> | SelectionConfig<T> | ArrayConfig<T> | ObjectConfig<T> | TupleConfig<T> | TupleConfig<T, T> | TupleConfig<T, T, T> | TupleConfig<T, T, T, T> | TupleConfig<T, T, T, T, T> | BoundedSeriesConfig;
|
|
49
|
-
declare const createValueGenerator: <R = unknown>(config: ValueConfig<unknown>) => (() => R);
|
|
50
|
-
declare const createSelectionGenerator: <T extends SelectionConfig<unknown>>(config: T) => (() => Result<T>);
|
|
51
|
-
declare const createObjectGenerator: <T extends ObjectConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
52
|
-
declare const createArrayGenerator: <T extends ArrayConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
53
|
-
declare const createTupleGenerator: <T extends TupleConfig<unknown, unknown, unknown, unknown, unknown> | TupleConfig<unknown, unknown, unknown, unknown> | TupleConfig<unknown, unknown, unknown> | TupleConfig<unknown, unknown> | TupleConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
54
|
-
declare const createBoundedSeriesGenerator: <T extends BoundedSeriesConfig>(config: T) => (() => Result<T>);
|
|
55
|
-
declare const createGeneratorByType: <T extends AllConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
56
|
-
|
|
57
|
-
export { ArrayConfig, BoundedSeriesConfig, ObjectConfig, Result, SelectionConfig, TupleConfig, ValueConfig, createArrayConfig, createArrayGenerator, createBoundedSeriesConfig, createBoundedSeriesGenerator, createGeneratorByType, createObjectConfig, createObjectGenerator, createSelectionConfig, createSelectionGenerator, createTupleConfig, createTupleGenerator, createValueConfig, createValueGenerator };
|
package/dist/index.js
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
-
|
|
3
|
-
var _chunk4UGSTE5Qjs = require('./chunk-4UGSTE5Q.js');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var _chunk3HQMGDUFjs = require('./chunk-3HQMGDUF.js');
|
|
18
|
-
|
|
19
|
-
// src/create_generator_fn.ts
|
|
20
|
-
var _createValueGenerator = (config, path) => {
|
|
21
|
-
try {
|
|
22
|
-
_chunk3HQMGDUFjs.valueConfigScheme.parse(config);
|
|
23
|
-
} catch (err) {
|
|
24
|
-
throw new Error(`config path: ${path}.value
|
|
25
|
-
${err}`);
|
|
26
|
-
}
|
|
27
|
-
return config.generateFn;
|
|
28
|
-
};
|
|
29
|
-
var createValueGenerator = (config) => _createValueGenerator(config, "*");
|
|
30
|
-
var _createSelectionGenerator = (config, path) => {
|
|
31
|
-
try {
|
|
32
|
-
_chunk3HQMGDUFjs.selectionConfigScheme.parse(config);
|
|
33
|
-
} catch (err) {
|
|
34
|
-
throw new Error(`config path: ${path}.select
|
|
35
|
-
${err}`);
|
|
36
|
-
}
|
|
37
|
-
const { items } = config;
|
|
38
|
-
return () => items[_chunk4UGSTE5Qjs.f.number.int(items.length - 1)];
|
|
39
|
-
};
|
|
40
|
-
var createSelectionGenerator = (config) => _createSelectionGenerator(config, "*");
|
|
41
|
-
var _createObjectGenerator = (config, path, customTypeMatch) => {
|
|
42
|
-
try {
|
|
43
|
-
_chunk3HQMGDUFjs.objConfigScheme.parse(config);
|
|
44
|
-
} catch (err) {
|
|
45
|
-
throw new Error(`config path: ${path}.obj
|
|
46
|
-
${err}`);
|
|
47
|
-
}
|
|
48
|
-
const keyWithFns = Object.entries(config.content).map(([key, subConfig]) => [
|
|
49
|
-
key,
|
|
50
|
-
_createGeneratorByType(subConfig, `${path}.obj[${key}]`, customTypeMatch)
|
|
51
|
-
]);
|
|
52
|
-
return () => {
|
|
53
|
-
const result = {};
|
|
54
|
-
for (const [key, generateFn] of keyWithFns) {
|
|
55
|
-
result[key] = generateFn();
|
|
56
|
-
}
|
|
57
|
-
return result;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
var createObjectGenerator = (config, customTypeMatch) => _createObjectGenerator(config, "*", customTypeMatch);
|
|
61
|
-
var _createArrayGenerator = (config, path, customTypeMatch) => {
|
|
62
|
-
try {
|
|
63
|
-
_chunk3HQMGDUFjs.arrayConfigScheme.parse(config);
|
|
64
|
-
} catch (err) {
|
|
65
|
-
throw new Error(`config path: ${path}.arr
|
|
66
|
-
${err}`);
|
|
67
|
-
}
|
|
68
|
-
const itemGeneratorFn = _createGeneratorByType(
|
|
69
|
-
config.item,
|
|
70
|
-
`${path}.arr`,
|
|
71
|
-
customTypeMatch
|
|
72
|
-
);
|
|
73
|
-
return () => Array.from({ length: _nullishCoalesce(config.len, () => ( 0)) }, itemGeneratorFn);
|
|
74
|
-
};
|
|
75
|
-
var createArrayGenerator = (config, customTypeMatch) => _createArrayGenerator(config, "*", customTypeMatch);
|
|
76
|
-
var _createTupleGenerator = (config, path, customTypeMatch) => {
|
|
77
|
-
try {
|
|
78
|
-
_chunk3HQMGDUFjs.tupleConfigScheme.parse(config);
|
|
79
|
-
} catch (err) {
|
|
80
|
-
throw new Error(`config path: ${path}.tuple
|
|
81
|
-
${err}`);
|
|
82
|
-
}
|
|
83
|
-
const itemsFns = config.configItems.map(
|
|
84
|
-
(configItem, index) => _createGeneratorByType(
|
|
85
|
-
configItem,
|
|
86
|
-
`${path}.tuple[${index}]`,
|
|
87
|
-
customTypeMatch
|
|
88
|
-
)
|
|
89
|
-
);
|
|
90
|
-
return () => itemsFns.map((generateFn) => generateFn());
|
|
91
|
-
};
|
|
92
|
-
var createTupleGenerator = (config, customTypeMatch) => _createTupleGenerator(config, "*", customTypeMatch);
|
|
93
|
-
var _createBoundedSeriesGenerator = (config, path) => {
|
|
94
|
-
try {
|
|
95
|
-
_chunk3HQMGDUFjs.boundedSeriesScheme.parse(config);
|
|
96
|
-
} catch (err) {
|
|
97
|
-
throw new Error(`config path: ${path}.boundedSeries
|
|
98
|
-
${err}`);
|
|
99
|
-
}
|
|
100
|
-
const { upperLimit, lowerLimit, createInitValue, count } = config;
|
|
101
|
-
return () => {
|
|
102
|
-
let value = createInitValue();
|
|
103
|
-
const boundedSeries = [];
|
|
104
|
-
for (let i = 0; i < count; i++) {
|
|
105
|
-
value = _chunk4UGSTE5Qjs.f.number.float({ max: upperLimit, min: lowerLimit }) * value;
|
|
106
|
-
boundedSeries.push(value);
|
|
107
|
-
}
|
|
108
|
-
return boundedSeries;
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
var createBoundedSeriesGenerator = (config) => _createBoundedSeriesGenerator(config, "*");
|
|
112
|
-
var _createGeneratorByType = (config, path, customTypeMatch) => {
|
|
113
|
-
switch (config.type) {
|
|
114
|
-
case "obj":
|
|
115
|
-
return _createObjectGenerator(
|
|
116
|
-
config,
|
|
117
|
-
path,
|
|
118
|
-
customTypeMatch
|
|
119
|
-
);
|
|
120
|
-
case "arr":
|
|
121
|
-
return _createArrayGenerator(
|
|
122
|
-
config,
|
|
123
|
-
path,
|
|
124
|
-
customTypeMatch
|
|
125
|
-
);
|
|
126
|
-
case "tuple":
|
|
127
|
-
return _createTupleGenerator(
|
|
128
|
-
config,
|
|
129
|
-
path,
|
|
130
|
-
customTypeMatch
|
|
131
|
-
);
|
|
132
|
-
case "select":
|
|
133
|
-
return _createSelectionGenerator(config, path);
|
|
134
|
-
case "value":
|
|
135
|
-
return _createValueGenerator(config, path);
|
|
136
|
-
case "bounded_series":
|
|
137
|
-
return _createBoundedSeriesGenerator(config, path);
|
|
138
|
-
default: {
|
|
139
|
-
if (customTypeMatch) {
|
|
140
|
-
return createValueGenerator(customTypeMatch(config, path));
|
|
141
|
-
}
|
|
142
|
-
throw new Error(`path: ${path}
|
|
143
|
-
config type is not supported`);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
var createGeneratorByType = (config, customTypeMatch) => _createGeneratorByType(config, "*", customTypeMatch);
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
exports.createArrayConfig = _chunk3HQMGDUFjs.createArrayConfig; exports.createArrayGenerator = createArrayGenerator; exports.createBoundedSeriesConfig = _chunk3HQMGDUFjs.createBoundedSeriesConfig; exports.createBoundedSeriesGenerator = createBoundedSeriesGenerator; exports.createGeneratorByType = createGeneratorByType; exports.createObjectConfig = _chunk3HQMGDUFjs.createObjectConfig; exports.createObjectGenerator = createObjectGenerator; exports.createSelectionConfig = _chunk3HQMGDUFjs.createSelectionConfig; exports.createSelectionGenerator = createSelectionGenerator; exports.createTupleConfig = _chunk3HQMGDUFjs.createTupleConfig; exports.createTupleGenerator = createTupleGenerator; exports.createValueConfig = _chunk3HQMGDUFjs.createValueConfig; exports.createValueGenerator = createValueGenerator;
|
package/dist/index.mjs
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
f
|
|
3
|
-
} from "./chunk-BS7IEV74.mjs";
|
|
4
|
-
import {
|
|
5
|
-
arrayConfigScheme,
|
|
6
|
-
boundedSeriesScheme,
|
|
7
|
-
createArrayConfig,
|
|
8
|
-
createBoundedSeriesConfig,
|
|
9
|
-
createObjectConfig,
|
|
10
|
-
createSelectionConfig,
|
|
11
|
-
createTupleConfig,
|
|
12
|
-
createValueConfig,
|
|
13
|
-
objConfigScheme,
|
|
14
|
-
selectionConfigScheme,
|
|
15
|
-
tupleConfigScheme,
|
|
16
|
-
valueConfigScheme
|
|
17
|
-
} from "./chunk-OLSCXZ3D.mjs";
|
|
18
|
-
|
|
19
|
-
// src/create_generator_fn.ts
|
|
20
|
-
var _createValueGenerator = (config, path) => {
|
|
21
|
-
try {
|
|
22
|
-
valueConfigScheme.parse(config);
|
|
23
|
-
} catch (err) {
|
|
24
|
-
throw new Error(`config path: ${path}.value
|
|
25
|
-
${err}`);
|
|
26
|
-
}
|
|
27
|
-
return config.generateFn;
|
|
28
|
-
};
|
|
29
|
-
var createValueGenerator = (config) => _createValueGenerator(config, "*");
|
|
30
|
-
var _createSelectionGenerator = (config, path) => {
|
|
31
|
-
try {
|
|
32
|
-
selectionConfigScheme.parse(config);
|
|
33
|
-
} catch (err) {
|
|
34
|
-
throw new Error(`config path: ${path}.select
|
|
35
|
-
${err}`);
|
|
36
|
-
}
|
|
37
|
-
const { items } = config;
|
|
38
|
-
return () => items[f.number.int(items.length - 1)];
|
|
39
|
-
};
|
|
40
|
-
var createSelectionGenerator = (config) => _createSelectionGenerator(config, "*");
|
|
41
|
-
var _createObjectGenerator = (config, path, customTypeMatch) => {
|
|
42
|
-
try {
|
|
43
|
-
objConfigScheme.parse(config);
|
|
44
|
-
} catch (err) {
|
|
45
|
-
throw new Error(`config path: ${path}.obj
|
|
46
|
-
${err}`);
|
|
47
|
-
}
|
|
48
|
-
const keyWithFns = Object.entries(config.content).map(([key, subConfig]) => [
|
|
49
|
-
key,
|
|
50
|
-
_createGeneratorByType(subConfig, `${path}.obj[${key}]`, customTypeMatch)
|
|
51
|
-
]);
|
|
52
|
-
return () => {
|
|
53
|
-
const result = {};
|
|
54
|
-
for (const [key, generateFn] of keyWithFns) {
|
|
55
|
-
result[key] = generateFn();
|
|
56
|
-
}
|
|
57
|
-
return result;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
var createObjectGenerator = (config, customTypeMatch) => _createObjectGenerator(config, "*", customTypeMatch);
|
|
61
|
-
var _createArrayGenerator = (config, path, customTypeMatch) => {
|
|
62
|
-
try {
|
|
63
|
-
arrayConfigScheme.parse(config);
|
|
64
|
-
} catch (err) {
|
|
65
|
-
throw new Error(`config path: ${path}.arr
|
|
66
|
-
${err}`);
|
|
67
|
-
}
|
|
68
|
-
const itemGeneratorFn = _createGeneratorByType(
|
|
69
|
-
config.item,
|
|
70
|
-
`${path}.arr`,
|
|
71
|
-
customTypeMatch
|
|
72
|
-
);
|
|
73
|
-
return () => Array.from({ length: config.len ?? 0 }, itemGeneratorFn);
|
|
74
|
-
};
|
|
75
|
-
var createArrayGenerator = (config, customTypeMatch) => _createArrayGenerator(config, "*", customTypeMatch);
|
|
76
|
-
var _createTupleGenerator = (config, path, customTypeMatch) => {
|
|
77
|
-
try {
|
|
78
|
-
tupleConfigScheme.parse(config);
|
|
79
|
-
} catch (err) {
|
|
80
|
-
throw new Error(`config path: ${path}.tuple
|
|
81
|
-
${err}`);
|
|
82
|
-
}
|
|
83
|
-
const itemsFns = config.configItems.map(
|
|
84
|
-
(configItem, index) => _createGeneratorByType(
|
|
85
|
-
configItem,
|
|
86
|
-
`${path}.tuple[${index}]`,
|
|
87
|
-
customTypeMatch
|
|
88
|
-
)
|
|
89
|
-
);
|
|
90
|
-
return () => itemsFns.map((generateFn) => generateFn());
|
|
91
|
-
};
|
|
92
|
-
var createTupleGenerator = (config, customTypeMatch) => _createTupleGenerator(config, "*", customTypeMatch);
|
|
93
|
-
var _createBoundedSeriesGenerator = (config, path) => {
|
|
94
|
-
try {
|
|
95
|
-
boundedSeriesScheme.parse(config);
|
|
96
|
-
} catch (err) {
|
|
97
|
-
throw new Error(`config path: ${path}.boundedSeries
|
|
98
|
-
${err}`);
|
|
99
|
-
}
|
|
100
|
-
const { upperLimit, lowerLimit, createInitValue, count } = config;
|
|
101
|
-
return () => {
|
|
102
|
-
let value = createInitValue();
|
|
103
|
-
const boundedSeries = [];
|
|
104
|
-
for (let i = 0; i < count; i++) {
|
|
105
|
-
value = f.number.float({ max: upperLimit, min: lowerLimit }) * value;
|
|
106
|
-
boundedSeries.push(value);
|
|
107
|
-
}
|
|
108
|
-
return boundedSeries;
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
var createBoundedSeriesGenerator = (config) => _createBoundedSeriesGenerator(config, "*");
|
|
112
|
-
var _createGeneratorByType = (config, path, customTypeMatch) => {
|
|
113
|
-
switch (config.type) {
|
|
114
|
-
case "obj":
|
|
115
|
-
return _createObjectGenerator(
|
|
116
|
-
config,
|
|
117
|
-
path,
|
|
118
|
-
customTypeMatch
|
|
119
|
-
);
|
|
120
|
-
case "arr":
|
|
121
|
-
return _createArrayGenerator(
|
|
122
|
-
config,
|
|
123
|
-
path,
|
|
124
|
-
customTypeMatch
|
|
125
|
-
);
|
|
126
|
-
case "tuple":
|
|
127
|
-
return _createTupleGenerator(
|
|
128
|
-
config,
|
|
129
|
-
path,
|
|
130
|
-
customTypeMatch
|
|
131
|
-
);
|
|
132
|
-
case "select":
|
|
133
|
-
return _createSelectionGenerator(config, path);
|
|
134
|
-
case "value":
|
|
135
|
-
return _createValueGenerator(config, path);
|
|
136
|
-
case "bounded_series":
|
|
137
|
-
return _createBoundedSeriesGenerator(config, path);
|
|
138
|
-
default: {
|
|
139
|
-
if (customTypeMatch) {
|
|
140
|
-
return createValueGenerator(customTypeMatch(config, path));
|
|
141
|
-
}
|
|
142
|
-
throw new Error(`path: ${path}
|
|
143
|
-
config type is not supported`);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
var createGeneratorByType = (config, customTypeMatch) => _createGeneratorByType(config, "*", customTypeMatch);
|
|
148
|
-
export {
|
|
149
|
-
createArrayConfig,
|
|
150
|
-
createArrayGenerator,
|
|
151
|
-
createBoundedSeriesConfig,
|
|
152
|
-
createBoundedSeriesGenerator,
|
|
153
|
-
createGeneratorByType,
|
|
154
|
-
createObjectConfig,
|
|
155
|
-
createObjectGenerator,
|
|
156
|
-
createSelectionConfig,
|
|
157
|
-
createSelectionGenerator,
|
|
158
|
-
createTupleConfig,
|
|
159
|
-
createTupleGenerator,
|
|
160
|
-
createValueConfig,
|
|
161
|
-
createValueGenerator
|
|
162
|
-
};
|