@rspack/core 1.0.0-alpha.1 → 1.0.0-alpha.2
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/compiled/zod-validation-error/index.d.ts +4 -170
- package/compiled/zod-validation-error/index.js +4 -4154
- package/dist/builtin-loader/swc/index.d.ts +0 -2
- package/dist/builtin-loader/swc/index.js +1 -3
- package/dist/builtin-loader/swc/types.d.ts +0 -2
- package/dist/config/adapterRuleUse.js +0 -3
- package/dist/node/nodeConsole.js +26 -3
- package/package.json +5 -5
- package/dist/builtin-loader/swc/preact.d.ts +0 -6
- package/dist/builtin-loader/swc/preact.js +0 -15
|
@@ -1,178 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const ZodParsedType: {
|
|
4
|
-
function: "function";
|
|
5
|
-
number: "number";
|
|
6
|
-
string: "string";
|
|
7
|
-
nan: "nan";
|
|
8
|
-
integer: "integer";
|
|
9
|
-
float: "float";
|
|
10
|
-
boolean: "boolean";
|
|
11
|
-
date: "date";
|
|
12
|
-
bigint: "bigint";
|
|
13
|
-
symbol: "symbol";
|
|
14
|
-
undefined: "undefined";
|
|
15
|
-
null: "null";
|
|
16
|
-
array: "array";
|
|
17
|
-
object: "object";
|
|
18
|
-
unknown: "unknown";
|
|
19
|
-
promise: "promise";
|
|
20
|
-
void: "void";
|
|
21
|
-
never: "never";
|
|
22
|
-
map: "map";
|
|
23
|
-
set: "set";
|
|
24
|
-
};
|
|
25
|
-
declare type ZodParsedType = keyof typeof ZodParsedType;
|
|
26
|
-
|
|
27
|
-
declare type allKeys<T> = T extends any ? keyof T : never;
|
|
28
|
-
declare type typeToFlattenedError<T, U = string> = {
|
|
29
|
-
formErrors: U[];
|
|
30
|
-
fieldErrors: {
|
|
31
|
-
[P in allKeys<T>]?: U[];
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
declare const ZodIssueCode: {
|
|
35
|
-
invalid_type: "invalid_type";
|
|
36
|
-
invalid_literal: "invalid_literal";
|
|
37
|
-
custom: "custom";
|
|
38
|
-
invalid_union: "invalid_union";
|
|
39
|
-
invalid_union_discriminator: "invalid_union_discriminator";
|
|
40
|
-
invalid_enum_value: "invalid_enum_value";
|
|
41
|
-
unrecognized_keys: "unrecognized_keys";
|
|
42
|
-
invalid_arguments: "invalid_arguments";
|
|
43
|
-
invalid_return_type: "invalid_return_type";
|
|
44
|
-
invalid_date: "invalid_date";
|
|
45
|
-
invalid_string: "invalid_string";
|
|
46
|
-
too_small: "too_small";
|
|
47
|
-
too_big: "too_big";
|
|
48
|
-
invalid_intersection_types: "invalid_intersection_types";
|
|
49
|
-
not_multiple_of: "not_multiple_of";
|
|
50
|
-
not_finite: "not_finite";
|
|
51
|
-
};
|
|
52
|
-
declare type ZodIssueCode = keyof typeof ZodIssueCode;
|
|
53
|
-
declare type ZodIssueBase = {
|
|
54
|
-
path: (string | number)[];
|
|
55
|
-
message?: string;
|
|
56
|
-
};
|
|
57
|
-
interface ZodInvalidTypeIssue extends ZodIssueBase {
|
|
58
|
-
code: typeof ZodIssueCode.invalid_type;
|
|
59
|
-
expected: ZodParsedType;
|
|
60
|
-
received: ZodParsedType;
|
|
61
|
-
}
|
|
62
|
-
interface ZodInvalidLiteralIssue extends ZodIssueBase {
|
|
63
|
-
code: typeof ZodIssueCode.invalid_literal;
|
|
64
|
-
expected: unknown;
|
|
65
|
-
received: unknown;
|
|
66
|
-
}
|
|
67
|
-
interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
|
|
68
|
-
code: typeof ZodIssueCode.unrecognized_keys;
|
|
69
|
-
keys: string[];
|
|
70
|
-
}
|
|
71
|
-
interface ZodInvalidUnionIssue extends ZodIssueBase {
|
|
72
|
-
code: typeof ZodIssueCode.invalid_union;
|
|
73
|
-
unionErrors: ZodError$1[];
|
|
74
|
-
}
|
|
75
|
-
interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
|
|
76
|
-
code: typeof ZodIssueCode.invalid_union_discriminator;
|
|
77
|
-
options: Primitive[];
|
|
78
|
-
}
|
|
79
|
-
interface ZodInvalidEnumValueIssue extends ZodIssueBase {
|
|
80
|
-
received: string | number;
|
|
81
|
-
code: typeof ZodIssueCode.invalid_enum_value;
|
|
82
|
-
options: (string | number)[];
|
|
83
|
-
}
|
|
84
|
-
interface ZodInvalidArgumentsIssue extends ZodIssueBase {
|
|
85
|
-
code: typeof ZodIssueCode.invalid_arguments;
|
|
86
|
-
argumentsError: ZodError$1;
|
|
87
|
-
}
|
|
88
|
-
interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
|
|
89
|
-
code: typeof ZodIssueCode.invalid_return_type;
|
|
90
|
-
returnTypeError: ZodError$1;
|
|
91
|
-
}
|
|
92
|
-
interface ZodInvalidDateIssue extends ZodIssueBase {
|
|
93
|
-
code: typeof ZodIssueCode.invalid_date;
|
|
94
|
-
}
|
|
95
|
-
declare type StringValidation = "email" | "url" | "emoji" | "uuid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "ip" | {
|
|
96
|
-
includes: string;
|
|
97
|
-
position?: number;
|
|
98
|
-
} | {
|
|
99
|
-
startsWith: string;
|
|
100
|
-
} | {
|
|
101
|
-
endsWith: string;
|
|
102
|
-
};
|
|
103
|
-
interface ZodInvalidStringIssue extends ZodIssueBase {
|
|
104
|
-
code: typeof ZodIssueCode.invalid_string;
|
|
105
|
-
validation: StringValidation;
|
|
106
|
-
}
|
|
107
|
-
interface ZodTooSmallIssue extends ZodIssueBase {
|
|
108
|
-
code: typeof ZodIssueCode.too_small;
|
|
109
|
-
minimum: number | bigint;
|
|
110
|
-
inclusive: boolean;
|
|
111
|
-
exact?: boolean;
|
|
112
|
-
type: "array" | "string" | "number" | "set" | "date" | "bigint";
|
|
113
|
-
}
|
|
114
|
-
interface ZodTooBigIssue extends ZodIssueBase {
|
|
115
|
-
code: typeof ZodIssueCode.too_big;
|
|
116
|
-
maximum: number | bigint;
|
|
117
|
-
inclusive: boolean;
|
|
118
|
-
exact?: boolean;
|
|
119
|
-
type: "array" | "string" | "number" | "set" | "date" | "bigint";
|
|
120
|
-
}
|
|
121
|
-
interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
|
|
122
|
-
code: typeof ZodIssueCode.invalid_intersection_types;
|
|
123
|
-
}
|
|
124
|
-
interface ZodNotMultipleOfIssue extends ZodIssueBase {
|
|
125
|
-
code: typeof ZodIssueCode.not_multiple_of;
|
|
126
|
-
multipleOf: number | bigint;
|
|
127
|
-
}
|
|
128
|
-
interface ZodNotFiniteIssue extends ZodIssueBase {
|
|
129
|
-
code: typeof ZodIssueCode.not_finite;
|
|
130
|
-
}
|
|
131
|
-
interface ZodCustomIssue extends ZodIssueBase {
|
|
132
|
-
code: typeof ZodIssueCode.custom;
|
|
133
|
-
params?: {
|
|
134
|
-
[k: string]: any;
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
declare type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
|
|
138
|
-
declare type ZodIssue = ZodIssueOptionalMessage & {
|
|
139
|
-
fatal?: boolean;
|
|
140
|
-
message: string;
|
|
141
|
-
};
|
|
142
|
-
declare type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? {
|
|
143
|
-
[K in keyof T]?: ZodFormattedError<T[K]>;
|
|
144
|
-
} : T extends any[] ? {
|
|
145
|
-
[k: number]: ZodFormattedError<T[number]>;
|
|
146
|
-
} : T extends object ? {
|
|
147
|
-
[K in keyof T]?: ZodFormattedError<T[K]>;
|
|
148
|
-
} : unknown;
|
|
149
|
-
declare type ZodFormattedError<T, U = string> = {
|
|
150
|
-
_errors: U[];
|
|
151
|
-
} & recursiveZodFormattedError<NonNullable<T>>;
|
|
152
|
-
declare class ZodError$1<T = any> extends Error {
|
|
153
|
-
issues: ZodIssue[];
|
|
154
|
-
get errors(): ZodIssue[];
|
|
155
|
-
constructor(issues: ZodIssue[]);
|
|
156
|
-
format(): ZodFormattedError<T>;
|
|
157
|
-
format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
|
|
158
|
-
static create: (issues: ZodIssue[]) => ZodError$1<any>;
|
|
159
|
-
toString(): string;
|
|
160
|
-
get message(): string;
|
|
161
|
-
get isEmpty(): boolean;
|
|
162
|
-
addIssue: (sub: ZodIssue) => void;
|
|
163
|
-
addIssues: (subs?: ZodIssue[]) => void;
|
|
164
|
-
flatten(): typeToFlattenedError<T>;
|
|
165
|
-
flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
|
|
166
|
-
get formErrors(): typeToFlattenedError<T, string>;
|
|
167
|
-
}
|
|
1
|
+
import * as zod from 'zod';
|
|
168
2
|
|
|
169
3
|
declare class ValidationError extends Error {
|
|
170
|
-
details: Array<ZodIssue>;
|
|
4
|
+
details: Array<zod.ZodIssue>;
|
|
171
5
|
name: 'ZodValidationError';
|
|
172
|
-
constructor(message: string, details?: Array<ZodIssue> | undefined);
|
|
6
|
+
constructor(message: string, details?: Array<zod.ZodIssue> | undefined);
|
|
173
7
|
toString(): string;
|
|
174
8
|
}
|
|
175
|
-
type ZodError = ZodError
|
|
9
|
+
type ZodError = zod.ZodError;
|
|
176
10
|
type FromZodErrorOptions = {
|
|
177
11
|
maxIssuesInMessage?: number;
|
|
178
12
|
issueSeparator?: string;
|