avancement planning

This commit is contained in:
2026-05-26 11:58:39 +02:00
parent 619a2b240a
commit 150b97cd2e
4892 changed files with 99214 additions and 429382 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ class ZodError extends Error {
return this.issues.length === 0;
}
flatten(mapper = (issue) => issue.message) {
const fieldErrors = {};
const fieldErrors = Object.create(null);
const formErrors = [];
for (const sub of this.issues) {
if (sub.path.length > 0) {
+6 -6
View File
@@ -10,21 +10,21 @@ export type typeToFlattenedError<T, U = string> = {
};
};
export declare const ZodIssueCode: {
invalid_type: "invalid_type";
invalid_literal: "invalid_literal";
custom: "custom";
invalid_type: "invalid_type";
too_big: "too_big";
too_small: "too_small";
not_multiple_of: "not_multiple_of";
unrecognized_keys: "unrecognized_keys";
invalid_union: "invalid_union";
invalid_literal: "invalid_literal";
invalid_union_discriminator: "invalid_union_discriminator";
invalid_enum_value: "invalid_enum_value";
unrecognized_keys: "unrecognized_keys";
invalid_arguments: "invalid_arguments";
invalid_return_type: "invalid_return_type";
invalid_date: "invalid_date";
invalid_string: "invalid_string";
too_small: "too_small";
too_big: "too_big";
invalid_intersection_types: "invalid_intersection_types";
not_multiple_of: "not_multiple_of";
not_finite: "not_finite";
};
export type ZodIssueCode = keyof typeof ZodIssueCode;
+6 -6
View File
@@ -10,21 +10,21 @@ export type typeToFlattenedError<T, U = string> = {
};
};
export declare const ZodIssueCode: {
invalid_type: "invalid_type";
invalid_literal: "invalid_literal";
custom: "custom";
invalid_type: "invalid_type";
too_big: "too_big";
too_small: "too_small";
not_multiple_of: "not_multiple_of";
unrecognized_keys: "unrecognized_keys";
invalid_union: "invalid_union";
invalid_literal: "invalid_literal";
invalid_union_discriminator: "invalid_union_discriminator";
invalid_enum_value: "invalid_enum_value";
unrecognized_keys: "unrecognized_keys";
invalid_arguments: "invalid_arguments";
invalid_return_type: "invalid_return_type";
invalid_date: "invalid_date";
invalid_string: "invalid_string";
too_small: "too_small";
too_big: "too_big";
invalid_intersection_types: "invalid_intersection_types";
not_multiple_of: "not_multiple_of";
not_finite: "not_finite";
};
export type ZodIssueCode = keyof typeof ZodIssueCode;
+1 -1
View File
@@ -109,7 +109,7 @@ export class ZodError extends Error {
return this.issues.length === 0;
}
flatten(mapper = (issue) => issue.message) {
const fieldErrors = {};
const fieldErrors = Object.create(null);
const formErrors = [];
for (const sub of this.issues) {
if (sub.path.length > 0) {
+1
View File
@@ -109,3 +109,4 @@ const errorMap = (issue, _ctx) => {
return { message };
};
exports.default = errorMap;
module.exports = exports.default;
+1 -1
View File
@@ -1,3 +1,3 @@
import { type ZodErrorMap } from "../ZodError.cjs";
declare const errorMap: ZodErrorMap;
export default errorMap;
export = errorMap;
+2
View File
@@ -459,6 +459,7 @@ function isValidJWT(jwt, alg) {
.replace(/-/g, "+")
.replace(/_/g, "/")
.padEnd(header.length + ((4 - (header.length % 4)) % 4), "=");
// @ts-ignore
const decoded = JSON.parse(atob(base64));
if (typeof decoded !== "object" || decoded === null)
return false;
@@ -639,6 +640,7 @@ class ZodString extends ZodType {
}
else if (check.kind === "url") {
try {
// @ts-ignore
new URL(input.data);
}
catch {
+4 -1
View File
@@ -527,7 +527,10 @@ export type noUnrecognized<Obj extends object, Shape extends object> = {
[k in keyof Obj]: k extends keyof Shape ? Obj[k] : never;
};
export declare class ZodObject<T extends ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny, Output = objectOutputType<T, Catchall, UnknownKeys>, Input = objectInputType<T, Catchall, UnknownKeys>> extends ZodType<Output, ZodObjectDef<T, UnknownKeys, Catchall>, Input> {
private _cached;
_cached: {
shape: T;
keys: string[];
} | null;
_getCached(): {
shape: T;
keys: string[];
+4 -1
View File
@@ -527,7 +527,10 @@ export type noUnrecognized<Obj extends object, Shape extends object> = {
[k in keyof Obj]: k extends keyof Shape ? Obj[k] : never;
};
export declare class ZodObject<T extends ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny, Output = objectOutputType<T, Catchall, UnknownKeys>, Input = objectInputType<T, Catchall, UnknownKeys>> extends ZodType<Output, ZodObjectDef<T, UnknownKeys, Catchall>, Input> {
private _cached;
_cached: {
shape: T;
keys: string[];
} | null;
_getCached(): {
shape: T;
keys: string[];
+2
View File
@@ -450,6 +450,7 @@ function isValidJWT(jwt, alg) {
.replace(/-/g, "+")
.replace(/_/g, "/")
.padEnd(header.length + ((4 - (header.length % 4)) % 4), "=");
// @ts-ignore
const decoded = JSON.parse(atob(base64));
if (typeof decoded !== "object" || decoded === null)
return false;
@@ -630,6 +631,7 @@ export class ZodString extends ZodType {
}
else if (check.kind === "url") {
try {
// @ts-ignore
new URL(input.data);
}
catch {