struct-fakerator 3.1.0 → 3.2.0
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/config_scheme.cjs +6 -6
- package/dist/config_scheme.js +7 -7
- package/dist/types/{config_scheme.d.ts → src/config_scheme.d.ts} +6 -6
- package/dist/types/{create_config.d.ts → src/create_config.d.ts} +1 -14
- package/dist/types/src/create_generator_fn.d.ts +10 -0
- package/dist/types/src/type.d.ts +43 -0
- package/dist/types/{utils → src/utils}/airline.d.ts +1 -1
- package/dist/types/{utils → src/utils}/commerce.d.ts +4 -0
- package/dist/types/{utils → src/utils}/common.d.ts +1 -1
- package/dist/types/{utils → src/utils}/image.d.ts +5 -0
- package/dist/types/{utils → src/utils}/index.d.ts +2 -1
- package/dist/types/{utils → src/utils}/location.d.ts +1 -1
- package/dist/types/{utils → src/utils}/string.d.ts +11 -0
- package/dist/types/{utils → src/utils}/utils.d.ts +1 -1
- package/dist/utils/commerce.cjs +5 -1
- package/dist/utils/commerce.js +2 -1
- package/dist/utils/common.cjs +2 -2
- package/dist/utils/common.js +1 -1
- package/dist/utils/image.cjs +4 -0
- package/dist/utils/image.js +2 -1
- package/dist/utils/index.cjs +18 -14
- package/dist/utils/index.js +2 -1
- package/dist/utils/string.cjs +4 -0
- package/dist/utils/string.js +2 -1
- package/dist/utils/utils.cjs +2 -2
- package/dist/utils/utils.js +1 -1
- package/package.json +7 -7
- package/dist/types/create_generator_fn.d.ts +0 -10
- package/dist/types/type.d.ts +0 -91
- /package/dist/types/{config.d.ts → src/config.d.ts} +0 -0
- /package/dist/types/{create_config.test.d.ts → src/create_config.test.d.ts} +0 -0
- /package/dist/types/{create_generator_fn.test.d.ts → src/create_generator_fn.test.d.ts} +0 -0
- /package/dist/types/{generator_fn.d.ts → src/generator_fn.d.ts} +0 -0
- /package/dist/types/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/types/{utils → src/utils}/animal.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/book.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/color.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/company.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/database.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/datatype.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/datetime.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/finance.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/food.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/git.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/hacker.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/internet.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/lorem.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/music.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/number.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/person.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/phone.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/science.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/system.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/vehicle.d.ts +0 -0
- /package/dist/types/{utils → src/utils}/word.d.ts +0 -0
package/dist/config_scheme.cjs
CHANGED
|
@@ -33,28 +33,28 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
33
33
|
});
|
|
34
34
|
const external_valibot_namespaceObject = require("valibot");
|
|
35
35
|
const valueConfigScheme = external_valibot_namespaceObject.object({
|
|
36
|
-
type: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.string(), external_valibot_namespaceObject.
|
|
36
|
+
type: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.string(), external_valibot_namespaceObject.value("value", "invalid type string")),
|
|
37
37
|
generateFn: external_valibot_namespaceObject.any()
|
|
38
38
|
});
|
|
39
39
|
const selectionConfigScheme = external_valibot_namespaceObject.object({
|
|
40
|
-
type: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.string(), external_valibot_namespaceObject.
|
|
40
|
+
type: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.string(), external_valibot_namespaceObject.value("select", "invalid type string")),
|
|
41
41
|
items: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.array(external_valibot_namespaceObject.any()), external_valibot_namespaceObject.nonEmpty("items can not be empty"))
|
|
42
42
|
});
|
|
43
43
|
const arrayConfigScheme = external_valibot_namespaceObject.object({
|
|
44
|
-
type: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.string(), external_valibot_namespaceObject.
|
|
44
|
+
type: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.string(), external_valibot_namespaceObject.value("arr", "invalid type string")),
|
|
45
45
|
item: external_valibot_namespaceObject.object({}),
|
|
46
46
|
len: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.number(), external_valibot_namespaceObject.integer(), external_valibot_namespaceObject.minValue(0))
|
|
47
47
|
});
|
|
48
48
|
const tupleConfigScheme = external_valibot_namespaceObject.object({
|
|
49
|
-
type: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.string(), external_valibot_namespaceObject.
|
|
49
|
+
type: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.string(), external_valibot_namespaceObject.value("tuple", "invalid type string")),
|
|
50
50
|
configItems: external_valibot_namespaceObject.array(external_valibot_namespaceObject.any())
|
|
51
51
|
});
|
|
52
52
|
const objConfigScheme = external_valibot_namespaceObject.object({
|
|
53
|
-
type: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.string(), external_valibot_namespaceObject.
|
|
53
|
+
type: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.string(), external_valibot_namespaceObject.value("obj", "invalid type string")),
|
|
54
54
|
content: external_valibot_namespaceObject.object({})
|
|
55
55
|
});
|
|
56
56
|
const boundedSeriesScheme = external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.object({
|
|
57
|
-
type: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.string(), external_valibot_namespaceObject.
|
|
57
|
+
type: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.string(), external_valibot_namespaceObject.value("bounded_series", "invalid type string")),
|
|
58
58
|
upperLimit: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.number(), external_valibot_namespaceObject.minValue(0)),
|
|
59
59
|
lowerLimit: external_valibot_namespaceObject.pipe(external_valibot_namespaceObject.number(), external_valibot_namespaceObject.minValue(0)),
|
|
60
60
|
createInitValue: external_valibot_namespaceObject.any(),
|
package/dist/config_scheme.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { any, array, check, integer, minValue, nonEmpty, number, object, pipe,
|
|
1
|
+
import { any, array, check, integer, minValue, nonEmpty, number, object, pipe, string, value } from "valibot";
|
|
2
2
|
const valueConfigScheme = object({
|
|
3
|
-
type: pipe(string(),
|
|
3
|
+
type: pipe(string(), value("value", "invalid type string")),
|
|
4
4
|
generateFn: any()
|
|
5
5
|
});
|
|
6
6
|
const selectionConfigScheme = object({
|
|
7
|
-
type: pipe(string(),
|
|
7
|
+
type: pipe(string(), value("select", "invalid type string")),
|
|
8
8
|
items: pipe(array(any()), nonEmpty("items can not be empty"))
|
|
9
9
|
});
|
|
10
10
|
const arrayConfigScheme = object({
|
|
11
|
-
type: pipe(string(),
|
|
11
|
+
type: pipe(string(), value("arr", "invalid type string")),
|
|
12
12
|
item: object({}),
|
|
13
13
|
len: pipe(number(), integer(), minValue(0))
|
|
14
14
|
});
|
|
15
15
|
const tupleConfigScheme = object({
|
|
16
|
-
type: pipe(string(),
|
|
16
|
+
type: pipe(string(), value("tuple", "invalid type string")),
|
|
17
17
|
configItems: array(any())
|
|
18
18
|
});
|
|
19
19
|
const objConfigScheme = object({
|
|
20
|
-
type: pipe(string(),
|
|
20
|
+
type: pipe(string(), value("obj", "invalid type string")),
|
|
21
21
|
content: object({})
|
|
22
22
|
});
|
|
23
23
|
const boundedSeriesScheme = pipe(object({
|
|
24
|
-
type: pipe(string(),
|
|
24
|
+
type: pipe(string(), value("bounded_series", "invalid type string")),
|
|
25
25
|
upperLimit: pipe(number(), minValue(0)),
|
|
26
26
|
lowerLimit: pipe(number(), minValue(0)),
|
|
27
27
|
createInitValue: any(),
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
export declare const valueConfigScheme: v.ObjectSchema<{
|
|
3
|
-
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
3
|
+
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ValueAction<string, "value", "invalid type string">]>;
|
|
4
4
|
readonly generateFn: v.AnySchema;
|
|
5
5
|
}, undefined>;
|
|
6
6
|
export declare const selectionConfigScheme: v.ObjectSchema<{
|
|
7
|
-
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
7
|
+
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ValueAction<string, "select", "invalid type string">]>;
|
|
8
8
|
readonly items: v.SchemaWithPipe<readonly [v.ArraySchema<v.AnySchema, undefined>, v.NonEmptyAction<any[], "items can not be empty">]>;
|
|
9
9
|
}, undefined>;
|
|
10
10
|
export declare const arrayConfigScheme: v.ObjectSchema<{
|
|
11
|
-
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
11
|
+
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ValueAction<string, "arr", "invalid type string">]>;
|
|
12
12
|
readonly item: v.ObjectSchema<{}, undefined>;
|
|
13
13
|
readonly len: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
14
14
|
}, undefined>;
|
|
15
15
|
export declare const tupleConfigScheme: v.ObjectSchema<{
|
|
16
|
-
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
16
|
+
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ValueAction<string, "tuple", "invalid type string">]>;
|
|
17
17
|
readonly configItems: v.ArraySchema<v.AnySchema, undefined>;
|
|
18
18
|
}, undefined>;
|
|
19
19
|
export declare const objConfigScheme: v.ObjectSchema<{
|
|
20
|
-
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
20
|
+
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ValueAction<string, "obj", "invalid type string">]>;
|
|
21
21
|
readonly content: v.ObjectSchema<{}, undefined>;
|
|
22
22
|
}, undefined>;
|
|
23
23
|
export declare const boundedSeriesScheme: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
24
|
-
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.
|
|
24
|
+
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ValueAction<string, "bounded_series", "invalid type string">]>;
|
|
25
25
|
readonly upperLimit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
26
26
|
readonly lowerLimit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
27
27
|
readonly createInitValue: v.AnySchema;
|
|
@@ -34,23 +34,10 @@ export declare const createArrayConfig: <T>(item: T, len: number, next?: (prev:
|
|
|
34
34
|
* @param {Array} configItems
|
|
35
35
|
* @return {TupleConfig}
|
|
36
36
|
*/
|
|
37
|
-
|
|
38
|
-
<A, B, C, D, E, F, G, H, I, J>(configItems: [A, B, C, D, E, F, G, H, I, J]): TupleConfig<A, B, C, D, E, F, G, H, I, J>;
|
|
39
|
-
<A, B, C, D, E, F, G, H, I>(configItems: [A, B, C, D, E, F, G, H, I]): TupleConfig<A, B, C, D, E, F, G, H, I>;
|
|
40
|
-
<A, B, C, D, E, F, G, H>(configItems: [A, B, C, D, E, F, G, H]): TupleConfig<A, B, C, D, E, F, G, H>;
|
|
41
|
-
<A, B, C, D, E, F, G>(configItems: [A, B, C, D, E, F, G]): TupleConfig<A, B, C, D, E, F, G>;
|
|
42
|
-
<A, B, C, D, E, F>(configItems: [A, B, C, D, E, F]): TupleConfig<A, B, C, D, E, F>;
|
|
43
|
-
<A, B, C, D, E>(configItems: [A, B, C, D, E]): TupleConfig<A, B, C, D, E>;
|
|
44
|
-
<A, B, C, D>(configItems: [A, B, C, D]): TupleConfig<A, B, C, D>;
|
|
45
|
-
<A, B, C>(configItems: [A, B, C]): TupleConfig<A, B, C>;
|
|
46
|
-
<A, B>(configItems: [A, B]): TupleConfig<A, B>;
|
|
47
|
-
<A>(configItems: [A]): TupleConfig<A>;
|
|
48
|
-
}
|
|
49
|
-
export declare const createTupleConfig: CreateTupleConfig;
|
|
37
|
+
export declare const createTupleConfig: <const TItems extends readonly [unknown, ...unknown[]]>(configItems: TItems) => TupleConfig<TItems>;
|
|
50
38
|
/**
|
|
51
39
|
* bounded series
|
|
52
40
|
* @param {{ upperLimit: number, lowerLimit: number, createInitValue: () => number, count: number }} config
|
|
53
41
|
* @return {BoundedSeriesConfig}
|
|
54
42
|
*/
|
|
55
43
|
export declare const createBoundedSeriesConfig: (config: Omit<BoundedSeriesConfig, "type">) => BoundedSeriesConfig;
|
|
56
|
-
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ArrayConfig, BoundedSeriesConfig, ObjectConfig, ObjectConfigWithFn, Result, SelectionConfig, TupleConfig, ValueConfig } from "./type";
|
|
2
|
+
type AllConfig = ValueConfig<unknown> | SelectionConfig<unknown> | ArrayConfig<unknown> | ObjectConfig<unknown> | ObjectConfigWithFn<unknown, unknown> | TupleConfig<readonly unknown[]> | BoundedSeriesConfig;
|
|
3
|
+
export declare const createValueGenerator: <R = unknown>(config: ValueConfig<unknown>) => (() => R);
|
|
4
|
+
export declare const createSelectionGenerator: <T extends SelectionConfig<unknown>>(config: T) => (() => Result<T>);
|
|
5
|
+
export declare const createObjectGenerator: <T extends ObjectConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
6
|
+
export declare const createArrayGenerator: <T extends ArrayConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
7
|
+
export declare const createTupleGenerator: <T extends TupleConfig<readonly unknown[]>>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
8
|
+
export declare const createBoundedSeriesGenerator: <T extends BoundedSeriesConfig>(config: T) => (() => Result<T>);
|
|
9
|
+
export declare const createGeneratorByType: <T extends AllConfig>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type ValueConfig<T> = {
|
|
2
|
+
type: "value";
|
|
3
|
+
generateFn: () => T;
|
|
4
|
+
};
|
|
5
|
+
export type SelectionConfig<T> = {
|
|
6
|
+
type: "select";
|
|
7
|
+
items: T[];
|
|
8
|
+
};
|
|
9
|
+
export type BoundedSeriesConfig = {
|
|
10
|
+
type: "bounded_series";
|
|
11
|
+
upperLimit: number;
|
|
12
|
+
lowerLimit: number;
|
|
13
|
+
createInitValue: () => number;
|
|
14
|
+
count: number;
|
|
15
|
+
};
|
|
16
|
+
export type ArrayConfig<T> = {
|
|
17
|
+
type: "arr";
|
|
18
|
+
item: T;
|
|
19
|
+
len: number;
|
|
20
|
+
next?: (prev: Result<T>, current: Result<T>) => Result<T>;
|
|
21
|
+
};
|
|
22
|
+
export type ObjectConfig<T> = {
|
|
23
|
+
type: "obj";
|
|
24
|
+
content: T;
|
|
25
|
+
};
|
|
26
|
+
export type ObjectConfigWithFn<T, R> = {
|
|
27
|
+
type: "obj";
|
|
28
|
+
content: T;
|
|
29
|
+
transformer: (v: {
|
|
30
|
+
[K in keyof T]: Result<T[K]>;
|
|
31
|
+
}) => R;
|
|
32
|
+
};
|
|
33
|
+
export type TupleConfig<TItems extends readonly unknown[]> = {
|
|
34
|
+
type: "tuple";
|
|
35
|
+
configItems: TItems;
|
|
36
|
+
};
|
|
37
|
+
type ResolveTuple<TItems extends readonly unknown[]> = {
|
|
38
|
+
[K in keyof TItems]: Result<TItems[K]>;
|
|
39
|
+
};
|
|
40
|
+
export 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 ObjectConfigWithFn<infer _, infer R> ? R : T extends ObjectConfig<infer O> ? {
|
|
41
|
+
[K in keyof O]: Result<O[K]>;
|
|
42
|
+
} : T extends TupleConfig<infer TItems> ? ResolveTuple<TItems> : never;
|
|
43
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { faker } from "@faker-js/faker";
|
|
2
|
-
import type { ValueConfig } from "
|
|
2
|
+
import type { ValueConfig } from "../type";
|
|
3
3
|
/** Airline [aircraftType](https://fakerjs.dev/api/airline.html#aircraftType) */
|
|
4
4
|
export declare const aircraftType: () => ValueConfig<"narrowbody" | "regional" | "widebody">;
|
|
5
5
|
type Airline = ReturnType<typeof faker.airline.airline>;
|
|
@@ -22,3 +22,7 @@ export declare const productDescription: () => import("..").ValueConfig<string>;
|
|
|
22
22
|
export declare const productMaterial: () => import("..").ValueConfig<string>;
|
|
23
23
|
/** Commerce [productName](https://fakerjs.dev/api/commerce.html#productName) */
|
|
24
24
|
export declare const productName: () => import("..").ValueConfig<string>;
|
|
25
|
+
/** Commerce [upc](https://fakerjs.dev/api/commerce.html#upc) */
|
|
26
|
+
export declare const upc: (options?: {
|
|
27
|
+
prefix?: string;
|
|
28
|
+
} | undefined) => import("..").ValueConfig<string>;
|
|
@@ -9,6 +9,11 @@ export declare const dataUri: (options?: {
|
|
|
9
9
|
color?: string;
|
|
10
10
|
type?: "svg-uri" | "svg-base64";
|
|
11
11
|
} | undefined) => import("..").ValueConfig<string>;
|
|
12
|
+
/** Image [personPortrait](https://fakerjs.dev/api/image.html#personPortrait) */
|
|
13
|
+
export declare const personPortrait: (options?: {
|
|
14
|
+
sex?: import("@faker-js/faker").SexType;
|
|
15
|
+
size?: 512 | 256 | 128 | 64 | 32;
|
|
16
|
+
} | undefined) => import("..").ValueConfig<string>;
|
|
12
17
|
/** Image [url](https://fakerjs.dev/api/image.html#url) */
|
|
13
18
|
export declare const url: (options?: {
|
|
14
19
|
width?: number;
|
|
@@ -23,6 +23,7 @@ export * as Phone from "./phone";
|
|
|
23
23
|
export * as Science from "./science";
|
|
24
24
|
export * as String from "./string";
|
|
25
25
|
export * as System from "./system";
|
|
26
|
+
export * as Word from "./word";
|
|
27
|
+
export * as Vehicle from "./vehicle";
|
|
26
28
|
export * as utils from "./utils";
|
|
27
29
|
export { makeValueConfigFn } from "./utils";
|
|
28
|
-
export * as Vehicle from "./vehicle";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { faker } from "@faker-js/faker";
|
|
2
|
-
import type { ValueConfig } from "
|
|
2
|
+
import type { ValueConfig } from "../type";
|
|
3
3
|
/** Location [buildingNumber](https://fakerjs.dev/api/location.html#buildingNumber) */
|
|
4
4
|
export declare const buildingNumber: () => ValueConfig<string>;
|
|
5
5
|
/** Location [cardinalDirection](https://fakerjs.dev/api/location.html#cardinalDirection) */
|
|
@@ -47,6 +47,17 @@ export declare const nanoid: (length?: number | {
|
|
|
47
47
|
min: number;
|
|
48
48
|
max: number;
|
|
49
49
|
} | undefined) => import("..").ValueConfig<string>;
|
|
50
|
+
/** String [numeric](https://fakerjs.dev/api/string.html#numeric) */
|
|
51
|
+
export declare const numeric: (options?: number | {
|
|
52
|
+
length?: number | {
|
|
53
|
+
min: number;
|
|
54
|
+
max: number;
|
|
55
|
+
};
|
|
56
|
+
allowLeadingZeros?: boolean;
|
|
57
|
+
exclude?: ReadonlyArray<(string & {
|
|
58
|
+
zz_IGNORE_ME?: never;
|
|
59
|
+
}) | ("0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9")> | string;
|
|
60
|
+
} | undefined) => import("..").ValueConfig<string>;
|
|
50
61
|
/** String [octal](https://fakerjs.dev/api/string.html#octal) */
|
|
51
62
|
export declare const octal: (options?: {
|
|
52
63
|
length?: number | {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ValueConfig } from "
|
|
1
|
+
import type { ValueConfig } from "../type";
|
|
2
2
|
export declare function makeValueConfigFn<Args extends Array<unknown>, R>(fn: (...options: Args) => R): (...options: Args) => ValueConfig<R>;
|
package/dist/utils/commerce.cjs
CHANGED
|
@@ -28,6 +28,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
isbn: ()=>isbn,
|
|
29
29
|
productDescription: ()=>productDescription,
|
|
30
30
|
productName: ()=>productName,
|
|
31
|
+
upc: ()=>upc,
|
|
31
32
|
department: ()=>department,
|
|
32
33
|
productAdjective: ()=>productAdjective,
|
|
33
34
|
product: ()=>product,
|
|
@@ -43,6 +44,7 @@ const productAdjective = (0, external_utils_cjs_namespaceObject.makeValueConfigF
|
|
|
43
44
|
const productDescription = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.commerce.productDescription);
|
|
44
45
|
const productMaterial = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.commerce.productMaterial);
|
|
45
46
|
const productName = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.commerce.productName);
|
|
47
|
+
const upc = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.commerce.upc);
|
|
46
48
|
exports.department = __webpack_exports__.department;
|
|
47
49
|
exports.isbn = __webpack_exports__.isbn;
|
|
48
50
|
exports.price = __webpack_exports__.price;
|
|
@@ -51,6 +53,7 @@ exports.productAdjective = __webpack_exports__.productAdjective;
|
|
|
51
53
|
exports.productDescription = __webpack_exports__.productDescription;
|
|
52
54
|
exports.productMaterial = __webpack_exports__.productMaterial;
|
|
53
55
|
exports.productName = __webpack_exports__.productName;
|
|
56
|
+
exports.upc = __webpack_exports__.upc;
|
|
54
57
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
55
58
|
"department",
|
|
56
59
|
"isbn",
|
|
@@ -59,7 +62,8 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
59
62
|
"productAdjective",
|
|
60
63
|
"productDescription",
|
|
61
64
|
"productMaterial",
|
|
62
|
-
"productName"
|
|
65
|
+
"productName",
|
|
66
|
+
"upc"
|
|
63
67
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
64
68
|
Object.defineProperty(exports, '__esModule', {
|
|
65
69
|
value: true
|
package/dist/utils/commerce.js
CHANGED
|
@@ -8,4 +8,5 @@ const productAdjective = makeValueConfigFn(faker.commerce.productAdjective);
|
|
|
8
8
|
const productDescription = makeValueConfigFn(faker.commerce.productDescription);
|
|
9
9
|
const productMaterial = makeValueConfigFn(faker.commerce.productMaterial);
|
|
10
10
|
const productName = makeValueConfigFn(faker.commerce.productName);
|
|
11
|
-
|
|
11
|
+
const upc = makeValueConfigFn(faker.commerce.upc);
|
|
12
|
+
export { department, isbn, price, product, productAdjective, productDescription, productMaterial, productName, upc };
|
package/dist/utils/common.cjs
CHANGED
|
@@ -26,8 +26,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
constant: ()=>constant
|
|
28
28
|
});
|
|
29
|
-
const
|
|
30
|
-
const constant = (value)=>(0,
|
|
29
|
+
const external_create_config_cjs_namespaceObject = require("../create_config.cjs");
|
|
30
|
+
const constant = (value)=>(0, external_create_config_cjs_namespaceObject.createValueConfig)(()=>value);
|
|
31
31
|
exports.constant = __webpack_exports__.constant;
|
|
32
32
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
33
33
|
"constant"
|
package/dist/utils/common.js
CHANGED
package/dist/utils/image.cjs
CHANGED
|
@@ -29,6 +29,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
29
|
dataUri: ()=>dataUri,
|
|
30
30
|
urlPicsumPhotos: ()=>urlPicsumPhotos,
|
|
31
31
|
avatarGitHub: ()=>avatarGitHub,
|
|
32
|
+
personPortrait: ()=>personPortrait,
|
|
32
33
|
url: ()=>url
|
|
33
34
|
});
|
|
34
35
|
const faker_namespaceObject = require("@faker-js/faker");
|
|
@@ -36,12 +37,14 @@ const external_utils_cjs_namespaceObject = require("./utils.cjs");
|
|
|
36
37
|
const avatar = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.image.avatar);
|
|
37
38
|
const avatarGitHub = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.image.avatarGitHub);
|
|
38
39
|
const dataUri = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.image.dataUri);
|
|
40
|
+
const personPortrait = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.image.personPortrait);
|
|
39
41
|
const url = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.image.url);
|
|
40
42
|
const urlLoremFlickr = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.image.urlLoremFlickr);
|
|
41
43
|
const urlPicsumPhotos = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.image.urlPicsumPhotos);
|
|
42
44
|
exports.avatar = __webpack_exports__.avatar;
|
|
43
45
|
exports.avatarGitHub = __webpack_exports__.avatarGitHub;
|
|
44
46
|
exports.dataUri = __webpack_exports__.dataUri;
|
|
47
|
+
exports.personPortrait = __webpack_exports__.personPortrait;
|
|
45
48
|
exports.url = __webpack_exports__.url;
|
|
46
49
|
exports.urlLoremFlickr = __webpack_exports__.urlLoremFlickr;
|
|
47
50
|
exports.urlPicsumPhotos = __webpack_exports__.urlPicsumPhotos;
|
|
@@ -49,6 +52,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
49
52
|
"avatar",
|
|
50
53
|
"avatarGitHub",
|
|
51
54
|
"dataUri",
|
|
55
|
+
"personPortrait",
|
|
52
56
|
"url",
|
|
53
57
|
"urlLoremFlickr",
|
|
54
58
|
"urlPicsumPhotos"
|
package/dist/utils/image.js
CHANGED
|
@@ -3,7 +3,8 @@ import { makeValueConfigFn } from "./utils.js";
|
|
|
3
3
|
const avatar = makeValueConfigFn(faker.image.avatar);
|
|
4
4
|
const avatarGitHub = makeValueConfigFn(faker.image.avatarGitHub);
|
|
5
5
|
const dataUri = makeValueConfigFn(faker.image.dataUri);
|
|
6
|
+
const personPortrait = makeValueConfigFn(faker.image.personPortrait);
|
|
6
7
|
const url = makeValueConfigFn(faker.image.url);
|
|
7
8
|
const urlLoremFlickr = makeValueConfigFn(faker.image.urlLoremFlickr);
|
|
8
9
|
const urlPicsumPhotos = makeValueConfigFn(faker.image.urlPicsumPhotos);
|
|
9
|
-
export { avatar, avatarGitHub, dataUri, url, urlLoremFlickr, urlPicsumPhotos };
|
|
10
|
+
export { avatar, avatarGitHub, dataUri, personPortrait, url, urlLoremFlickr, urlPicsumPhotos };
|
package/dist/utils/index.cjs
CHANGED
|
@@ -24,34 +24,35 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
|
|
27
|
+
Common: ()=>external_common_cjs_namespaceObject,
|
|
28
|
+
Color: ()=>external_color_cjs_namespaceObject,
|
|
29
|
+
Lorem: ()=>external_lorem_cjs_namespaceObject,
|
|
30
|
+
DateTime: ()=>external_datetime_cjs_namespaceObject,
|
|
31
|
+
Food: ()=>external_food_cjs_namespaceObject,
|
|
32
|
+
Image: ()=>external_image_cjs_namespaceObject,
|
|
33
|
+
Git: ()=>external_git_cjs_namespaceObject,
|
|
34
|
+
System: ()=>external_system_cjs_namespaceObject,
|
|
35
|
+
utils: ()=>external_utils_cjs_namespaceObject,
|
|
36
|
+
Company: ()=>external_company_cjs_namespaceObject,
|
|
37
|
+
Science: ()=>external_science_cjs_namespaceObject,
|
|
28
38
|
makeValueConfigFn: ()=>external_utils_cjs_namespaceObject.makeValueConfigFn,
|
|
29
39
|
Number: ()=>external_number_cjs_namespaceObject,
|
|
30
|
-
|
|
31
|
-
Airline: ()=>external_airline_cjs_namespaceObject,
|
|
40
|
+
Word: ()=>external_word_cjs_namespaceObject,
|
|
32
41
|
Datatype: ()=>external_datatype_cjs_namespaceObject,
|
|
42
|
+
Airline: ()=>external_airline_cjs_namespaceObject,
|
|
33
43
|
Hacker: ()=>external_hacker_cjs_namespaceObject,
|
|
34
|
-
Lorem: ()=>external_lorem_cjs_namespaceObject,
|
|
35
|
-
DateTime: ()=>external_datetime_cjs_namespaceObject,
|
|
36
44
|
Music: ()=>external_music_cjs_namespaceObject,
|
|
37
|
-
Food: ()=>external_food_cjs_namespaceObject,
|
|
38
45
|
String: ()=>external_string_cjs_namespaceObject,
|
|
39
46
|
Database: ()=>external_database_cjs_namespaceObject,
|
|
40
47
|
Animal: ()=>external_animal_cjs_namespaceObject,
|
|
41
48
|
Location: ()=>external_location_cjs_namespaceObject,
|
|
42
|
-
Image: ()=>external_image_cjs_namespaceObject,
|
|
43
|
-
Git: ()=>external_git_cjs_namespaceObject,
|
|
44
49
|
Person: ()=>external_person_cjs_namespaceObject,
|
|
45
50
|
Commerce: ()=>external_commerce_cjs_namespaceObject,
|
|
46
|
-
Company: ()=>external_company_cjs_namespaceObject,
|
|
47
51
|
Phone: ()=>external_phone_cjs_namespaceObject,
|
|
48
|
-
System: ()=>external_system_cjs_namespaceObject,
|
|
49
|
-
utils: ()=>external_utils_cjs_namespaceObject,
|
|
50
|
-
Science: ()=>external_science_cjs_namespaceObject,
|
|
51
52
|
Book: ()=>external_book_cjs_namespaceObject,
|
|
52
53
|
Finance: ()=>external_finance_cjs_namespaceObject,
|
|
53
54
|
Vehicle: ()=>external_vehicle_cjs_namespaceObject,
|
|
54
|
-
|
|
55
|
+
Internet: ()=>external_internet_cjs_namespaceObject
|
|
55
56
|
});
|
|
56
57
|
const external_airline_cjs_namespaceObject = require("./airline.cjs");
|
|
57
58
|
const external_animal_cjs_namespaceObject = require("./animal.cjs");
|
|
@@ -78,8 +79,9 @@ const external_phone_cjs_namespaceObject = require("./phone.cjs");
|
|
|
78
79
|
const external_science_cjs_namespaceObject = require("./science.cjs");
|
|
79
80
|
const external_string_cjs_namespaceObject = require("./string.cjs");
|
|
80
81
|
const external_system_cjs_namespaceObject = require("./system.cjs");
|
|
81
|
-
const
|
|
82
|
+
const external_word_cjs_namespaceObject = require("./word.cjs");
|
|
82
83
|
const external_vehicle_cjs_namespaceObject = require("./vehicle.cjs");
|
|
84
|
+
const external_utils_cjs_namespaceObject = require("./utils.cjs");
|
|
83
85
|
exports.Airline = __webpack_exports__.Airline;
|
|
84
86
|
exports.Animal = __webpack_exports__.Animal;
|
|
85
87
|
exports.Book = __webpack_exports__.Book;
|
|
@@ -106,6 +108,7 @@ exports.Science = __webpack_exports__.Science;
|
|
|
106
108
|
exports.String = __webpack_exports__.String;
|
|
107
109
|
exports.System = __webpack_exports__.System;
|
|
108
110
|
exports.Vehicle = __webpack_exports__.Vehicle;
|
|
111
|
+
exports.Word = __webpack_exports__.Word;
|
|
109
112
|
exports.makeValueConfigFn = __webpack_exports__.makeValueConfigFn;
|
|
110
113
|
exports.utils = __webpack_exports__.utils;
|
|
111
114
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
@@ -135,6 +138,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
135
138
|
"String",
|
|
136
139
|
"System",
|
|
137
140
|
"Vehicle",
|
|
141
|
+
"Word",
|
|
138
142
|
"makeValueConfigFn",
|
|
139
143
|
"utils"
|
|
140
144
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
package/dist/utils/index.js
CHANGED
|
@@ -24,6 +24,7 @@ import * as __rspack_external__phone_js_5391b8ca from "./phone.js";
|
|
|
24
24
|
import * as __rspack_external__science_js_fa8462db from "./science.js";
|
|
25
25
|
import * as __rspack_external__string_js_8f2912d6 from "./string.js";
|
|
26
26
|
import * as __rspack_external__system_js_50c29608 from "./system.js";
|
|
27
|
+
import * as __rspack_external__word_js_75602f81 from "./word.js";
|
|
27
28
|
import * as __rspack_external__vehicle_js_1cb59f69 from "./vehicle.js";
|
|
28
29
|
var __webpack_exports__makeValueConfigFn = __rspack_external__utils_js_d88b7fe1.makeValueConfigFn;
|
|
29
|
-
export { __rspack_external__airline_js_130611a2 as Airline, __rspack_external__animal_js_c3e7c1dc as Animal, __rspack_external__book_js_178f9878 as Book, __rspack_external__color_js_8769135d as Color, __rspack_external__commerce_js_81495924 as Commerce, __rspack_external__common_js_29d52c64 as Common, __rspack_external__company_js_9a05fd60 as Company, __rspack_external__database_js_df934457 as Database, __rspack_external__datatype_js_98aa638e as Datatype, __rspack_external__datetime_js_55619628 as DateTime, __rspack_external__finance_js_70f1c342 as Finance, __rspack_external__food_js_6304fd17 as Food, __rspack_external__git_js_b95c04ce as Git, __rspack_external__hacker_js_e6054d1c as Hacker, __rspack_external__image_js_863b0c0e as Image, __rspack_external__internet_js_78c88a9d as Internet, __rspack_external__location_js_e7e825c1 as Location, __rspack_external__lorem_js_80d653e4 as Lorem, __rspack_external__music_js_cf6e4e8d as Music, __rspack_external__number_js_e0b558c6 as Number, __rspack_external__person_js_c473cc56 as Person, __rspack_external__phone_js_5391b8ca as Phone, __rspack_external__science_js_fa8462db as Science, __rspack_external__string_js_8f2912d6 as String, __rspack_external__system_js_50c29608 as System, __rspack_external__vehicle_js_1cb59f69 as Vehicle, __rspack_external__utils_js_d88b7fe1 as utils, __webpack_exports__makeValueConfigFn as makeValueConfigFn };
|
|
30
|
+
export { __rspack_external__airline_js_130611a2 as Airline, __rspack_external__animal_js_c3e7c1dc as Animal, __rspack_external__book_js_178f9878 as Book, __rspack_external__color_js_8769135d as Color, __rspack_external__commerce_js_81495924 as Commerce, __rspack_external__common_js_29d52c64 as Common, __rspack_external__company_js_9a05fd60 as Company, __rspack_external__database_js_df934457 as Database, __rspack_external__datatype_js_98aa638e as Datatype, __rspack_external__datetime_js_55619628 as DateTime, __rspack_external__finance_js_70f1c342 as Finance, __rspack_external__food_js_6304fd17 as Food, __rspack_external__git_js_b95c04ce as Git, __rspack_external__hacker_js_e6054d1c as Hacker, __rspack_external__image_js_863b0c0e as Image, __rspack_external__internet_js_78c88a9d as Internet, __rspack_external__location_js_e7e825c1 as Location, __rspack_external__lorem_js_80d653e4 as Lorem, __rspack_external__music_js_cf6e4e8d as Music, __rspack_external__number_js_e0b558c6 as Number, __rspack_external__person_js_c473cc56 as Person, __rspack_external__phone_js_5391b8ca as Phone, __rspack_external__science_js_fa8462db as Science, __rspack_external__string_js_8f2912d6 as String, __rspack_external__system_js_50c29608 as System, __rspack_external__vehicle_js_1cb59f69 as Vehicle, __rspack_external__word_js_75602f81 as Word, __rspack_external__utils_js_d88b7fe1 as utils, __webpack_exports__makeValueConfigFn as makeValueConfigFn };
|
package/dist/utils/string.cjs
CHANGED
|
@@ -34,6 +34,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
34
34
|
fromCharacters: ()=>fromCharacters,
|
|
35
35
|
octal: ()=>octal,
|
|
36
36
|
alphanumeric: ()=>alphanumeric,
|
|
37
|
+
numeric: ()=>numeric,
|
|
37
38
|
ulid: ()=>ulid
|
|
38
39
|
});
|
|
39
40
|
const faker_namespaceObject = require("@faker-js/faker");
|
|
@@ -44,6 +45,7 @@ const binary = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_n
|
|
|
44
45
|
const fromCharacters = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.string.fromCharacters);
|
|
45
46
|
const hexadecimal = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.string.hexadecimal);
|
|
46
47
|
const nanoid = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.string.nanoid);
|
|
48
|
+
const numeric = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.string.numeric);
|
|
47
49
|
const octal = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.string.octal);
|
|
48
50
|
const sample = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.string.sample);
|
|
49
51
|
const symbol = (0, external_utils_cjs_namespaceObject.makeValueConfigFn)(faker_namespaceObject.faker.string.symbol);
|
|
@@ -55,6 +57,7 @@ exports.binary = __webpack_exports__.binary;
|
|
|
55
57
|
exports.fromCharacters = __webpack_exports__.fromCharacters;
|
|
56
58
|
exports.hexadecimal = __webpack_exports__.hexadecimal;
|
|
57
59
|
exports.nanoid = __webpack_exports__.nanoid;
|
|
60
|
+
exports.numeric = __webpack_exports__.numeric;
|
|
58
61
|
exports.octal = __webpack_exports__.octal;
|
|
59
62
|
exports.sample = __webpack_exports__.sample;
|
|
60
63
|
exports.symbol = __webpack_exports__.symbol;
|
|
@@ -67,6 +70,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
67
70
|
"fromCharacters",
|
|
68
71
|
"hexadecimal",
|
|
69
72
|
"nanoid",
|
|
73
|
+
"numeric",
|
|
70
74
|
"octal",
|
|
71
75
|
"sample",
|
|
72
76
|
"symbol",
|
package/dist/utils/string.js
CHANGED
|
@@ -6,9 +6,10 @@ const binary = makeValueConfigFn(faker.string.binary);
|
|
|
6
6
|
const fromCharacters = makeValueConfigFn(faker.string.fromCharacters);
|
|
7
7
|
const hexadecimal = makeValueConfigFn(faker.string.hexadecimal);
|
|
8
8
|
const nanoid = makeValueConfigFn(faker.string.nanoid);
|
|
9
|
+
const numeric = makeValueConfigFn(faker.string.numeric);
|
|
9
10
|
const octal = makeValueConfigFn(faker.string.octal);
|
|
10
11
|
const sample = makeValueConfigFn(faker.string.sample);
|
|
11
12
|
const symbol = makeValueConfigFn(faker.string.symbol);
|
|
12
13
|
const ulid = makeValueConfigFn(faker.string.ulid);
|
|
13
14
|
const uuid = makeValueConfigFn(faker.string.uuid);
|
|
14
|
-
export { alpha, alphanumeric, binary, fromCharacters, hexadecimal, nanoid, octal, sample, symbol, ulid, uuid };
|
|
15
|
+
export { alpha, alphanumeric, binary, fromCharacters, hexadecimal, nanoid, numeric, octal, sample, symbol, ulid, uuid };
|
package/dist/utils/utils.cjs
CHANGED
|
@@ -26,9 +26,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
makeValueConfigFn: ()=>makeValueConfigFn
|
|
28
28
|
});
|
|
29
|
-
const
|
|
29
|
+
const external_create_config_cjs_namespaceObject = require("../create_config.cjs");
|
|
30
30
|
function makeValueConfigFn(fn) {
|
|
31
|
-
return (...options)=>(0,
|
|
31
|
+
return (...options)=>(0, external_create_config_cjs_namespaceObject.createValueConfig)(()=>fn(...options));
|
|
32
32
|
}
|
|
33
33
|
exports.makeValueConfigFn = __webpack_exports__.makeValueConfigFn;
|
|
34
34
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
package/dist/utils/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "struct-fakerator",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fake data",
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
"test": "vitest src"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@faker-js/faker": "^10.
|
|
48
|
-
"valibot": "^1.
|
|
47
|
+
"@faker-js/faker": "^10.4.0",
|
|
48
|
+
"valibot": "^1.3.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@rslib/core": "^0.19.6",
|
|
52
|
-
"@types/node": "^25.5.
|
|
53
|
-
"oxfmt": "^0.
|
|
54
|
-
"oxlint": "^1.
|
|
52
|
+
"@types/node": "^25.5.2",
|
|
53
|
+
"oxfmt": "^0.44.0",
|
|
54
|
+
"oxlint": "^1.59.0",
|
|
55
55
|
"typescript": "^5.9.3",
|
|
56
|
-
"vitest": "^4.1.
|
|
56
|
+
"vitest": "^4.1.4"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ArrayConfig, BoundedSeriesConfig, ObjectConfig, ObjectConfigWithFn, Result, SelectionConfig, TupleConfig, ValueConfig } from "./type";
|
|
2
|
-
type AllConfig<T> = ValueConfig<T> | SelectionConfig<T> | ArrayConfig<T> | ObjectConfig<T> | ObjectConfigWithFn<T, unknown> | TupleConfig<T> | TupleConfig<T, T> | TupleConfig<T, T, T> | TupleConfig<T, T, T, T> | TupleConfig<T, T, T, T, T> | TupleConfig<T, T, T, T, T, T> | TupleConfig<T, T, T, T, T, T, T> | TupleConfig<T, T, T, T, T, T, T, T> | TupleConfig<T, T, T, T, T, T, T, T, T> | TupleConfig<T, T, T, T, T, T, T, T, T, T> | BoundedSeriesConfig;
|
|
3
|
-
export declare const createValueGenerator: <R = unknown>(config: ValueConfig<unknown>) => (() => R);
|
|
4
|
-
export declare const createSelectionGenerator: <T extends SelectionConfig<unknown>>(config: T) => (() => Result<T>);
|
|
5
|
-
export declare const createObjectGenerator: <T extends ObjectConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
6
|
-
export declare const createArrayGenerator: <T extends ArrayConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
7
|
-
export declare const createTupleGenerator: <T extends TupleConfig<unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown> | TupleConfig<unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown> | TupleConfig<unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown> | TupleConfig<unknown, unknown, unknown, unknown, unknown, unknown> | 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>);
|
|
8
|
-
export declare const createBoundedSeriesGenerator: <T extends BoundedSeriesConfig>(config: T) => (() => Result<T>);
|
|
9
|
-
export declare const createGeneratorByType: <T extends AllConfig<unknown>>(config: T, customTypeMatch?: (config: unknown, path?: string) => ValueConfig<unknown>) => (() => Result<T>);
|
|
10
|
-
export {};
|
package/dist/types/type.d.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
export type ValueConfig<T> = {
|
|
2
|
-
type: "value";
|
|
3
|
-
generateFn: () => T;
|
|
4
|
-
};
|
|
5
|
-
export type SelectionConfig<T> = {
|
|
6
|
-
type: "select";
|
|
7
|
-
items: T[];
|
|
8
|
-
};
|
|
9
|
-
export type BoundedSeriesConfig = {
|
|
10
|
-
type: "bounded_series";
|
|
11
|
-
upperLimit: number;
|
|
12
|
-
lowerLimit: number;
|
|
13
|
-
createInitValue: () => number;
|
|
14
|
-
count: number;
|
|
15
|
-
};
|
|
16
|
-
export type ArrayConfig<T> = {
|
|
17
|
-
type: "arr";
|
|
18
|
-
item: T;
|
|
19
|
-
len: number;
|
|
20
|
-
next?: (prev: Result<T>, current: Result<T>) => Result<T>;
|
|
21
|
-
};
|
|
22
|
-
export type ObjectConfig<T> = {
|
|
23
|
-
type: "obj";
|
|
24
|
-
content: T;
|
|
25
|
-
};
|
|
26
|
-
export type ObjectConfigWithFn<T, R> = {
|
|
27
|
-
type: "obj";
|
|
28
|
-
content: T;
|
|
29
|
-
transformer: (v: {
|
|
30
|
-
[K in keyof T]: Result<T[K]>;
|
|
31
|
-
}) => R;
|
|
32
|
-
};
|
|
33
|
-
export 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];
|
|
34
|
-
export type TupleConfig<A, B = undefined, C = undefined, D = undefined, E = undefined, F = undefined, G = undefined, H = undefined, I = undefined, J = undefined> = {
|
|
35
|
-
type: "tuple";
|
|
36
|
-
configItems: TupleItems<A, B, C, D, E, F, G, H, I, J>;
|
|
37
|
-
};
|
|
38
|
-
export 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 ObjectConfigWithFn<infer _, infer R> ? R : T extends ObjectConfig<infer O> ? {
|
|
39
|
-
[K in keyof O]: Result<O[K]>;
|
|
40
|
-
} : 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>] : [
|
|
41
|
-
Result<A>,
|
|
42
|
-
Result<B>,
|
|
43
|
-
Result<C>,
|
|
44
|
-
Result<D>,
|
|
45
|
-
Result<E>
|
|
46
|
-
] : [
|
|
47
|
-
Result<A>,
|
|
48
|
-
Result<B>,
|
|
49
|
-
Result<C>,
|
|
50
|
-
Result<D>,
|
|
51
|
-
Result<E>,
|
|
52
|
-
Result<F>
|
|
53
|
-
] : [
|
|
54
|
-
Result<A>,
|
|
55
|
-
Result<B>,
|
|
56
|
-
Result<C>,
|
|
57
|
-
Result<D>,
|
|
58
|
-
Result<E>,
|
|
59
|
-
Result<F>,
|
|
60
|
-
Result<G>
|
|
61
|
-
] : [
|
|
62
|
-
Result<A>,
|
|
63
|
-
Result<B>,
|
|
64
|
-
Result<C>,
|
|
65
|
-
Result<D>,
|
|
66
|
-
Result<E>,
|
|
67
|
-
Result<F>,
|
|
68
|
-
Result<G>,
|
|
69
|
-
Result<H>
|
|
70
|
-
] : [
|
|
71
|
-
Result<A>,
|
|
72
|
-
Result<B>,
|
|
73
|
-
Result<C>,
|
|
74
|
-
Result<D>,
|
|
75
|
-
Result<E>,
|
|
76
|
-
Result<F>,
|
|
77
|
-
Result<G>,
|
|
78
|
-
Result<H>,
|
|
79
|
-
Result<I>
|
|
80
|
-
] : [
|
|
81
|
-
Result<A>,
|
|
82
|
-
Result<B>,
|
|
83
|
-
Result<C>,
|
|
84
|
-
Result<D>,
|
|
85
|
-
Result<E>,
|
|
86
|
-
Result<F>,
|
|
87
|
-
Result<G>,
|
|
88
|
-
Result<H>,
|
|
89
|
-
Result<I>,
|
|
90
|
-
Result<J>
|
|
91
|
-
] : never;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|