full site update
This commit is contained in:
208
node_modules/zod/README.md
generated
vendored
Normal file
208
node_modules/zod/README.md
generated
vendored
Normal file
@@ -0,0 +1,208 @@
|
||||
<p align="center">
|
||||
<img src="logo.svg" width="200px" align="center" alt="Zod logo" />
|
||||
<h1 align="center">Zod</h1>
|
||||
<p align="center">
|
||||
TypeScript-first schema validation with static type inference
|
||||
<br/>
|
||||
by <a href="https://x.com/colinhacks">@colinhacks</a>
|
||||
</p>
|
||||
</p>
|
||||
<br/>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/colinhacks/zod/actions?query=branch%3Amaster"><img src="https://github.com/colinhacks/zod/actions/workflows/test.yml/badge.svg?event=push&branch=master" alt="Zod CI status" /></a>
|
||||
<a href="https://opensource.org/licenses/MIT" rel="nofollow"><img src="https://img.shields.io/github/license/colinhacks/zod" alt="License"></a>
|
||||
<a href="https://www.npmjs.com/package/zod" rel="nofollow"><img src="https://img.shields.io/npm/dw/zod.svg" alt="npm"></a>
|
||||
<a href="https://discord.gg/KaSRdyX2vc" rel="nofollow"><img src="https://img.shields.io/discord/893487829802418277?label=Discord&logo=discord&logoColor=white" alt="discord server"></a>
|
||||
<a href="https://github.com/colinhacks/zod" rel="nofollow"><img src="https://img.shields.io/github/stars/colinhacks/zod" alt="stars"></a>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
<a href="https://zod.dev/api">Docs</a>
|
||||
<span> • </span>
|
||||
<a href="https://discord.gg/RcG33DQJdf">Discord</a>
|
||||
<span> • </span>
|
||||
<a href="https://twitter.com/colinhacks">𝕏</a>
|
||||
<span> • </span>
|
||||
<a href="https://bsky.app/profile/zod.dev">Bluesky</a>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<h2 align="center">Featured sponsor: Jazz</h2>
|
||||
|
||||
<div align="center">
|
||||
<a href="https://jazz.tools/?utm_source=zod">
|
||||
<picture width="85%" >
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/garden-co/jazz/938f6767e46cdfded60e50d99bf3b533f4809c68/homepage/homepage/public/Zod%20sponsor%20message.png">
|
||||
<img alt="jazz logo" src="https://raw.githubusercontent.com/garden-co/jazz/938f6767e46cdfded60e50d99bf3b533f4809c68/homepage/homepage/public/Zod%20sponsor%20message.png" width="85%">
|
||||
</picture>
|
||||
</a>
|
||||
<br/>
|
||||
<p><sub>Learn more about <a target="_blank" rel="noopener noreferrer" href="mailto:sponsorship@colinhacks.com">featured sponsorships</a></sub></p>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
### [Read the docs →](https://zod.dev/api)
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
## What is Zod?
|
||||
|
||||
Zod is a TypeScript-first validation library. Define a schema and parse some data with it. You'll get back a strongly typed, validated result.
|
||||
|
||||
```ts
|
||||
import * as z from "zod/v4";
|
||||
|
||||
const User = z.object({
|
||||
name: z.string(),
|
||||
});
|
||||
|
||||
// some untrusted data...
|
||||
const input = {
|
||||
/* stuff */
|
||||
};
|
||||
|
||||
// the parsed result is validated and type safe!
|
||||
const data = User.parse(input);
|
||||
|
||||
// so you can use it with confidence :)
|
||||
console.log(data.name);
|
||||
```
|
||||
|
||||
<br/>
|
||||
|
||||
## Features
|
||||
|
||||
- Zero external dependencies
|
||||
- Works in Node.js and all modern browsers
|
||||
- Tiny: `2kb` core bundle (gzipped)
|
||||
- Immutable API: methods return a new instance
|
||||
- Concise interface
|
||||
- Works with TypeScript and plain JS
|
||||
- Built-in JSON Schema conversion
|
||||
- Extensive ecosystem
|
||||
|
||||
<br/>
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install zod
|
||||
```
|
||||
|
||||
<br/>
|
||||
|
||||
## Basic usage
|
||||
|
||||
Before you can do anything else, you need to define a schema. For the purposes of this guide, we'll use a simple object schema.
|
||||
|
||||
```ts
|
||||
import * as z from "zod/v4";
|
||||
|
||||
const Player = z.object({
|
||||
username: z.string(),
|
||||
xp: z.number(),
|
||||
});
|
||||
```
|
||||
|
||||
### Parsing data
|
||||
|
||||
Given any Zod schema, use `.parse` to validate an input. If it's valid, Zod returns a strongly-typed _deep clone_ of the input.
|
||||
|
||||
```ts
|
||||
Player.parse({ username: "billie", xp: 100 });
|
||||
// => returns { username: "billie", xp: 100 }
|
||||
```
|
||||
|
||||
**Note** — If your schema uses certain asynchronous APIs like `async` [refinements](#refine) or [transforms](#transform), you'll need to use the `.parseAsync()` method instead.
|
||||
|
||||
```ts
|
||||
const schema = z.string().refine(async (val) => val.length <= 8);
|
||||
|
||||
await schema.parseAsync("hello");
|
||||
// => "hello"
|
||||
```
|
||||
|
||||
### Handling errors
|
||||
|
||||
When validation fails, the `.parse()` method will throw a `ZodError` instance with granular information about the validation issues.
|
||||
|
||||
```ts
|
||||
try {
|
||||
Player.parse({ username: 42, xp: "100" });
|
||||
} catch (err) {
|
||||
if (err instanceof z.ZodError) {
|
||||
err.issues;
|
||||
/* [
|
||||
{
|
||||
expected: 'string',
|
||||
code: 'invalid_type',
|
||||
path: [ 'username' ],
|
||||
message: 'Invalid input: expected string'
|
||||
},
|
||||
{
|
||||
expected: 'number',
|
||||
code: 'invalid_type',
|
||||
path: [ 'xp' ],
|
||||
message: 'Invalid input: expected number'
|
||||
}
|
||||
] */
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
To avoid a `try/catch` block, you can use the `.safeParse()` method to get back a plain result object containing either the successfully parsed data or a `ZodError`. The result type is a [discriminated union](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions), so you can handle both cases conveniently.
|
||||
|
||||
```ts
|
||||
const result = Player.safeParse({ username: 42, xp: "100" });
|
||||
if (!result.success) {
|
||||
result.error; // ZodError instance
|
||||
} else {
|
||||
result.data; // { username: string; xp: number }
|
||||
}
|
||||
```
|
||||
|
||||
**Note** — If your schema uses certain asynchronous APIs like `async` [refinements](#refine) or [transforms](#transform), you'll need to use the `.safeParseAsync()` method instead.
|
||||
|
||||
```ts
|
||||
const schema = z.string().refine(async (val) => val.length <= 8);
|
||||
|
||||
await schema.safeParseAsync("hello");
|
||||
// => { success: true; data: "hello" }
|
||||
```
|
||||
|
||||
### Inferring types
|
||||
|
||||
Zod infers a static type from your schema definitions. You can extract this type with the `z.infer<>` utility and use it however you like.
|
||||
|
||||
```ts
|
||||
const Player = z.object({
|
||||
username: z.string(),
|
||||
xp: z.number(),
|
||||
});
|
||||
|
||||
// extract the inferred type
|
||||
type Player = z.infer<typeof Player>;
|
||||
|
||||
// use it in your code
|
||||
const player: Player = { username: "billie", xp: 100 };
|
||||
```
|
||||
|
||||
In some cases, the input & output types of a schema can diverge. For instance, the `.transform()` API can convert the input from one type to another. In these cases, you can extract the input and output types independently:
|
||||
|
||||
```ts
|
||||
const mySchema = z.string().transform((val) => val.length);
|
||||
|
||||
type MySchemaIn = z.input<typeof mySchema>;
|
||||
// => string
|
||||
|
||||
type MySchemaOut = z.output<typeof mySchema>; // equivalent to z.infer<typeof mySchema>
|
||||
// number
|
||||
```
|
||||
3
node_modules/zod/dist/cjs/package.json
generated
vendored
3
node_modules/zod/dist/cjs/package.json
generated
vendored
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
54
node_modules/zod/dist/cjs/v3/benchmarks/datetime.js
generated
vendored
54
node_modules/zod/dist/cjs/v3/benchmarks/datetime.js
generated
vendored
@@ -1,54 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const benchmark_1 = __importDefault(require("benchmark"));
|
||||
const datetimeValidationSuite = new benchmark_1.default.Suite("datetime");
|
||||
const DATA = "2021-01-01";
|
||||
const MONTHS_31 = new Set([1, 3, 5, 7, 8, 10, 12]);
|
||||
const MONTHS_30 = new Set([4, 6, 9, 11]);
|
||||
const simpleDatetimeRegex = /^(\d{4})-(\d{2})-(\d{2})$/;
|
||||
const datetimeRegexNoLeapYearValidation = /^\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\d|2\d))$/;
|
||||
const datetimeRegexWithLeapYearValidation = /^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))$/;
|
||||
datetimeValidationSuite
|
||||
.add("new Date()", () => {
|
||||
return !Number.isNaN(new Date(DATA).getTime());
|
||||
})
|
||||
.add("regex (no validation)", () => {
|
||||
return simpleDatetimeRegex.test(DATA);
|
||||
})
|
||||
.add("regex (no leap year)", () => {
|
||||
return datetimeRegexNoLeapYearValidation.test(DATA);
|
||||
})
|
||||
.add("regex (w/ leap year)", () => {
|
||||
return datetimeRegexWithLeapYearValidation.test(DATA);
|
||||
})
|
||||
.add("capture groups + code", () => {
|
||||
const match = DATA.match(simpleDatetimeRegex);
|
||||
if (!match)
|
||||
return false;
|
||||
// Extract year, month, and day from the capture groups
|
||||
const year = Number.parseInt(match[1], 10);
|
||||
const month = Number.parseInt(match[2], 10); // month is 0-indexed in JavaScript Date, so subtract 1
|
||||
const day = Number.parseInt(match[3], 10);
|
||||
if (month === 2) {
|
||||
if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {
|
||||
return day <= 29;
|
||||
}
|
||||
return day <= 28;
|
||||
}
|
||||
if (MONTHS_30.has(month)) {
|
||||
return day <= 30;
|
||||
}
|
||||
if (MONTHS_31.has(month)) {
|
||||
return day <= 31;
|
||||
}
|
||||
return false;
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${datetimeValidationSuite.name}: ${e.target}`);
|
||||
});
|
||||
exports.default = {
|
||||
suites: [datetimeValidationSuite],
|
||||
};
|
||||
79
node_modules/zod/dist/cjs/v3/benchmarks/discriminatedUnion.js
generated
vendored
79
node_modules/zod/dist/cjs/v3/benchmarks/discriminatedUnion.js
generated
vendored
@@ -1,79 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const benchmark_1 = __importDefault(require("benchmark"));
|
||||
const v3_1 = require("zod/v3");
|
||||
const doubleSuite = new benchmark_1.default.Suite("z.discriminatedUnion: double");
|
||||
const manySuite = new benchmark_1.default.Suite("z.discriminatedUnion: many");
|
||||
const aSchema = v3_1.z.object({
|
||||
type: v3_1.z.literal("a"),
|
||||
});
|
||||
const objA = {
|
||||
type: "a",
|
||||
};
|
||||
const bSchema = v3_1.z.object({
|
||||
type: v3_1.z.literal("b"),
|
||||
});
|
||||
const objB = {
|
||||
type: "b",
|
||||
};
|
||||
const cSchema = v3_1.z.object({
|
||||
type: v3_1.z.literal("c"),
|
||||
});
|
||||
const objC = {
|
||||
type: "c",
|
||||
};
|
||||
const dSchema = v3_1.z.object({
|
||||
type: v3_1.z.literal("d"),
|
||||
});
|
||||
const double = v3_1.z.discriminatedUnion("type", [aSchema, bSchema]);
|
||||
const many = v3_1.z.discriminatedUnion("type", [aSchema, bSchema, cSchema, dSchema]);
|
||||
doubleSuite
|
||||
.add("valid: a", () => {
|
||||
double.parse(objA);
|
||||
})
|
||||
.add("valid: b", () => {
|
||||
double.parse(objB);
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
double.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.add("invalid: wrong shape", () => {
|
||||
try {
|
||||
double.parse(objC);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${doubleSuite.name}: ${e.target}`);
|
||||
});
|
||||
manySuite
|
||||
.add("valid: a", () => {
|
||||
many.parse(objA);
|
||||
})
|
||||
.add("valid: c", () => {
|
||||
many.parse(objC);
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
many.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.add("invalid: wrong shape", () => {
|
||||
try {
|
||||
many.parse({ type: "unknown" });
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${manySuite.name}: ${e.target}`);
|
||||
});
|
||||
exports.default = {
|
||||
suites: [doubleSuite, manySuite],
|
||||
};
|
||||
59
node_modules/zod/dist/cjs/v3/benchmarks/index.js
generated
vendored
59
node_modules/zod/dist/cjs/v3/benchmarks/index.js
generated
vendored
@@ -1,59 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const datetime_js_1 = __importDefault(require("./datetime.js"));
|
||||
const discriminatedUnion_js_1 = __importDefault(require("./discriminatedUnion.js"));
|
||||
const ipv4_js_1 = __importDefault(require("./ipv4.js"));
|
||||
const object_js_1 = __importDefault(require("./object.js"));
|
||||
const primitives_js_1 = __importDefault(require("./primitives.js"));
|
||||
const realworld_js_1 = __importDefault(require("./realworld.js"));
|
||||
const string_js_1 = __importDefault(require("./string.js"));
|
||||
const union_js_1 = __importDefault(require("./union.js"));
|
||||
const argv = process.argv.slice(2);
|
||||
let suites = [];
|
||||
if (!argv.length) {
|
||||
suites = [
|
||||
...realworld_js_1.default.suites,
|
||||
...primitives_js_1.default.suites,
|
||||
...string_js_1.default.suites,
|
||||
...object_js_1.default.suites,
|
||||
...union_js_1.default.suites,
|
||||
...discriminatedUnion_js_1.default.suites,
|
||||
];
|
||||
}
|
||||
else {
|
||||
if (argv.includes("--realworld")) {
|
||||
suites.push(...realworld_js_1.default.suites);
|
||||
}
|
||||
if (argv.includes("--primitives")) {
|
||||
suites.push(...primitives_js_1.default.suites);
|
||||
}
|
||||
if (argv.includes("--string")) {
|
||||
suites.push(...string_js_1.default.suites);
|
||||
}
|
||||
if (argv.includes("--object")) {
|
||||
suites.push(...object_js_1.default.suites);
|
||||
}
|
||||
if (argv.includes("--union")) {
|
||||
suites.push(...union_js_1.default.suites);
|
||||
}
|
||||
if (argv.includes("--discriminatedUnion")) {
|
||||
suites.push(...datetime_js_1.default.suites);
|
||||
}
|
||||
if (argv.includes("--datetime")) {
|
||||
suites.push(...datetime_js_1.default.suites);
|
||||
}
|
||||
if (argv.includes("--ipv4")) {
|
||||
suites.push(...ipv4_js_1.default.suites);
|
||||
}
|
||||
}
|
||||
for (const suite of suites) {
|
||||
suite.run({});
|
||||
}
|
||||
// exit on Ctrl-C
|
||||
process.on("SIGINT", function () {
|
||||
console.log("Exiting...");
|
||||
process.exit();
|
||||
});
|
||||
54
node_modules/zod/dist/cjs/v3/benchmarks/ipv4.js
generated
vendored
54
node_modules/zod/dist/cjs/v3/benchmarks/ipv4.js
generated
vendored
@@ -1,54 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const benchmark_1 = __importDefault(require("benchmark"));
|
||||
const suite = new benchmark_1.default.Suite("ipv4");
|
||||
const DATA = "127.0.0.1";
|
||||
const ipv4RegexA = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;
|
||||
const ipv4RegexB = /^(?:(?:(?=(25[0-5]))\1|(?=(2[0-4][0-9]))\2|(?=(1[0-9]{2}))\3|(?=([0-9]{1,2}))\4)\.){3}(?:(?=(25[0-5]))\5|(?=(2[0-4][0-9]))\6|(?=(1[0-9]{2}))\7|(?=([0-9]{1,2}))\8)$/;
|
||||
const ipv4RegexC = /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;
|
||||
const ipv4RegexD = /^(\b25[0-5]|\b2[0-4][0-9]|\b[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/;
|
||||
const ipv4RegexE = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.){3}(25[0-5]|(2[0-4]|1\d|[1-9]|)\d)$/;
|
||||
const ipv4RegexF = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/;
|
||||
const ipv4RegexG = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/;
|
||||
const ipv4RegexH = /^((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])(\.(?!$)|$)){4}$/;
|
||||
const ipv4RegexI = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
||||
suite
|
||||
.add("A", () => {
|
||||
return ipv4RegexA.test(DATA);
|
||||
})
|
||||
.add("B", () => {
|
||||
return ipv4RegexB.test(DATA);
|
||||
})
|
||||
.add("C", () => {
|
||||
return ipv4RegexC.test(DATA);
|
||||
})
|
||||
.add("D", () => {
|
||||
return ipv4RegexD.test(DATA);
|
||||
})
|
||||
.add("E", () => {
|
||||
return ipv4RegexE.test(DATA);
|
||||
})
|
||||
.add("F", () => {
|
||||
return ipv4RegexF.test(DATA);
|
||||
})
|
||||
.add("G", () => {
|
||||
return ipv4RegexG.test(DATA);
|
||||
})
|
||||
.add("H", () => {
|
||||
return ipv4RegexH.test(DATA);
|
||||
})
|
||||
.add("I", () => {
|
||||
return ipv4RegexI.test(DATA);
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${suite.name}: ${e.target}`);
|
||||
});
|
||||
exports.default = {
|
||||
suites: [suite],
|
||||
};
|
||||
if (require.main === module) {
|
||||
suite.run();
|
||||
}
|
||||
70
node_modules/zod/dist/cjs/v3/benchmarks/object.js
generated
vendored
70
node_modules/zod/dist/cjs/v3/benchmarks/object.js
generated
vendored
@@ -1,70 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const benchmark_1 = __importDefault(require("benchmark"));
|
||||
const v3_1 = require("zod/v3");
|
||||
const emptySuite = new benchmark_1.default.Suite("z.object: empty");
|
||||
const shortSuite = new benchmark_1.default.Suite("z.object: short");
|
||||
const longSuite = new benchmark_1.default.Suite("z.object: long");
|
||||
const empty = v3_1.z.object({});
|
||||
const short = v3_1.z.object({
|
||||
string: v3_1.z.string(),
|
||||
});
|
||||
const long = v3_1.z.object({
|
||||
string: v3_1.z.string(),
|
||||
number: v3_1.z.number(),
|
||||
boolean: v3_1.z.boolean(),
|
||||
});
|
||||
emptySuite
|
||||
.add("valid", () => {
|
||||
empty.parse({});
|
||||
})
|
||||
.add("valid: extra keys", () => {
|
||||
empty.parse({ string: "string" });
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
empty.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${emptySuite.name}: ${e.target}`);
|
||||
});
|
||||
shortSuite
|
||||
.add("valid", () => {
|
||||
short.parse({ string: "string" });
|
||||
})
|
||||
.add("valid: extra keys", () => {
|
||||
short.parse({ string: "string", number: 42 });
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
short.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${shortSuite.name}: ${e.target}`);
|
||||
});
|
||||
longSuite
|
||||
.add("valid", () => {
|
||||
long.parse({ string: "string", number: 42, boolean: true });
|
||||
})
|
||||
.add("valid: extra keys", () => {
|
||||
long.parse({ string: "string", number: 42, boolean: true, list: [] });
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
long.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${longSuite.name}: ${e.target}`);
|
||||
});
|
||||
exports.default = {
|
||||
suites: [emptySuite, shortSuite, longSuite],
|
||||
};
|
||||
159
node_modules/zod/dist/cjs/v3/benchmarks/primitives.js
generated
vendored
159
node_modules/zod/dist/cjs/v3/benchmarks/primitives.js
generated
vendored
@@ -1,159 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const benchmark_1 = __importDefault(require("benchmark"));
|
||||
const v3_1 = require("zod/v3");
|
||||
const Mocker_js_1 = require("../tests/Mocker.js");
|
||||
const val = new Mocker_js_1.Mocker();
|
||||
const enumSuite = new benchmark_1.default.Suite("z.enum");
|
||||
const enumSchema = v3_1.z.enum(["a", "b", "c"]);
|
||||
enumSuite
|
||||
.add("valid", () => {
|
||||
enumSchema.parse("a");
|
||||
})
|
||||
.add("invalid", () => {
|
||||
try {
|
||||
enumSchema.parse("x");
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`z.enum: ${e.target}`);
|
||||
});
|
||||
const longEnumSuite = new benchmark_1.default.Suite("long z.enum");
|
||||
const longEnumSchema = v3_1.z.enum([
|
||||
"one",
|
||||
"two",
|
||||
"three",
|
||||
"four",
|
||||
"five",
|
||||
"six",
|
||||
"seven",
|
||||
"eight",
|
||||
"nine",
|
||||
"ten",
|
||||
"eleven",
|
||||
"twelve",
|
||||
"thirteen",
|
||||
"fourteen",
|
||||
"fifteen",
|
||||
"sixteen",
|
||||
"seventeen",
|
||||
]);
|
||||
longEnumSuite
|
||||
.add("valid", () => {
|
||||
longEnumSchema.parse("five");
|
||||
})
|
||||
.add("invalid", () => {
|
||||
try {
|
||||
longEnumSchema.parse("invalid");
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`long z.enum: ${e.target}`);
|
||||
});
|
||||
const undefinedSuite = new benchmark_1.default.Suite("z.undefined");
|
||||
const undefinedSchema = v3_1.z.undefined();
|
||||
undefinedSuite
|
||||
.add("valid", () => {
|
||||
undefinedSchema.parse(undefined);
|
||||
})
|
||||
.add("invalid", () => {
|
||||
try {
|
||||
undefinedSchema.parse(1);
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`z.undefined: ${e.target}`);
|
||||
});
|
||||
const literalSuite = new benchmark_1.default.Suite("z.literal");
|
||||
const short = "short";
|
||||
const bad = "bad";
|
||||
const literalSchema = v3_1.z.literal("short");
|
||||
literalSuite
|
||||
.add("valid", () => {
|
||||
literalSchema.parse(short);
|
||||
})
|
||||
.add("invalid", () => {
|
||||
try {
|
||||
literalSchema.parse(bad);
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`z.literal: ${e.target}`);
|
||||
});
|
||||
const numberSuite = new benchmark_1.default.Suite("z.number");
|
||||
const numberSchema = v3_1.z.number().int();
|
||||
numberSuite
|
||||
.add("valid", () => {
|
||||
numberSchema.parse(1);
|
||||
})
|
||||
.add("invalid type", () => {
|
||||
try {
|
||||
numberSchema.parse("bad");
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.add("invalid number", () => {
|
||||
try {
|
||||
numberSchema.parse(0.5);
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`z.number: ${e.target}`);
|
||||
});
|
||||
const dateSuite = new benchmark_1.default.Suite("z.date");
|
||||
const plainDate = v3_1.z.date();
|
||||
const minMaxDate = v3_1.z.date().min(new Date("2021-01-01")).max(new Date("2030-01-01"));
|
||||
dateSuite
|
||||
.add("valid", () => {
|
||||
plainDate.parse(new Date());
|
||||
})
|
||||
.add("invalid", () => {
|
||||
try {
|
||||
plainDate.parse(1);
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.add("valid min and max", () => {
|
||||
minMaxDate.parse(new Date("2023-01-01"));
|
||||
})
|
||||
.add("invalid min", () => {
|
||||
try {
|
||||
minMaxDate.parse(new Date("2019-01-01"));
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.add("invalid max", () => {
|
||||
try {
|
||||
minMaxDate.parse(new Date("2031-01-01"));
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`z.date: ${e.target}`);
|
||||
});
|
||||
const symbolSuite = new benchmark_1.default.Suite("z.symbol");
|
||||
const symbolSchema = v3_1.z.symbol();
|
||||
symbolSuite
|
||||
.add("valid", () => {
|
||||
symbolSchema.parse(val.symbol);
|
||||
})
|
||||
.add("invalid", () => {
|
||||
try {
|
||||
symbolSchema.parse(1);
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`z.symbol: ${e.target}`);
|
||||
});
|
||||
exports.default = {
|
||||
suites: [enumSuite, longEnumSuite, undefinedSuite, literalSuite, numberSuite, dateSuite, symbolSuite],
|
||||
};
|
||||
56
node_modules/zod/dist/cjs/v3/benchmarks/realworld.js
generated
vendored
56
node_modules/zod/dist/cjs/v3/benchmarks/realworld.js
generated
vendored
@@ -1,56 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const benchmark_1 = __importDefault(require("benchmark"));
|
||||
const v3_1 = require("zod/v3");
|
||||
const shortSuite = new benchmark_1.default.Suite("realworld");
|
||||
const People = v3_1.z.array(v3_1.z.object({
|
||||
type: v3_1.z.literal("person"),
|
||||
hair: v3_1.z.enum(["blue", "brown"]),
|
||||
active: v3_1.z.boolean(),
|
||||
name: v3_1.z.string(),
|
||||
age: v3_1.z.number().int(),
|
||||
hobbies: v3_1.z.array(v3_1.z.string()),
|
||||
address: v3_1.z.object({
|
||||
street: v3_1.z.string(),
|
||||
zip: v3_1.z.string(),
|
||||
country: v3_1.z.string(),
|
||||
}),
|
||||
}));
|
||||
let i = 0;
|
||||
function num() {
|
||||
return ++i;
|
||||
}
|
||||
function str() {
|
||||
return (++i % 100).toString(16);
|
||||
}
|
||||
function array(fn) {
|
||||
return Array.from({ length: ++i % 10 }, () => fn());
|
||||
}
|
||||
const people = Array.from({ length: 100 }, () => {
|
||||
return {
|
||||
type: "person",
|
||||
hair: i % 2 ? "blue" : "brown",
|
||||
active: !!(i % 2),
|
||||
name: str(),
|
||||
age: num(),
|
||||
hobbies: array(str),
|
||||
address: {
|
||||
street: str(),
|
||||
zip: str(),
|
||||
country: str(),
|
||||
},
|
||||
};
|
||||
});
|
||||
shortSuite
|
||||
.add("valid", () => {
|
||||
People.parse(people);
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${shortSuite.name}: ${e.target}`);
|
||||
});
|
||||
exports.default = {
|
||||
suites: [shortSuite],
|
||||
};
|
||||
55
node_modules/zod/dist/cjs/v3/benchmarks/string.js
generated
vendored
55
node_modules/zod/dist/cjs/v3/benchmarks/string.js
generated
vendored
@@ -1,55 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const benchmark_1 = __importDefault(require("benchmark"));
|
||||
const v3_1 = require("zod/v3");
|
||||
const SUITE_NAME = "z.string";
|
||||
const suite = new benchmark_1.default.Suite(SUITE_NAME);
|
||||
const empty = "";
|
||||
const short = "short";
|
||||
const long = "long".repeat(256);
|
||||
const manual = (str) => {
|
||||
if (typeof str !== "string") {
|
||||
throw new Error("Not a string");
|
||||
}
|
||||
return str;
|
||||
};
|
||||
const stringSchema = v3_1.z.string();
|
||||
const optionalStringSchema = v3_1.z.string().optional();
|
||||
const optionalNullableStringSchema = v3_1.z.string().optional().nullable();
|
||||
suite
|
||||
.add("empty string", () => {
|
||||
stringSchema.parse(empty);
|
||||
})
|
||||
.add("short string", () => {
|
||||
stringSchema.parse(short);
|
||||
})
|
||||
.add("long string", () => {
|
||||
stringSchema.parse(long);
|
||||
})
|
||||
.add("optional string", () => {
|
||||
optionalStringSchema.parse(long);
|
||||
})
|
||||
.add("nullable string", () => {
|
||||
optionalNullableStringSchema.parse(long);
|
||||
})
|
||||
.add("nullable (null) string", () => {
|
||||
optionalNullableStringSchema.parse(null);
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
stringSchema.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.add("manual parser: long", () => {
|
||||
manual(long);
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${SUITE_NAME}: ${e.target}`);
|
||||
});
|
||||
exports.default = {
|
||||
suites: [suite],
|
||||
};
|
||||
79
node_modules/zod/dist/cjs/v3/benchmarks/union.js
generated
vendored
79
node_modules/zod/dist/cjs/v3/benchmarks/union.js
generated
vendored
@@ -1,79 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const benchmark_1 = __importDefault(require("benchmark"));
|
||||
const v3_1 = require("zod/v3");
|
||||
const doubleSuite = new benchmark_1.default.Suite("z.union: double");
|
||||
const manySuite = new benchmark_1.default.Suite("z.union: many");
|
||||
const aSchema = v3_1.z.object({
|
||||
type: v3_1.z.literal("a"),
|
||||
});
|
||||
const objA = {
|
||||
type: "a",
|
||||
};
|
||||
const bSchema = v3_1.z.object({
|
||||
type: v3_1.z.literal("b"),
|
||||
});
|
||||
const objB = {
|
||||
type: "b",
|
||||
};
|
||||
const cSchema = v3_1.z.object({
|
||||
type: v3_1.z.literal("c"),
|
||||
});
|
||||
const objC = {
|
||||
type: "c",
|
||||
};
|
||||
const dSchema = v3_1.z.object({
|
||||
type: v3_1.z.literal("d"),
|
||||
});
|
||||
const double = v3_1.z.union([aSchema, bSchema]);
|
||||
const many = v3_1.z.union([aSchema, bSchema, cSchema, dSchema]);
|
||||
doubleSuite
|
||||
.add("valid: a", () => {
|
||||
double.parse(objA);
|
||||
})
|
||||
.add("valid: b", () => {
|
||||
double.parse(objB);
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
double.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.add("invalid: wrong shape", () => {
|
||||
try {
|
||||
double.parse(objC);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${doubleSuite.name}: ${e.target}`);
|
||||
});
|
||||
manySuite
|
||||
.add("valid: a", () => {
|
||||
many.parse(objA);
|
||||
})
|
||||
.add("valid: c", () => {
|
||||
many.parse(objC);
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
many.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.add("invalid: wrong shape", () => {
|
||||
try {
|
||||
many.parse({ type: "unknown" });
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${manySuite.name}: ${e.target}`);
|
||||
});
|
||||
exports.default = {
|
||||
suites: [doubleSuite, manySuite],
|
||||
};
|
||||
57
node_modules/zod/dist/cjs/v3/tests/Mocker.js
generated
vendored
57
node_modules/zod/dist/cjs/v3/tests/Mocker.js
generated
vendored
@@ -1,57 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Mocker = void 0;
|
||||
function getRandomInt(max) {
|
||||
return Math.floor(Math.random() * Math.floor(max));
|
||||
}
|
||||
const testSymbol = Symbol("test");
|
||||
class Mocker {
|
||||
constructor() {
|
||||
this.pick = (...args) => {
|
||||
return args[getRandomInt(args.length)];
|
||||
};
|
||||
}
|
||||
get string() {
|
||||
return Math.random().toString(36).substring(7);
|
||||
}
|
||||
get number() {
|
||||
return Math.random() * 100;
|
||||
}
|
||||
get bigint() {
|
||||
return BigInt(Math.floor(Math.random() * 10000));
|
||||
}
|
||||
get boolean() {
|
||||
return Math.random() < 0.5;
|
||||
}
|
||||
get date() {
|
||||
return new Date(Math.floor(Date.now() * Math.random()));
|
||||
}
|
||||
get symbol() {
|
||||
return testSymbol;
|
||||
}
|
||||
get null() {
|
||||
return null;
|
||||
}
|
||||
get undefined() {
|
||||
return undefined;
|
||||
}
|
||||
get stringOptional() {
|
||||
return this.pick(this.string, this.undefined);
|
||||
}
|
||||
get stringNullable() {
|
||||
return this.pick(this.string, this.null);
|
||||
}
|
||||
get numberOptional() {
|
||||
return this.pick(this.number, this.undefined);
|
||||
}
|
||||
get numberNullable() {
|
||||
return this.pick(this.number, this.null);
|
||||
}
|
||||
get booleanOptional() {
|
||||
return this.pick(this.boolean, this.undefined);
|
||||
}
|
||||
get booleanNullable() {
|
||||
return this.pick(this.boolean, this.null);
|
||||
}
|
||||
}
|
||||
exports.Mocker = Mocker;
|
||||
58
node_modules/zod/dist/cjs/v4/classic/external.js
generated
vendored
58
node_modules/zod/dist/cjs/v4/classic/external.js
generated
vendored
@@ -1,58 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.locales = exports.toJSONSchema = exports.flattenError = exports.formatError = exports.prettifyError = exports.treeifyError = exports.regexes = exports.clone = exports.$brand = exports.$input = exports.$output = exports.function = exports.config = exports.registry = exports.globalRegistry = exports.core = void 0;
|
||||
exports.core = __importStar(require("zod/v4/core"));
|
||||
__exportStar(require("./schemas.js"), exports);
|
||||
__exportStar(require("./checks.js"), exports);
|
||||
__exportStar(require("./errors.js"), exports);
|
||||
__exportStar(require("./parse.js"), exports);
|
||||
__exportStar(require("./compat.js"), exports);
|
||||
// zod-specified
|
||||
const core_1 = require("zod/v4/core");
|
||||
const en_js_1 = __importDefault(require("zod/v4/locales/en.js"));
|
||||
(0, core_1.config)((0, en_js_1.default)());
|
||||
var core_2 = require("zod/v4/core");
|
||||
Object.defineProperty(exports, "globalRegistry", { enumerable: true, get: function () { return core_2.globalRegistry; } });
|
||||
Object.defineProperty(exports, "registry", { enumerable: true, get: function () { return core_2.registry; } });
|
||||
Object.defineProperty(exports, "config", { enumerable: true, get: function () { return core_2.config; } });
|
||||
Object.defineProperty(exports, "function", { enumerable: true, get: function () { return core_2.function; } });
|
||||
Object.defineProperty(exports, "$output", { enumerable: true, get: function () { return core_2.$output; } });
|
||||
Object.defineProperty(exports, "$input", { enumerable: true, get: function () { return core_2.$input; } });
|
||||
Object.defineProperty(exports, "$brand", { enumerable: true, get: function () { return core_2.$brand; } });
|
||||
Object.defineProperty(exports, "clone", { enumerable: true, get: function () { return core_2.clone; } });
|
||||
Object.defineProperty(exports, "regexes", { enumerable: true, get: function () { return core_2.regexes; } });
|
||||
Object.defineProperty(exports, "treeifyError", { enumerable: true, get: function () { return core_2.treeifyError; } });
|
||||
Object.defineProperty(exports, "prettifyError", { enumerable: true, get: function () { return core_2.prettifyError; } });
|
||||
Object.defineProperty(exports, "formatError", { enumerable: true, get: function () { return core_2.formatError; } });
|
||||
Object.defineProperty(exports, "flattenError", { enumerable: true, get: function () { return core_2.flattenError; } });
|
||||
Object.defineProperty(exports, "toJSONSchema", { enumerable: true, get: function () { return core_2.toJSONSchema; } });
|
||||
Object.defineProperty(exports, "locales", { enumerable: true, get: function () { return core_2.locales; } });
|
||||
10
node_modules/zod/dist/cjs/v4/core/config.js
generated
vendored
10
node_modules/zod/dist/cjs/v4/core/config.js
generated
vendored
@@ -1,10 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.globalConfig = void 0;
|
||||
exports.config = config;
|
||||
exports.globalConfig = {};
|
||||
function config(config) {
|
||||
if (config)
|
||||
Object.assign(exports.globalConfig, config);
|
||||
return exports.globalConfig;
|
||||
}
|
||||
59
node_modules/zod/dist/cjs/v4/core/core.js
generated
vendored
59
node_modules/zod/dist/cjs/v4/core/core.js
generated
vendored
@@ -1,59 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.globalConfig = exports.$ZodAsyncError = exports.$brand = void 0;
|
||||
exports.$constructor = $constructor;
|
||||
exports.config = config;
|
||||
function $constructor(name, initializer, params) {
|
||||
const Parent = params?.Parent ?? Object;
|
||||
class _ extends Parent {
|
||||
constructor(def) {
|
||||
var _a;
|
||||
super();
|
||||
const th = this;
|
||||
_.init(th, def);
|
||||
(_a = th._zod).deferred ?? (_a.deferred = []);
|
||||
for (const fn of th._zod.deferred) {
|
||||
fn();
|
||||
}
|
||||
}
|
||||
static init(inst, def) {
|
||||
var _a;
|
||||
Object.defineProperty(inst, "_zod", {
|
||||
value: inst._zod ?? {},
|
||||
enumerable: false,
|
||||
});
|
||||
// inst._zod ??= {} as any;
|
||||
(_a = inst._zod).traits ?? (_a.traits = new Set());
|
||||
// const seen = inst._zod.traits.has(name);
|
||||
inst._zod.traits.add(name);
|
||||
initializer(inst, def);
|
||||
// support prototype modifications
|
||||
for (const k in _.prototype) {
|
||||
Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });
|
||||
}
|
||||
inst._zod.constr = _;
|
||||
inst._zod.def = def;
|
||||
}
|
||||
static [Symbol.hasInstance](inst) {
|
||||
if (params?.Parent && inst instanceof params.Parent)
|
||||
return true;
|
||||
return inst?._zod?.traits?.has(name);
|
||||
}
|
||||
}
|
||||
Object.defineProperty(_, "name", { value: name });
|
||||
return _;
|
||||
}
|
||||
////////////////////////////// UTILITIES ///////////////////////////////////////
|
||||
exports.$brand = Symbol("zod_brand");
|
||||
class $ZodAsyncError extends Error {
|
||||
constructor() {
|
||||
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
||||
}
|
||||
}
|
||||
exports.$ZodAsyncError = $ZodAsyncError;
|
||||
exports.globalConfig = {};
|
||||
function config(newConfig) {
|
||||
if (newConfig)
|
||||
Object.assign(exports.globalConfig, newConfig);
|
||||
return exports.globalConfig;
|
||||
}
|
||||
669
node_modules/zod/dist/cjs/v4/core/to-json-schema.js
generated
vendored
669
node_modules/zod/dist/cjs/v4/core/to-json-schema.js
generated
vendored
@@ -1,669 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.JSONSchemaGenerator = void 0;
|
||||
exports.toJSONSchema = toJSONSchema;
|
||||
const registries_js_1 = require("./registries.js");
|
||||
const formatMap = {
|
||||
guid: "uuid",
|
||||
url: "uri",
|
||||
datetime: "date-time",
|
||||
json_string: "json-string",
|
||||
};
|
||||
class JSONSchemaGenerator {
|
||||
constructor(params) {
|
||||
this.counter = 0;
|
||||
this.metadataRegistry = params?.metadata ?? registries_js_1.globalRegistry;
|
||||
this.target = params?.target ?? "draft-2020-12";
|
||||
this.unrepresentable = params?.unrepresentable ?? "throw";
|
||||
this.override = params?.override ?? (() => { });
|
||||
this.io = params?.io ?? "output";
|
||||
this.seen = new Map();
|
||||
}
|
||||
process(schema, _params = { path: [], schemaPath: [] }) {
|
||||
var _a;
|
||||
const def = schema._zod.def;
|
||||
// check for schema in seens
|
||||
const seen = this.seen.get(schema);
|
||||
if (seen) {
|
||||
seen.count++;
|
||||
// check if cycle
|
||||
const isCycle = _params.schemaPath.includes(schema);
|
||||
if (isCycle) {
|
||||
seen.cycle = _params.path;
|
||||
}
|
||||
seen.count++;
|
||||
// break cycle
|
||||
return seen.schema;
|
||||
}
|
||||
// initialize
|
||||
const result = { schema: {}, count: 1, cycle: undefined };
|
||||
this.seen.set(schema, result);
|
||||
if (schema._zod.toJSONSchema) {
|
||||
// custom method overrides default behavior
|
||||
result.schema = schema._zod.toJSONSchema();
|
||||
}
|
||||
// check if external
|
||||
// const ext = this.external?.registry.get(schema)?.id;
|
||||
// if (ext) {
|
||||
// result.external = ext;
|
||||
// }
|
||||
const params = {
|
||||
..._params,
|
||||
schemaPath: [..._params.schemaPath, schema],
|
||||
path: _params.path,
|
||||
};
|
||||
const parent = schema._zod.parent;
|
||||
// if (parent) {
|
||||
// // schema was cloned from another schema
|
||||
// result.ref = parent;
|
||||
// this.process(parent, params);
|
||||
// this.seen.get(parent)!.isParent = true;
|
||||
// }
|
||||
if (parent) {
|
||||
// schema was cloned from another schema
|
||||
result.ref = parent;
|
||||
this.process(parent, params);
|
||||
this.seen.get(parent).isParent = true;
|
||||
}
|
||||
else {
|
||||
const _json = result.schema;
|
||||
switch (def.type) {
|
||||
case "string": {
|
||||
const json = _json;
|
||||
json.type = "string";
|
||||
const { minimum, maximum, format, pattern, contentEncoding } = schema._zod.bag;
|
||||
if (typeof minimum === "number")
|
||||
json.minLength = minimum;
|
||||
if (typeof maximum === "number")
|
||||
json.maxLength = maximum;
|
||||
// custom pattern overrides format
|
||||
if (format) {
|
||||
json.format = formatMap[format] ?? format;
|
||||
}
|
||||
if (pattern) {
|
||||
json.pattern = pattern.source;
|
||||
}
|
||||
if (contentEncoding)
|
||||
json.contentEncoding = contentEncoding;
|
||||
break;
|
||||
}
|
||||
case "number": {
|
||||
const json = _json;
|
||||
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
|
||||
if (typeof format === "string" && format.includes("int"))
|
||||
json.type = "integer";
|
||||
else
|
||||
json.type = "number";
|
||||
if (typeof exclusiveMinimum === "number")
|
||||
json.exclusiveMinimum = exclusiveMinimum;
|
||||
if (typeof minimum === "number") {
|
||||
json.minimum = minimum;
|
||||
if (typeof exclusiveMinimum === "number") {
|
||||
if (exclusiveMinimum >= minimum)
|
||||
delete json.minimum;
|
||||
else
|
||||
delete json.exclusiveMinimum;
|
||||
}
|
||||
}
|
||||
if (typeof exclusiveMaximum === "number")
|
||||
json.exclusiveMaximum = exclusiveMaximum;
|
||||
if (typeof maximum === "number") {
|
||||
json.maximum = maximum;
|
||||
if (typeof exclusiveMaximum === "number") {
|
||||
if (exclusiveMaximum <= maximum)
|
||||
delete json.maximum;
|
||||
else
|
||||
delete json.exclusiveMaximum;
|
||||
}
|
||||
}
|
||||
if (typeof multipleOf === "number")
|
||||
json.multipleOf = multipleOf;
|
||||
break;
|
||||
}
|
||||
case "boolean": {
|
||||
const json = _json;
|
||||
json.type = "boolean";
|
||||
break;
|
||||
}
|
||||
case "bigint": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("BigInt cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "symbol": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Symbols cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "undefined": {
|
||||
const json = _json;
|
||||
json.type = "null";
|
||||
break;
|
||||
}
|
||||
case "null": {
|
||||
_json.type = "null";
|
||||
break;
|
||||
}
|
||||
case "any": {
|
||||
break;
|
||||
}
|
||||
case "unknown": {
|
||||
break;
|
||||
}
|
||||
case "never": {
|
||||
_json.not = {};
|
||||
break;
|
||||
}
|
||||
case "void": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Void cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "date": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Date cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "array": {
|
||||
const json = _json;
|
||||
const { minimum, maximum } = schema._zod.bag;
|
||||
if (typeof minimum === "number")
|
||||
json.minItems = minimum;
|
||||
if (typeof maximum === "number")
|
||||
json.maxItems = maximum;
|
||||
json.type = "array";
|
||||
json.items = this.process(def.element, { ...params, path: [...params.path, "items"] });
|
||||
break;
|
||||
}
|
||||
case "object": {
|
||||
const json = _json;
|
||||
json.type = "object";
|
||||
json.properties = {};
|
||||
const shape = def.shape; // params.shapeCache.get(schema)!;
|
||||
for (const key in shape) {
|
||||
json.properties[key] = this.process(shape[key], {
|
||||
...params,
|
||||
path: [...params.path, "properties", key],
|
||||
});
|
||||
}
|
||||
// required keys
|
||||
const allKeys = new Set(Object.keys(shape));
|
||||
// const optionalKeys = new Set(def.optional);
|
||||
const requiredKeys = new Set([...allKeys].filter((key) => {
|
||||
const v = def.shape[key]._zod;
|
||||
if (this.io === "input") {
|
||||
return v.optin === undefined;
|
||||
}
|
||||
else {
|
||||
return v.optout === undefined;
|
||||
}
|
||||
}));
|
||||
json.required = Array.from(requiredKeys);
|
||||
// catchall
|
||||
if (def.catchall?._zod.def.type === "never") {
|
||||
json.additionalProperties = false;
|
||||
}
|
||||
else if (def.catchall) {
|
||||
json.additionalProperties = this.process(def.catchall, {
|
||||
...params,
|
||||
path: [...params.path, "additionalProperties"],
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "union": {
|
||||
const json = _json;
|
||||
json.anyOf = def.options.map((x, i) => this.process(x, {
|
||||
...params,
|
||||
path: [...params.path, "anyOf", i],
|
||||
}));
|
||||
break;
|
||||
}
|
||||
case "intersection": {
|
||||
const json = _json;
|
||||
json.allOf = [
|
||||
this.process(def.left, {
|
||||
...params,
|
||||
path: [...params.path, "allOf", 0],
|
||||
}),
|
||||
this.process(def.right, {
|
||||
...params,
|
||||
path: [...params.path, "allOf", 1],
|
||||
}),
|
||||
];
|
||||
break;
|
||||
}
|
||||
case "tuple": {
|
||||
const json = _json;
|
||||
json.type = "array";
|
||||
const prefixItems = def.items.map((x, i) => this.process(x, { ...params, path: [...params.path, "prefixItems", i] }));
|
||||
if (this.target === "draft-2020-12") {
|
||||
json.prefixItems = prefixItems;
|
||||
}
|
||||
else {
|
||||
json.items = prefixItems;
|
||||
}
|
||||
if (def.rest) {
|
||||
const rest = this.process(def.rest, {
|
||||
...params,
|
||||
path: [...params.path, "items"],
|
||||
});
|
||||
if (this.target === "draft-2020-12") {
|
||||
json.items = rest;
|
||||
}
|
||||
else {
|
||||
json.additionalItems = rest;
|
||||
}
|
||||
}
|
||||
// additionalItems
|
||||
if (def.rest) {
|
||||
json.items = this.process(def.rest, {
|
||||
...params,
|
||||
path: [...params.path, "items"],
|
||||
});
|
||||
}
|
||||
// length
|
||||
const { minimum, maximum } = schema._zod.bag;
|
||||
if (typeof minimum === "number")
|
||||
json.minItems = minimum;
|
||||
if (typeof maximum === "number")
|
||||
json.maxItems = maximum;
|
||||
break;
|
||||
}
|
||||
case "record": {
|
||||
const json = _json;
|
||||
json.type = "object";
|
||||
json.propertyNames = this.process(def.keyType, { ...params, path: [...params.path, "propertyNames"] });
|
||||
json.additionalProperties = this.process(def.valueType, {
|
||||
...params,
|
||||
path: [...params.path, "additionalProperties"],
|
||||
});
|
||||
break;
|
||||
}
|
||||
case "map": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Map cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "set": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Set cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "enum": {
|
||||
const json = _json;
|
||||
json.enum = Object.values(def.entries);
|
||||
break;
|
||||
}
|
||||
case "literal": {
|
||||
const json = _json;
|
||||
const vals = [];
|
||||
for (const val of def.values) {
|
||||
if (val === undefined) {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
||||
}
|
||||
else {
|
||||
// do not add to vals
|
||||
}
|
||||
}
|
||||
else if (typeof val === "bigint") {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
||||
}
|
||||
else {
|
||||
vals.push(Number(val));
|
||||
}
|
||||
}
|
||||
else {
|
||||
vals.push(val);
|
||||
}
|
||||
}
|
||||
if (vals.length === 0) {
|
||||
// do nothing (an undefined literal was stripped)
|
||||
}
|
||||
else if (vals.length === 1) {
|
||||
const val = vals[0];
|
||||
json.const = val;
|
||||
}
|
||||
else {
|
||||
json.enum = vals;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "file": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("File cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "transform": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Transforms cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "nullable": {
|
||||
const inner = this.process(def.innerType, params);
|
||||
_json.anyOf = [inner, { type: "null" }];
|
||||
break;
|
||||
}
|
||||
case "nonoptional": {
|
||||
this.process(def.innerType, params);
|
||||
result.ref = def.innerType;
|
||||
break;
|
||||
}
|
||||
case "success": {
|
||||
const json = _json;
|
||||
json.type = "boolean";
|
||||
break;
|
||||
}
|
||||
case "default": {
|
||||
this.process(def.innerType, params);
|
||||
result.ref = def.innerType;
|
||||
_json.default = def.defaultValue;
|
||||
break;
|
||||
}
|
||||
case "prefault": {
|
||||
this.process(def.innerType, params);
|
||||
result.ref = def.innerType;
|
||||
if (this.io === "input")
|
||||
_json._prefault = def.defaultValue;
|
||||
break;
|
||||
}
|
||||
case "catch": {
|
||||
// use conditionals
|
||||
this.process(def.innerType, params);
|
||||
result.ref = def.innerType;
|
||||
let catchValue;
|
||||
try {
|
||||
catchValue = def.catchValue(undefined);
|
||||
}
|
||||
catch {
|
||||
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
||||
}
|
||||
_json.default = catchValue;
|
||||
break;
|
||||
}
|
||||
case "nan": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("NaN cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "template_literal": {
|
||||
const json = _json;
|
||||
const pattern = schema._zod.pattern;
|
||||
if (!pattern)
|
||||
throw new Error("Pattern not found in template literal");
|
||||
json.type = "string";
|
||||
json.pattern = pattern.source;
|
||||
break;
|
||||
}
|
||||
case "pipe": {
|
||||
const innerType = this.io === "input" ? def.in : def.out;
|
||||
this.process(innerType, params);
|
||||
result.ref = innerType;
|
||||
break;
|
||||
}
|
||||
case "readonly": {
|
||||
this.process(def.innerType, params);
|
||||
result.ref = def.innerType;
|
||||
_json.readOnly = true;
|
||||
break;
|
||||
}
|
||||
// passthrough types
|
||||
case "promise": {
|
||||
this.process(def.innerType, params);
|
||||
result.ref = def.innerType;
|
||||
break;
|
||||
}
|
||||
case "optional": {
|
||||
this.process(def.innerType, params);
|
||||
result.ref = def.innerType;
|
||||
break;
|
||||
}
|
||||
case "lazy": {
|
||||
const innerType = schema._zod.innerType;
|
||||
this.process(innerType, params);
|
||||
result.ref = innerType;
|
||||
break;
|
||||
}
|
||||
case "custom": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Custom types cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
def;
|
||||
}
|
||||
}
|
||||
}
|
||||
// metadata
|
||||
const meta = this.metadataRegistry.get(schema);
|
||||
if (meta)
|
||||
Object.assign(result.schema, meta);
|
||||
if (this.io === "input" && def.type === "pipe") {
|
||||
// examples/defaults only apply to output type of pipe
|
||||
delete result.schema.examples;
|
||||
delete result.schema.default;
|
||||
if (result.schema._prefault)
|
||||
result.schema.default = result.schema._prefault;
|
||||
}
|
||||
if (this.io === "input" && result.schema._prefault)
|
||||
(_a = result.schema).default ?? (_a.default = result.schema._prefault);
|
||||
delete result.schema._prefault;
|
||||
// pulling fresh from this.seen in case it was overwritten
|
||||
const _result = this.seen.get(schema);
|
||||
return _result.schema;
|
||||
}
|
||||
emit(schema, _params) {
|
||||
const params = {
|
||||
cycles: _params?.cycles ?? "ref",
|
||||
reused: _params?.reused ?? "inline",
|
||||
// unrepresentable: _params?.unrepresentable ?? "throw",
|
||||
// uri: _params?.uri ?? ((id) => `${id}`),
|
||||
external: _params?.external ?? undefined,
|
||||
};
|
||||
// iterate over seen map;
|
||||
const root = this.seen.get(schema);
|
||||
if (!root)
|
||||
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
||||
// initialize result with root schema fields
|
||||
// Object.assign(result, seen.cached);
|
||||
const makeURI = (entry) => {
|
||||
// comparing the seen objects because sometimes
|
||||
// multiple schemas map to the same seen object.
|
||||
// e.g. lazy
|
||||
// external is configured
|
||||
const defsSegment = this.target === "draft-2020-12" ? "$defs" : "definitions";
|
||||
if (params.external) {
|
||||
const externalId = params.external.registry.get(entry[0])?.id; // ?? "__shared";// `__schema${this.counter++}`;
|
||||
// check if schema is in the external registry
|
||||
if (externalId)
|
||||
return { ref: params.external.uri(externalId) };
|
||||
// otherwise, add to __shared
|
||||
const id = entry[1].defId ?? entry[1].schema.id ?? `schema${this.counter++}`;
|
||||
entry[1].defId = id;
|
||||
return { defId: id, ref: `${params.external.uri("__shared")}#/${defsSegment}/${id}` };
|
||||
}
|
||||
if (entry[1] === root) {
|
||||
return { ref: "#" };
|
||||
}
|
||||
// self-contained schema
|
||||
const uriPrefix = `#`;
|
||||
const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
|
||||
const defId = entry[1].schema.id ?? `__schema${this.counter++}`;
|
||||
return { defId, ref: defUriPrefix + defId };
|
||||
};
|
||||
const extractToDef = (entry) => {
|
||||
if (entry[1].schema.$ref) {
|
||||
return;
|
||||
}
|
||||
const seen = entry[1];
|
||||
const { ref, defId } = makeURI(entry);
|
||||
seen.def = { ...seen.schema };
|
||||
// defId won't be set if the schema is a reference to an external schema
|
||||
if (defId)
|
||||
seen.defId = defId;
|
||||
// wipe away all properties except $ref
|
||||
const schema = seen.schema;
|
||||
for (const key in schema) {
|
||||
delete schema[key];
|
||||
schema.$ref = ref;
|
||||
}
|
||||
};
|
||||
// extract schemas into $defs
|
||||
for (const entry of this.seen.entries()) {
|
||||
const seen = entry[1];
|
||||
// convert root schema to # $ref
|
||||
// also prevents root schema from being extracted
|
||||
if (schema === entry[0]) {
|
||||
// do not copy to defs...this is the root schema
|
||||
extractToDef(entry);
|
||||
continue;
|
||||
}
|
||||
// extract schemas that are in the external registry
|
||||
if (params.external) {
|
||||
const ext = params.external.registry.get(entry[0])?.id;
|
||||
if (schema !== entry[0] && ext) {
|
||||
extractToDef(entry);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// extract schemas with `id` meta
|
||||
const id = this.metadataRegistry.get(entry[0])?.id;
|
||||
if (id) {
|
||||
extractToDef(entry);
|
||||
continue;
|
||||
}
|
||||
// break cycles
|
||||
if (seen.cycle) {
|
||||
if (params.cycles === "throw") {
|
||||
throw new Error("Cycle detected: " +
|
||||
`#/${seen.cycle?.join("/")}/<root>` +
|
||||
'\n\nSet the `cycles` parameter to `"ref"` to resolve cyclical schemas with defs.');
|
||||
}
|
||||
else if (params.cycles === "ref") {
|
||||
extractToDef(entry);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// extract reused schemas
|
||||
if (seen.count > 1) {
|
||||
if (params.reused === "ref") {
|
||||
extractToDef(entry);
|
||||
// biome-ignore lint:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
// flatten _refs
|
||||
const flattenRef = (zodSchema, params) => {
|
||||
const seen = this.seen.get(zodSchema);
|
||||
const schema = seen.def ?? seen.schema;
|
||||
const _schema = { ...schema };
|
||||
if (seen.ref === null) {
|
||||
return;
|
||||
}
|
||||
const ref = seen.ref;
|
||||
seen.ref = null;
|
||||
if (ref) {
|
||||
flattenRef(ref, params);
|
||||
const refSchema = this.seen.get(ref).schema;
|
||||
if (refSchema.$ref && params.target === "draft-7") {
|
||||
schema.allOf = schema.allOf ?? [];
|
||||
schema.allOf.push(refSchema);
|
||||
}
|
||||
else {
|
||||
Object.assign(schema, refSchema);
|
||||
Object.assign(schema, _schema); // this is to prevent overwriting any fields in the original schema
|
||||
}
|
||||
}
|
||||
if (!seen.isParent)
|
||||
this.override({
|
||||
zodSchema,
|
||||
jsonSchema: schema,
|
||||
});
|
||||
};
|
||||
for (const entry of [...this.seen.entries()].reverse()) {
|
||||
flattenRef(entry[0], { target: this.target });
|
||||
}
|
||||
const result = { ...root.def };
|
||||
const defs = params.external?.defs ?? {};
|
||||
for (const entry of this.seen.entries()) {
|
||||
const seen = entry[1];
|
||||
if (seen.def && seen.defId) {
|
||||
defs[seen.defId] = seen.def;
|
||||
}
|
||||
}
|
||||
// set definitions in result
|
||||
if (!params.external && Object.keys(defs).length > 0) {
|
||||
if (this.target === "draft-2020-12") {
|
||||
result.$defs = defs;
|
||||
}
|
||||
else {
|
||||
result.definitions = defs;
|
||||
}
|
||||
}
|
||||
if (this.target === "draft-2020-12") {
|
||||
result.$schema = "https://json-schema.org/draft/2020-12/schema";
|
||||
}
|
||||
else if (this.target === "draft-7") {
|
||||
result.$schema = "http://json-schema.org/draft-07/schema#";
|
||||
}
|
||||
else {
|
||||
console.warn(`Invalid target: ${this.target}`);
|
||||
}
|
||||
try {
|
||||
// this "finalizes" this schema and ensures all cycles are removed
|
||||
// each call to .emit() is functionally independent
|
||||
// though the seen map is shared
|
||||
return JSON.parse(JSON.stringify(result));
|
||||
}
|
||||
catch (_err) {
|
||||
throw new Error("Error converting schema to JSON.");
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.JSONSchemaGenerator = JSONSchemaGenerator;
|
||||
function toJSONSchema(input, _params) {
|
||||
if (input instanceof registries_js_1.$ZodRegistry) {
|
||||
const gen = new JSONSchemaGenerator(_params);
|
||||
const defs = {};
|
||||
for (const entry of input._idmap.entries()) {
|
||||
const [_, schema] = entry;
|
||||
gen.process(schema);
|
||||
}
|
||||
const schemas = {};
|
||||
const external = {
|
||||
registry: input,
|
||||
uri: _params?.uri || ((id) => id),
|
||||
defs,
|
||||
};
|
||||
for (const entry of input._idmap.entries()) {
|
||||
const [key, schema] = entry;
|
||||
schemas[key] = gen.emit(schema, {
|
||||
..._params,
|
||||
external,
|
||||
});
|
||||
}
|
||||
if (Object.keys(defs).length > 0) {
|
||||
const defsSegment = gen.target === "draft-2020-12" ? "$defs" : "definitions";
|
||||
schemas.__shared = {
|
||||
[defsSegment]: defs,
|
||||
};
|
||||
}
|
||||
return { schemas };
|
||||
}
|
||||
const gen = new JSONSchemaGenerator(_params);
|
||||
gen.process(input);
|
||||
return gen.emit(input, _params);
|
||||
}
|
||||
172
node_modules/zod/dist/cjs/v4/core/zsf.js
generated
vendored
172
node_modules/zod/dist/cjs/v4/core/zsf.js
generated
vendored
@@ -1,172 +0,0 @@
|
||||
"use strict";
|
||||
///////////////////////////////////////////////////
|
||||
//////////////// TYPES ///////////////////
|
||||
///////////////////////////////////////////////////
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
/////////////////////////////////////////////////
|
||||
//////////////// CHECKS ////////////////
|
||||
/////////////////////////////////////////////////
|
||||
// export interface $ZSFCheckRegex {
|
||||
// check: "regex";
|
||||
// pattern: string;
|
||||
// }
|
||||
// export interface $ZSFCheckEmail {
|
||||
// check: "email";
|
||||
// }
|
||||
// export interface $ZSFCheckURL {
|
||||
// check: "url";
|
||||
// }
|
||||
// export interface $ZSFCheckEmoji {
|
||||
// check: "emoji";
|
||||
// }
|
||||
// export interface $ZSFCheckUUID {
|
||||
// check: "uuid";
|
||||
// }
|
||||
// export interface $ZSFCheckUUIDv4 {
|
||||
// check: "uuidv4";
|
||||
// }
|
||||
// export interface $ZSFCheckUUIDv6 {
|
||||
// check: "uuidv6";
|
||||
// }
|
||||
// export interface $ZSFCheckNanoid {
|
||||
// check: "nanoid";
|
||||
// }
|
||||
// export interface $ZSFCheckGUID {
|
||||
// check: "guid";
|
||||
// }
|
||||
// export interface $ZSFCheckCUID {
|
||||
// check: "cuid";
|
||||
// }
|
||||
// export interface $ZSFCheckCUID2 {
|
||||
// check: "cuid2";
|
||||
// }
|
||||
// export interface $ZSFCheckULID {
|
||||
// check: "ulid";
|
||||
// }
|
||||
// export interface $ZSFCheckXID {
|
||||
// check: "xid";
|
||||
// }
|
||||
// export interface $ZSFCheckKSUID {
|
||||
// check: "ksuid";
|
||||
// }
|
||||
// export interface $ZSFCheckISODateTime {
|
||||
// check: "datetime";
|
||||
// precision?: number;
|
||||
// local?: boolean;
|
||||
// }
|
||||
// export interface $ZSFCheckISODate {
|
||||
// check: "date";
|
||||
// }
|
||||
// export interface $ZSFCheckISOTime {
|
||||
// check: "time";
|
||||
// precision?: number;
|
||||
// local?: boolean;
|
||||
// }
|
||||
// export interface $ZSFCheckDuration {
|
||||
// check: "duration";
|
||||
// }
|
||||
// export interface $ZSFCheckIP {
|
||||
// check: "ip";
|
||||
// }
|
||||
// export interface $ZSFCheckIPv4 {
|
||||
// check: "ipv4";
|
||||
// }
|
||||
// export interface $ZSFCheckIPv6 {
|
||||
// check: "ipv6";
|
||||
// }
|
||||
// export interface $ZSFCheckBase64 {
|
||||
// check: "base64";
|
||||
// }
|
||||
// export interface $ZSFCheckJWT {
|
||||
// check: "jwt";
|
||||
// }
|
||||
// export interface $ZSFCheckJSONString {
|
||||
// check: "json_string";
|
||||
// }
|
||||
// export interface $ZSFCheckPrefix {
|
||||
// check: "prefix";
|
||||
// prefix: string;
|
||||
// }
|
||||
// export interface $ZSFCheckSuffix {
|
||||
// check: "suffix";
|
||||
// suffix: string;
|
||||
// }
|
||||
// export interface $ZSFCheckIncludes {
|
||||
// check: "includes";
|
||||
// includes: string;
|
||||
// }
|
||||
// export interface $ZSFCheckMinSize {
|
||||
// check: "min_size";
|
||||
// minimum: number;
|
||||
// }
|
||||
// export interface $ZSFCheckMaxSize {
|
||||
// check: "max_size";
|
||||
// maximum: number;
|
||||
// }
|
||||
// export interface $ZSFCheckSizeEquals {
|
||||
// check: "size_equals";
|
||||
// size: number;
|
||||
// }
|
||||
// export interface $ZSFCheckLessThan {
|
||||
// check: "less_than";
|
||||
// maximum: number | bigint | Date;
|
||||
// }
|
||||
// export interface $ZSFCheckLessThanOrEqual {
|
||||
// check: "less_than_or_equal";
|
||||
// maximum: number | bigint | Date;
|
||||
// }
|
||||
// export interface $ZSFCheckGreaterThan {
|
||||
// check: "greater_than";
|
||||
// minimum: number | bigint | Date;
|
||||
// }
|
||||
// export interface $ZSFCheckGreaterThanOrEqual {
|
||||
// check: "greater_than_or_equal";
|
||||
// minimum: number | bigint | Date;
|
||||
// }
|
||||
// export interface $ZSFCheckEquals {
|
||||
// check: "equals";
|
||||
// value: number | bigint | Date;
|
||||
// }
|
||||
// export interface $ZSFCheckMultipleOf {
|
||||
// check: "multiple_of";
|
||||
// multipleOf: number;
|
||||
// }
|
||||
// export type $ZSFStringFormatChecks =
|
||||
// | $ZSFCheckRegex
|
||||
// | $ZSFCheckEmail
|
||||
// | $ZSFCheckURL
|
||||
// | $ZSFCheckEmoji
|
||||
// | $ZSFCheckUUID
|
||||
// | $ZSFCheckUUIDv4
|
||||
// | $ZSFCheckUUIDv6
|
||||
// | $ZSFCheckNanoid
|
||||
// | $ZSFCheckGUID
|
||||
// | $ZSFCheckCUID
|
||||
// | $ZSFCheckCUID2
|
||||
// | $ZSFCheckULID
|
||||
// | $ZSFCheckXID
|
||||
// | $ZSFCheckKSUID
|
||||
// | $ZSFCheckISODateTime
|
||||
// | $ZSFCheckISODate
|
||||
// | $ZSFCheckISOTime
|
||||
// | $ZSFCheckDuration
|
||||
// | $ZSFCheckIP
|
||||
// | $ZSFCheckIPv4
|
||||
// | $ZSFCheckIPv6
|
||||
// | $ZSFCheckBase64
|
||||
// | $ZSFCheckJWT
|
||||
// | $ZSFCheckJSONString
|
||||
// | $ZSFCheckPrefix
|
||||
// | $ZSFCheckSuffix
|
||||
// | $ZSFCheckIncludes;
|
||||
// export type $ZSFCheck =
|
||||
// | $ZSFStringFormatChecks
|
||||
// | $ZSFCheckMinSize
|
||||
// | $ZSFCheckMaxSize
|
||||
// | $ZSFCheckSizeEquals
|
||||
// | $ZSFCheckLessThan
|
||||
// | $ZSFCheckLessThanOrEqual
|
||||
// | $ZSFCheckGreaterThan
|
||||
// | $ZSFCheckGreaterThanOrEqual
|
||||
// | $ZSFCheckEquals
|
||||
// | $ZSFCheckMultipleOf;
|
||||
143
node_modules/zod/dist/cjs/v4/locales/ar.js
generated
vendored
143
node_modules/zod/dist/cjs/v4/locales/ar.js
generated
vendored
@@ -1,143 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "حرف", verb: "أن يحوي" },
|
||||
file: { unit: "بايت", verb: "أن يحوي" },
|
||||
array: { unit: "عنصر", verb: "أن يحوي" },
|
||||
set: { unit: "عنصر", verb: "أن يحوي" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "مدخل",
|
||||
email: "بريد إلكتروني",
|
||||
url: "رابط",
|
||||
emoji: "إيموجي",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "تاريخ ووقت بمعيار ISO",
|
||||
date: "تاريخ بمعيار ISO",
|
||||
time: "وقت بمعيار ISO",
|
||||
duration: "مدة بمعيار ISO",
|
||||
ipv4: "عنوان IPv4",
|
||||
ipv6: "عنوان IPv6",
|
||||
cidrv4: "مدى عناوين بصيغة IPv4",
|
||||
cidrv6: "مدى عناوين بصيغة IPv6",
|
||||
base64: "نَص بترميز base64-encoded",
|
||||
base64url: "نَص بترميز base64url-encoded",
|
||||
json_string: "نَص على هيئة JSON",
|
||||
e164: "رقم هاتف بمعيار E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "مدخل",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `مدخلات غير مقبولة: يفترض إدخال ${issue.expected}، ولكن تم إدخال ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `مدخلات غير مقبولة: يفترض إدخال ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return ` أكبر من اللازم: يفترض أن تكون ${issue.origin ?? "القيمة"} ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "عنصر"}`;
|
||||
return `أكبر من اللازم: يفترض أن تكون ${issue.origin ?? "القيمة"} ${adj} ${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `أصغر من اللازم: يفترض لـ ${issue.origin} أن يكون ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `أصغر من اللازم: يفترض لـ ${issue.origin} أن يكون ${adj} ${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `نَص غير مقبول: يجب أن يبدأ بـ "${issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `نَص غير مقبول: يجب أن ينتهي بـ "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `نَص غير مقبول: يجب أن يتضمَّن "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `نَص غير مقبول: يجب أن يطابق النمط ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} غير مقبول`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `رقم غير مقبول: يجب أن يكون من مضاعفات ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `معرف${issue.keys.length > 1 ? "ات" : ""} غريب${issue.keys.length > 1 ? "ة" : ""}: ${util.joinValues(issue.keys, "، ")}`;
|
||||
case "invalid_key":
|
||||
return `معرف غير مقبول في ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "مدخل غير مقبول";
|
||||
case "invalid_element":
|
||||
return `مدخل غير مقبول في ${issue.origin}`;
|
||||
default:
|
||||
return "مدخل غير مقبول";
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
142
node_modules/zod/dist/cjs/v4/locales/az.js
generated
vendored
142
node_modules/zod/dist/cjs/v4/locales/az.js
generated
vendored
@@ -1,142 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "simvol", verb: "olmalıdır" },
|
||||
file: { unit: "bayt", verb: "olmalıdır" },
|
||||
array: { unit: "element", verb: "olmalıdır" },
|
||||
set: { unit: "element", verb: "olmalıdır" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "input",
|
||||
email: "email address",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO datetime",
|
||||
date: "ISO date",
|
||||
time: "ISO time",
|
||||
duration: "ISO duration",
|
||||
ipv4: "IPv4 address",
|
||||
ipv6: "IPv6 address",
|
||||
cidrv4: "IPv4 range",
|
||||
cidrv6: "IPv6 range",
|
||||
base64: "base64-encoded string",
|
||||
base64url: "base64url-encoded string",
|
||||
json_string: "JSON string",
|
||||
e164: "E.164 number",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Yanlış dəyər: gözlənilən ${issue.expected}, daxil olan ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Yanlış dəyər: gözlənilən ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Yanlış seçim: aşağıdakılardan biri olmalıdır: ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Çox böyük: gözlənilən ${issue.origin ?? "dəyər"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "element"}`;
|
||||
return `Çox böyük: gözlənilən ${issue.origin ?? "dəyər"} ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Çox kiçik: gözlənilən ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
return `Çox kiçik: gözlənilən ${issue.origin} ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Yanlış mətn: "${_issue.prefix}" ilə başlamalıdır`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Yanlış mətn: "${_issue.suffix}" ilə bitməlidir`;
|
||||
if (_issue.format === "includes")
|
||||
return `Yanlış mətn: "${_issue.includes}" daxil olmalıdır`;
|
||||
if (_issue.format === "regex")
|
||||
return `Yanlış mətn: ${_issue.pattern} şablonuna uyğun olmalıdır`;
|
||||
return `Yanlış ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Yanlış ədəd: ${issue.divisor} ilə bölünə bilən olmalıdır`;
|
||||
case "unrecognized_keys":
|
||||
return `Tanınmayan açar${issue.keys.length > 1 ? "lar" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} daxilində yanlış açar`;
|
||||
case "invalid_union":
|
||||
return "Yanlış dəyər";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} daxilində yanlış dəyər`;
|
||||
default:
|
||||
return `Yanlış dəyər`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
191
node_modules/zod/dist/cjs/v4/locales/be.js
generated
vendored
191
node_modules/zod/dist/cjs/v4/locales/be.js
generated
vendored
@@ -1,191 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
function getBelarusianPlural(count, one, few, many) {
|
||||
const absCount = Math.abs(count);
|
||||
const lastDigit = absCount % 10;
|
||||
const lastTwoDigits = absCount % 100;
|
||||
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
||||
return many;
|
||||
}
|
||||
if (lastDigit === 1) {
|
||||
return one;
|
||||
}
|
||||
if (lastDigit >= 2 && lastDigit <= 4) {
|
||||
return few;
|
||||
}
|
||||
return many;
|
||||
}
|
||||
const Sizable = {
|
||||
string: {
|
||||
unit: {
|
||||
one: "сімвал",
|
||||
few: "сімвалы",
|
||||
many: "сімвалаў",
|
||||
},
|
||||
verb: "мець",
|
||||
},
|
||||
array: {
|
||||
unit: {
|
||||
one: "элемент",
|
||||
few: "элементы",
|
||||
many: "элементаў",
|
||||
},
|
||||
verb: "мець",
|
||||
},
|
||||
set: {
|
||||
unit: {
|
||||
one: "элемент",
|
||||
few: "элементы",
|
||||
many: "элементаў",
|
||||
},
|
||||
verb: "мець",
|
||||
},
|
||||
file: {
|
||||
unit: {
|
||||
one: "байт",
|
||||
few: "байты",
|
||||
many: "байтаў",
|
||||
},
|
||||
verb: "мець",
|
||||
},
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "лік";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "масіў";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "увод",
|
||||
email: "email адрас",
|
||||
url: "URL",
|
||||
emoji: "эмодзі",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO дата і час",
|
||||
date: "ISO дата",
|
||||
time: "ISO час",
|
||||
duration: "ISO працягласць",
|
||||
ipv4: "IPv4 адрас",
|
||||
ipv6: "IPv6 адрас",
|
||||
cidrv4: "IPv4 дыяпазон",
|
||||
cidrv6: "IPv6 дыяпазон",
|
||||
base64: "радок у фармаце base64",
|
||||
base64url: "радок у фармаце base64url",
|
||||
json_string: "JSON радок",
|
||||
e164: "нумар E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "увод",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Няправільны ўвод: чакаўся ${issue.expected}, атрымана ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Няправільны ўвод: чакалася ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Няправільны варыянт: чакаўся адзін з ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
const maxValue = Number(issue.maximum);
|
||||
const unit = getBelarusianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
|
||||
return `Занадта вялікі: чакалася, што ${issue.origin ?? "значэнне"} павінна ${sizing.verb} ${adj}${issue.maximum.toString()} ${unit}`;
|
||||
}
|
||||
return `Занадта вялікі: чакалася, што ${issue.origin ?? "значэнне"} павінна быць ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
const minValue = Number(issue.minimum);
|
||||
const unit = getBelarusianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
|
||||
return `Занадта малы: чакалася, што ${issue.origin} павінна ${sizing.verb} ${adj}${issue.minimum.toString()} ${unit}`;
|
||||
}
|
||||
return `Занадта малы: чакалася, што ${issue.origin} павінна быць ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Няправільны радок: павінен пачынацца з "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Няправільны радок: павінен заканчвацца на "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Няправільны радок: павінен змяшчаць "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Няправільны радок: павінен адпавядаць шаблону ${_issue.pattern}`;
|
||||
return `Няправільны ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Няправільны лік: павінен быць кратным ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Нераспазнаны ${issue.keys.length > 1 ? "ключы" : "ключ"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Няправільны ключ у ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Няправільны ўвод";
|
||||
case "invalid_element":
|
||||
return `Няправільнае значэнне ў ${issue.origin}`;
|
||||
default:
|
||||
return `Няправільны ўвод`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
145
node_modules/zod/dist/cjs/v4/locales/ca.js
generated
vendored
145
node_modules/zod/dist/cjs/v4/locales/ca.js
generated
vendored
@@ -1,145 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "caràcters", verb: "contenir" },
|
||||
file: { unit: "bytes", verb: "contenir" },
|
||||
array: { unit: "elements", verb: "contenir" },
|
||||
set: { unit: "elements", verb: "contenir" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "entrada",
|
||||
email: "adreça electrònica",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "data i hora ISO",
|
||||
date: "data ISO",
|
||||
time: "hora ISO",
|
||||
duration: "durada ISO",
|
||||
ipv4: "adreça IPv4",
|
||||
ipv6: "adreça IPv6",
|
||||
cidrv4: "rang IPv4",
|
||||
cidrv6: "rang IPv6",
|
||||
base64: "cadena codificada en base64",
|
||||
base64url: "cadena codificada en base64url",
|
||||
json_string: "cadena JSON",
|
||||
e164: "número E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "entrada",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Tipus invàlid: s'esperava ${issue.expected}, s'ha rebut ${(0, exports.parsedType)(issue.input)}`;
|
||||
// return `Tipus invàlid: s'esperava ${issue.expected}, s'ha rebut ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Valor invàlid: s'esperava ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Opció invàlida: s'esperava una de ${util.joinValues(issue.values, " o ")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "com a màxim" : "menys de";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Massa gran: s'esperava que ${issue.origin ?? "el valor"} contingués ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
|
||||
return `Massa gran: s'esperava que ${issue.origin ?? "el valor"} fos ${adj} ${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? "com a mínim" : "més de";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Massa petit: s'esperava que ${issue.origin} contingués ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Massa petit: s'esperava que ${issue.origin} fos ${adj} ${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `Format invàlid: ha de començar amb "${_issue.prefix}"`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `Format invàlid: ha d'acabar amb "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Format invàlid: ha d'incloure "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Format invàlid: ha de coincidir amb el patró ${_issue.pattern}`;
|
||||
return `Format invàlid per a ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Número invàlid: ha de ser múltiple de ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Clau${issue.keys.length > 1 ? "s" : ""} no reconeguda${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Clau invàlida a ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Entrada invàlida"; // Could also be "Tipus d'unió invàlid" but "Entrada invàlida" is more general
|
||||
case "invalid_element":
|
||||
return `Element invàlid a ${issue.origin}`;
|
||||
default:
|
||||
return `Entrada invàlida`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
162
node_modules/zod/dist/cjs/v4/locales/cs.js
generated
vendored
162
node_modules/zod/dist/cjs/v4/locales/cs.js
generated
vendored
@@ -1,162 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "znaků", verb: "mít" },
|
||||
file: { unit: "bajtů", verb: "mít" },
|
||||
array: { unit: "prvků", verb: "mít" },
|
||||
set: { unit: "prvků", verb: "mít" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "číslo";
|
||||
}
|
||||
case "string": {
|
||||
return "řetězec";
|
||||
}
|
||||
case "boolean": {
|
||||
return "boolean";
|
||||
}
|
||||
case "bigint": {
|
||||
return "bigint";
|
||||
}
|
||||
case "function": {
|
||||
return "funkce";
|
||||
}
|
||||
case "symbol": {
|
||||
return "symbol";
|
||||
}
|
||||
case "undefined": {
|
||||
return "undefined";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "pole";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "regulární výraz",
|
||||
email: "e-mailová adresa",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "datum a čas ve formátu ISO",
|
||||
date: "datum ve formátu ISO",
|
||||
time: "čas ve formátu ISO",
|
||||
duration: "doba trvání ISO",
|
||||
ipv4: "IPv4 adresa",
|
||||
ipv6: "IPv6 adresa",
|
||||
cidrv4: "rozsah IPv4",
|
||||
cidrv6: "rozsah IPv6",
|
||||
base64: "řetězec zakódovaný ve formátu base64",
|
||||
base64url: "řetězec zakódovaný ve formátu base64url",
|
||||
json_string: "řetězec ve formátu JSON",
|
||||
e164: "číslo E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "vstup",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Neplatný vstup: očekáváno ${issue.expected}, obdrženo ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Neplatný vstup: očekáváno ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Neplatná možnost: očekávána jedna z hodnot ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Hodnota je příliš velká: ${issue.origin ?? "hodnota"} musí mít ${adj}${issue.maximum.toString()} ${sizing.unit ?? "prvků"}`;
|
||||
}
|
||||
return `Hodnota je příliš velká: ${issue.origin ?? "hodnota"} musí být ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Hodnota je příliš malá: ${issue.origin ?? "hodnota"} musí mít ${adj}${issue.minimum.toString()} ${sizing.unit ?? "prvků"}`;
|
||||
}
|
||||
return `Hodnota je příliš malá: ${issue.origin ?? "hodnota"} musí být ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Neplatný řetězec: musí začínat na "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Neplatný řetězec: musí končit na "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Neplatný řetězec: musí obsahovat "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Neplatný řetězec: musí odpovídat vzoru ${_issue.pattern}`;
|
||||
return `Neplatný formát ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Neplatné číslo: musí být násobkem ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Neznámé klíče: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Neplatný klíč v ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Neplatný vstup";
|
||||
case "invalid_element":
|
||||
return `Neplatná hodnota v ${issue.origin}`;
|
||||
default:
|
||||
return `Neplatný vstup`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
143
node_modules/zod/dist/cjs/v4/locales/de.js
generated
vendored
143
node_modules/zod/dist/cjs/v4/locales/de.js
generated
vendored
@@ -1,143 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "Zeichen", verb: "zu haben" },
|
||||
file: { unit: "Bytes", verb: "zu haben" },
|
||||
array: { unit: "Elemente", verb: "zu haben" },
|
||||
set: { unit: "Elemente", verb: "zu haben" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "Zahl";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "Array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "Eingabe",
|
||||
email: "E-Mail-Adresse",
|
||||
url: "URL",
|
||||
emoji: "Emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO-Datum und -Uhrzeit",
|
||||
date: "ISO-Datum",
|
||||
time: "ISO-Uhrzeit",
|
||||
duration: "ISO-Dauer",
|
||||
ipv4: "IPv4-Adresse",
|
||||
ipv6: "IPv6-Adresse",
|
||||
cidrv4: "IPv4-Bereich",
|
||||
cidrv6: "IPv6-Bereich",
|
||||
base64: "Base64-codierter String",
|
||||
base64url: "Base64-URL-codierter String",
|
||||
json_string: "JSON-String",
|
||||
e164: "E.164-Nummer",
|
||||
jwt: "JWT",
|
||||
template_literal: "Eingabe",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Ungültige Eingabe: erwartet ${issue.expected}, erhalten ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Ungültige Eingabe: erwartet ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Ungültige Option: erwartet eine von ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Zu groß: erwartet, dass ${issue.origin ?? "Wert"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "Elemente"} hat`;
|
||||
return `Zu groß: erwartet, dass ${issue.origin ?? "Wert"} ${adj}${issue.maximum.toString()} ist`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Zu klein: erwartet, dass ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} hat`;
|
||||
}
|
||||
return `Zu klein: erwartet, dass ${issue.origin} ${adj}${issue.minimum.toString()} ist`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Ungültiger String: muss mit "${_issue.prefix}" beginnen`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Ungültiger String: muss mit "${_issue.suffix}" enden`;
|
||||
if (_issue.format === "includes")
|
||||
return `Ungültiger String: muss "${_issue.includes}" enthalten`;
|
||||
if (_issue.format === "regex")
|
||||
return `Ungültiger String: muss dem Muster ${_issue.pattern} entsprechen`;
|
||||
return `Ungültig: ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Ungültige Zahl: muss ein Vielfaches von ${issue.divisor} sein`;
|
||||
case "unrecognized_keys":
|
||||
return `${issue.keys.length > 1 ? "Unbekannte Schlüssel" : "Unbekannter Schlüssel"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Ungültiger Schlüssel in ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Ungültige Eingabe";
|
||||
case "invalid_element":
|
||||
return `Ungültiger Wert in ${issue.origin}`;
|
||||
default:
|
||||
return `Ungültige Eingabe`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
145
node_modules/zod/dist/cjs/v4/locales/en.js
generated
vendored
145
node_modules/zod/dist/cjs/v4/locales/en.js
generated
vendored
@@ -1,145 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "characters", verb: "to have" },
|
||||
file: { unit: "bytes", verb: "to have" },
|
||||
array: { unit: "items", verb: "to have" },
|
||||
set: { unit: "items", verb: "to have" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "input",
|
||||
email: "email address",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO datetime",
|
||||
date: "ISO date",
|
||||
time: "ISO time",
|
||||
duration: "ISO duration",
|
||||
ipv4: "IPv4 address",
|
||||
ipv6: "IPv6 address",
|
||||
cidrv4: "IPv4 range",
|
||||
cidrv6: "IPv6 range",
|
||||
base64: "base64-encoded string",
|
||||
base64url: "base64url-encoded string",
|
||||
json_string: "JSON string",
|
||||
e164: "E.164 number",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Invalid input: expected ${issue.expected}, received ${(0, exports.parsedType)(issue.input)}`;
|
||||
// return `Invalid input: expected ${issue.expected}, received ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Invalid option: expected one of ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Too big: expected ${issue.origin ?? "value"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
|
||||
return `Too big: expected ${issue.origin ?? "value"} to be ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `Invalid string: must start with "${_issue.prefix}"`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `Invalid string: must end with "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Invalid string: must include "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Invalid string: must match pattern ${_issue.pattern}`;
|
||||
return `Invalid ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Invalid number: must be a multiple of ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Unrecognized key${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Invalid key in ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Invalid input";
|
||||
case "invalid_element":
|
||||
return `Invalid value in ${issue.origin}`;
|
||||
default:
|
||||
return `Invalid input`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
144
node_modules/zod/dist/cjs/v4/locales/es.js
generated
vendored
144
node_modules/zod/dist/cjs/v4/locales/es.js
generated
vendored
@@ -1,144 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "caracteres", verb: "tener" },
|
||||
file: { unit: "bytes", verb: "tener" },
|
||||
array: { unit: "elementos", verb: "tener" },
|
||||
set: { unit: "elementos", verb: "tener" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "número";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "arreglo";
|
||||
}
|
||||
if (data === null) {
|
||||
return "nulo";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "entrada",
|
||||
email: "dirección de correo electrónico",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "fecha y hora ISO",
|
||||
date: "fecha ISO",
|
||||
time: "hora ISO",
|
||||
duration: "duración ISO",
|
||||
ipv4: "dirección IPv4",
|
||||
ipv6: "dirección IPv6",
|
||||
cidrv4: "rango IPv4",
|
||||
cidrv6: "rango IPv6",
|
||||
base64: "cadena codificada en base64",
|
||||
base64url: "URL codificada en base64",
|
||||
json_string: "cadena JSON",
|
||||
e164: "número E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "entrada",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Entrada inválida: se esperaba ${issue.expected}, recibido ${(0, exports.parsedType)(issue.input)}`;
|
||||
// return `Entrada inválida: se esperaba ${issue.expected}, recibido ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Entrada inválida: se esperaba ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Opción inválida: se esperaba una de ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Demasiado grande: se esperaba que ${issue.origin ?? "valor"} tuviera ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementos"}`;
|
||||
return `Demasiado grande: se esperaba que ${issue.origin ?? "valor"} fuera ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Demasiado pequeño: se esperaba que ${issue.origin} tuviera ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Demasiado pequeño: se esperaba que ${issue.origin} fuera ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Cadena inválida: debe comenzar con "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Cadena inválida: debe terminar en "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Cadena inválida: debe incluir "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Cadena inválida: debe coincidir con el patrón ${_issue.pattern}`;
|
||||
return `Inválido ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Número inválido: debe ser múltiplo de ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Llave${issue.keys.length > 1 ? "s" : ""} desconocida${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Llave inválida en ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Entrada inválida";
|
||||
case "invalid_element":
|
||||
return `Valor inválido en ${issue.origin}`;
|
||||
default:
|
||||
return `Entrada inválida`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
149
node_modules/zod/dist/cjs/v4/locales/fa.js
generated
vendored
149
node_modules/zod/dist/cjs/v4/locales/fa.js
generated
vendored
@@ -1,149 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "کاراکتر", verb: "داشته باشد" },
|
||||
file: { unit: "بایت", verb: "داشته باشد" },
|
||||
array: { unit: "آیتم", verb: "داشته باشد" },
|
||||
set: { unit: "آیتم", verb: "داشته باشد" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "عدد";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "آرایه";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "ورودی",
|
||||
email: "آدرس ایمیل",
|
||||
url: "URL",
|
||||
emoji: "ایموجی",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "تاریخ و زمان ایزو",
|
||||
date: "تاریخ ایزو",
|
||||
time: "زمان ایزو",
|
||||
duration: "مدت زمان ایزو",
|
||||
ipv4: "IPv4 آدرس",
|
||||
ipv6: "IPv6 آدرس",
|
||||
cidrv4: "IPv4 دامنه",
|
||||
cidrv6: "IPv6 دامنه",
|
||||
base64: "base64-encoded رشته",
|
||||
base64url: "base64url-encoded رشته",
|
||||
json_string: "JSON رشته",
|
||||
e164: "E.164 عدد",
|
||||
jwt: "JWT",
|
||||
template_literal: "ورودی",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `ورودی نامعتبر: میبایست ${issue.expected} میبود، ${(0, exports.parsedType)(issue.input)} دریافت شد`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1) {
|
||||
return `ورودی نامعتبر: میبایست ${util.stringifyPrimitive(issue.values[0])} میبود`;
|
||||
}
|
||||
return `گزینه نامعتبر: میبایست یکی از ${util.joinValues(issue.values, "|")} میبود`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `خیلی بزرگ: ${issue.origin ?? "مقدار"} باید ${adj}${issue.maximum.toString()} ${sizing.unit ?? "عنصر"} باشد`;
|
||||
}
|
||||
return `خیلی بزرگ: ${issue.origin ?? "مقدار"} باید ${adj}${issue.maximum.toString()} باشد`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `خیلی کوچک: ${issue.origin} باید ${adj}${issue.minimum.toString()} ${sizing.unit} باشد`;
|
||||
}
|
||||
return `خیلی کوچک: ${issue.origin} باید ${adj}${issue.minimum.toString()} باشد`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `رشته نامعتبر: باید با "${_issue.prefix}" شروع شود`;
|
||||
}
|
||||
if (_issue.format === "ends_with") {
|
||||
return `رشته نامعتبر: باید با "${_issue.suffix}" تمام شود`;
|
||||
}
|
||||
if (_issue.format === "includes") {
|
||||
return `رشته نامعتبر: باید شامل "${_issue.includes}" باشد`;
|
||||
}
|
||||
if (_issue.format === "regex") {
|
||||
return `رشته نامعتبر: باید با الگوی ${_issue.pattern} مطابقت داشته باشد`;
|
||||
}
|
||||
return `${Nouns[_issue.format] ?? issue.format} نامعتبر`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `عدد نامعتبر: باید مضرب ${issue.divisor} باشد`;
|
||||
case "unrecognized_keys":
|
||||
return `کلید${issue.keys.length > 1 ? "های" : ""} ناشناس: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `کلید ناشناس در ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return `ورودی نامعتبر`;
|
||||
case "invalid_element":
|
||||
return `مقدار نامعتبر در ${issue.origin}`;
|
||||
default:
|
||||
return `ورودی نامعتبر`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
149
node_modules/zod/dist/cjs/v4/locales/fi.js
generated
vendored
149
node_modules/zod/dist/cjs/v4/locales/fi.js
generated
vendored
@@ -1,149 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "merkkiä", subject: "merkkijonon" },
|
||||
file: { unit: "tavua", subject: "tiedoston" },
|
||||
array: { unit: "alkiota", subject: "listan" },
|
||||
set: { unit: "alkiota", subject: "joukon" },
|
||||
number: { unit: "", subject: "luvun" },
|
||||
bigint: { unit: "", subject: "suuren kokonaisluvun" },
|
||||
int: { unit: "", subject: "kokonaisluvun" },
|
||||
date: { unit: "", subject: "päivämäärän" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "säännöllinen lauseke",
|
||||
email: "sähköpostiosoite",
|
||||
url: "URL-osoite",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO-aikaleima",
|
||||
date: "ISO-päivämäärä",
|
||||
time: "ISO-aika",
|
||||
duration: "ISO-kesto",
|
||||
ipv4: "IPv4-osoite",
|
||||
ipv6: "IPv6-osoite",
|
||||
cidrv4: "IPv4-alue",
|
||||
cidrv6: "IPv6-alue",
|
||||
base64: "base64-koodattu merkkijono",
|
||||
base64url: "base64url-koodattu merkkijono",
|
||||
json_string: "JSON-merkkijono",
|
||||
e164: "E.164-luku",
|
||||
jwt: "JWT",
|
||||
template_literal: "templaattimerkkijono",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Virheellinen tyyppi: odotettiin ${issue.expected}, oli ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Virheellinen syöte: täytyy olla ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Virheellinen valinta: täytyy olla yksi seuraavista: ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Liian suuri: ${sizing.subject} täytyy olla ${adj}${issue.maximum.toString()} ${sizing.unit}`.trim();
|
||||
}
|
||||
return `Liian suuri: arvon täytyy olla ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Liian pieni: ${sizing.subject} täytyy olla ${adj}${issue.minimum.toString()} ${sizing.unit}`.trim();
|
||||
}
|
||||
return `Liian pieni: arvon täytyy olla ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Virheellinen syöte: täytyy alkaa "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Virheellinen syöte: täytyy loppua "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Virheellinen syöte: täytyy sisältää "${_issue.includes}"`;
|
||||
if (_issue.format === "regex") {
|
||||
return `Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${_issue.pattern}`;
|
||||
}
|
||||
return `Virheellinen ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Virheellinen luku: täytyy olla luvun ${issue.divisor} monikerta`;
|
||||
case "unrecognized_keys":
|
||||
return `${issue.keys.length > 1 ? "Tuntemattomat avaimet" : "Tuntematon avain"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return "Virheellinen avain tietueessa";
|
||||
case "invalid_union":
|
||||
return "Virheellinen unioni";
|
||||
case "invalid_element":
|
||||
return "Virheellinen arvo joukossa";
|
||||
default:
|
||||
return `Virheellinen syöte`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
143
node_modules/zod/dist/cjs/v4/locales/fr.js
generated
vendored
143
node_modules/zod/dist/cjs/v4/locales/fr.js
generated
vendored
@@ -1,143 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "caractères", verb: "avoir" },
|
||||
file: { unit: "octets", verb: "avoir" },
|
||||
array: { unit: "éléments", verb: "avoir" },
|
||||
set: { unit: "éléments", verb: "avoir" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "nombre";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "tableau";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "entrée",
|
||||
email: "adresse e-mail",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "date et heure ISO",
|
||||
date: "date ISO",
|
||||
time: "heure ISO",
|
||||
duration: "durée ISO",
|
||||
ipv4: "adresse IPv4",
|
||||
ipv6: "adresse IPv6",
|
||||
cidrv4: "plage IPv4",
|
||||
cidrv6: "plage IPv6",
|
||||
base64: "chaîne encodée en base64",
|
||||
base64url: "chaîne encodée en base64url",
|
||||
json_string: "chaîne JSON",
|
||||
e164: "numéro E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "entrée",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Entrée invalide : ${issue.expected} attendu, ${(0, exports.parsedType)(issue.input)} reçu`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Entrée invalide : ${util.stringifyPrimitive(issue.values[0])} attendu`;
|
||||
return `Option invalide : une valeur parmi ${util.joinValues(issue.values, "|")} attendue`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Trop grand : ${issue.origin ?? "valeur"} doit ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "élément(s)"}`;
|
||||
return `Trop grand : ${issue.origin ?? "valeur"} doit être ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Trop petit : ${issue.origin} doit ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Trop petit : ${issue.origin} doit être ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Chaîne invalide : doit commencer par "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Chaîne invalide : doit se terminer par "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Chaîne invalide : doit inclure "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Chaîne invalide : doit correspondre au modèle ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} invalide`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Nombre invalide : doit être un multiple de ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Clé${issue.keys.length > 1 ? "s" : ""} non reconnue${issue.keys.length > 1 ? "s" : ""} : ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Clé invalide dans ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Entrée invalide";
|
||||
case "invalid_element":
|
||||
return `Valeur invalide dans ${issue.origin}`;
|
||||
default:
|
||||
return `Entrée invalide`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
144
node_modules/zod/dist/cjs/v4/locales/frCA.js
generated
vendored
144
node_modules/zod/dist/cjs/v4/locales/frCA.js
generated
vendored
@@ -1,144 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "caractères", verb: "avoir" },
|
||||
file: { unit: "octets", verb: "avoir" },
|
||||
array: { unit: "éléments", verb: "avoir" },
|
||||
set: { unit: "éléments", verb: "avoir" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "entrée",
|
||||
email: "adresse courriel",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "date-heure ISO",
|
||||
date: "date ISO",
|
||||
time: "heure ISO",
|
||||
duration: "durée ISO",
|
||||
ipv4: "adresse IPv4",
|
||||
ipv6: "adresse IPv6",
|
||||
cidrv4: "plage IPv4",
|
||||
cidrv6: "plage IPv6",
|
||||
base64: "chaîne encodée en base64",
|
||||
base64url: "chaîne encodée en base64url",
|
||||
json_string: "chaîne JSON",
|
||||
e164: "numéro E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "entrée",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Entrée invalide : attendu ${issue.expected}, reçu ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Entrée invalide : attendu ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Option invalide : attendu l'une des valeurs suivantes ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "≤" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Trop grand : attendu que ${issue.origin ?? "la valeur"} ait ${adj}${issue.maximum.toString()} ${sizing.unit}`;
|
||||
return `Trop grand : attendu que ${issue.origin ?? "la valeur"} soit ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? "≥" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Trop petit : attendu que ${issue.origin} ait ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Trop petit : attendu que ${issue.origin} soit ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `Chaîne invalide : doit commencer par "${_issue.prefix}"`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `Chaîne invalide : doit se terminer par "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Chaîne invalide : doit inclure "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Chaîne invalide : doit correspondre au motif ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} invalide`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Nombre invalide : doit être un multiple de ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Clé${issue.keys.length > 1 ? "s" : ""} non reconnue${issue.keys.length > 1 ? "s" : ""} : ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Clé invalide dans ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Entrée invalide";
|
||||
case "invalid_element":
|
||||
return `Valeur invalide dans ${issue.origin}`;
|
||||
default:
|
||||
return `Entrée invalide`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
144
node_modules/zod/dist/cjs/v4/locales/he.js
generated
vendored
144
node_modules/zod/dist/cjs/v4/locales/he.js
generated
vendored
@@ -1,144 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "אותיות", verb: "לכלול" },
|
||||
file: { unit: "בייטים", verb: "לכלול" },
|
||||
array: { unit: "פריטים", verb: "לכלול" },
|
||||
set: { unit: "פריטים", verb: "לכלול" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "קלט",
|
||||
email: "כתובת אימייל",
|
||||
url: "כתובת רשת",
|
||||
emoji: "אימוג'י",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "תאריך וזמן ISO",
|
||||
date: "תאריך ISO",
|
||||
time: "זמן ISO",
|
||||
duration: "משך זמן ISO",
|
||||
ipv4: "כתובת IPv4",
|
||||
ipv6: "כתובת IPv6",
|
||||
cidrv4: "טווח IPv4",
|
||||
cidrv6: "טווח IPv6",
|
||||
base64: "מחרוזת בבסיס 64",
|
||||
base64url: "מחרוזת בבסיס 64 לכתובות רשת",
|
||||
json_string: "מחרוזת JSON",
|
||||
e164: "מספר E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "קלט",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `קלט לא תקין: צריך ${issue.expected}, התקבל ${(0, exports.parsedType)(issue.input)}`;
|
||||
// return `Invalid input: expected ${issue.expected}, received ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `קלט לא תקין: צריך ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `קלט לא תקין: צריך אחת מהאפשרויות ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `גדול מדי: ${issue.origin ?? "value"} צריך להיות ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
|
||||
return `גדול מדי: ${issue.origin ?? "value"} צריך להיות ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `קטן מדי: ${issue.origin} צריך להיות ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `קטן מדי: ${issue.origin} צריך להיות ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `מחרוזת לא תקינה: חייבת להתחיל ב"${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `מחרוזת לא תקינה: חייבת להסתיים ב "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `מחרוזת לא תקינה: חייבת לכלול "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `מחרוזת לא תקינה: חייבת להתאים לתבנית ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} לא תקין`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `מספר לא תקין: חייב להיות מכפלה של ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `מפתח${issue.keys.length > 1 ? "ות" : ""} לא מזוה${issue.keys.length > 1 ? "ים" : "ה"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `מפתח לא תקין ב${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "קלט לא תקין";
|
||||
case "invalid_element":
|
||||
return `ערך לא תקין ב${issue.origin}`;
|
||||
default:
|
||||
return `קלט לא תקין`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
144
node_modules/zod/dist/cjs/v4/locales/hu.js
generated
vendored
144
node_modules/zod/dist/cjs/v4/locales/hu.js
generated
vendored
@@ -1,144 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "karakter", verb: "legyen" },
|
||||
file: { unit: "byte", verb: "legyen" },
|
||||
array: { unit: "elem", verb: "legyen" },
|
||||
set: { unit: "elem", verb: "legyen" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "szám";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "tömb";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "bemenet",
|
||||
email: "email cím",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO időbélyeg",
|
||||
date: "ISO dátum",
|
||||
time: "ISO idő",
|
||||
duration: "ISO időintervallum",
|
||||
ipv4: "IPv4 cím",
|
||||
ipv6: "IPv6 cím",
|
||||
cidrv4: "IPv4 tartomány",
|
||||
cidrv6: "IPv6 tartomány",
|
||||
base64: "base64-kódolt string",
|
||||
base64url: "base64url-kódolt string",
|
||||
json_string: "JSON string",
|
||||
e164: "E.164 szám",
|
||||
jwt: "JWT",
|
||||
template_literal: "bemenet",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Érvénytelen bemenet: a várt érték ${issue.expected}, a kapott érték ${(0, exports.parsedType)(issue.input)}`;
|
||||
// return `Invalid input: expected ${issue.expected}, received ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Érvénytelen bemenet: a várt érték ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Érvénytelen opció: valamelyik érték várt ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Túl nagy: ${issue.origin ?? "érték"} mérete túl nagy ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elem"}`;
|
||||
return `Túl nagy: a bemeneti érték ${issue.origin ?? "érték"} túl nagy: ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Túl kicsi: a bemeneti érték ${issue.origin} mérete túl kicsi ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Túl kicsi: a bemeneti érték ${issue.origin} túl kicsi ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Érvénytelen string: "${_issue.prefix}" értékkel kell kezdődnie`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Érvénytelen string: "${_issue.suffix}" értékkel kell végződnie`;
|
||||
if (_issue.format === "includes")
|
||||
return `Érvénytelen string: "${_issue.includes}" értéket kell tartalmaznia`;
|
||||
if (_issue.format === "regex")
|
||||
return `Érvénytelen string: ${_issue.pattern} mintának kell megfelelnie`;
|
||||
return `Érvénytelen ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Érvénytelen szám: ${issue.divisor} többszörösének kell lennie`;
|
||||
case "unrecognized_keys":
|
||||
return `Ismeretlen kulcs${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Érvénytelen kulcs ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Érvénytelen bemenet";
|
||||
case "invalid_element":
|
||||
return `Érvénytelen érték: ${issue.origin}`;
|
||||
default:
|
||||
return `Érvénytelen bemenet`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
143
node_modules/zod/dist/cjs/v4/locales/id.js
generated
vendored
143
node_modules/zod/dist/cjs/v4/locales/id.js
generated
vendored
@@ -1,143 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "karakter", verb: "memiliki" },
|
||||
file: { unit: "byte", verb: "memiliki" },
|
||||
array: { unit: "item", verb: "memiliki" },
|
||||
set: { unit: "item", verb: "memiliki" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "input",
|
||||
email: "alamat email",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "tanggal dan waktu format ISO",
|
||||
date: "tanggal format ISO",
|
||||
time: "jam format ISO",
|
||||
duration: "durasi format ISO",
|
||||
ipv4: "alamat IPv4",
|
||||
ipv6: "alamat IPv6",
|
||||
cidrv4: "rentang alamat IPv4",
|
||||
cidrv6: "rentang alamat IPv6",
|
||||
base64: "string dengan enkode base64",
|
||||
base64url: "string dengan enkode base64url",
|
||||
json_string: "string JSON",
|
||||
e164: "angka E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Input tidak valid: diharapkan ${issue.expected}, diterima ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Input tidak valid: diharapkan ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Pilihan tidak valid: diharapkan salah satu dari ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Terlalu besar: diharapkan ${issue.origin ?? "value"} memiliki ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemen"}`;
|
||||
return `Terlalu besar: diharapkan ${issue.origin ?? "value"} menjadi ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Terlalu kecil: diharapkan ${issue.origin} memiliki ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Terlalu kecil: diharapkan ${issue.origin} menjadi ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `String tidak valid: harus dimulai dengan "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `String tidak valid: harus berakhir dengan "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `String tidak valid: harus menyertakan "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `String tidak valid: harus sesuai pola ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} tidak valid`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Angka tidak valid: harus kelipatan dari ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Kunci tidak dikenali ${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Kunci tidak valid di ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Input tidak valid";
|
||||
case "invalid_element":
|
||||
return `Nilai tidak valid di ${issue.origin}`;
|
||||
default:
|
||||
return `Input tidak valid`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
144
node_modules/zod/dist/cjs/v4/locales/it.js
generated
vendored
144
node_modules/zod/dist/cjs/v4/locales/it.js
generated
vendored
@@ -1,144 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "caratteri", verb: "avere" },
|
||||
file: { unit: "byte", verb: "avere" },
|
||||
array: { unit: "elementi", verb: "avere" },
|
||||
set: { unit: "elementi", verb: "avere" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "numero";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "vettore";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "input",
|
||||
email: "indirizzo email",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "data e ora ISO",
|
||||
date: "data ISO",
|
||||
time: "ora ISO",
|
||||
duration: "durata ISO",
|
||||
ipv4: "indirizzo IPv4",
|
||||
ipv6: "indirizzo IPv6",
|
||||
cidrv4: "intervallo IPv4",
|
||||
cidrv6: "intervallo IPv6",
|
||||
base64: "stringa codificata in base64",
|
||||
base64url: "URL codificata in base64",
|
||||
json_string: "stringa JSON",
|
||||
e164: "numero E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Input non valido: atteso ${issue.expected}, ricevuto ${(0, exports.parsedType)(issue.input)}`;
|
||||
// return `Input non valido: atteso ${issue.expected}, ricevuto ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Input non valido: atteso ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Opzione non valida: atteso uno tra ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Troppo grande: ${issue.origin ?? "valore"} deve avere ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementi"}`;
|
||||
return `Troppo grande: ${issue.origin ?? "valore"} deve essere ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Troppo piccolo: ${issue.origin} deve avere ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Troppo piccolo: ${issue.origin} deve essere ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Stringa non valida: deve iniziare con "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Stringa non valida: deve terminare con "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Stringa non valida: deve includere "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Stringa non valida: deve corrispondere al pattern ${_issue.pattern}`;
|
||||
return `Invalid ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Numero non valido: deve essere un multiplo di ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Chiav${issue.keys.length > 1 ? "i" : "e"} non riconosciut${issue.keys.length > 1 ? "e" : "a"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Chiave non valida in ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Input non valido";
|
||||
case "invalid_element":
|
||||
return `Valore non valido in ${issue.origin}`;
|
||||
default:
|
||||
return `Input non valido`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
142
node_modules/zod/dist/cjs/v4/locales/ja.js
generated
vendored
142
node_modules/zod/dist/cjs/v4/locales/ja.js
generated
vendored
@@ -1,142 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "文字", verb: "である" },
|
||||
file: { unit: "バイト", verb: "である" },
|
||||
array: { unit: "要素", verb: "である" },
|
||||
set: { unit: "要素", verb: "である" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "数値";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "配列";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "入力値",
|
||||
email: "メールアドレス",
|
||||
url: "URL",
|
||||
emoji: "絵文字",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO日時",
|
||||
date: "ISO日付",
|
||||
time: "ISO時刻",
|
||||
duration: "ISO期間",
|
||||
ipv4: "IPv4アドレス",
|
||||
ipv6: "IPv6アドレス",
|
||||
cidrv4: "IPv4範囲",
|
||||
cidrv6: "IPv6範囲",
|
||||
base64: "base64エンコード文字列",
|
||||
base64url: "base64urlエンコード文字列",
|
||||
json_string: "JSON文字列",
|
||||
e164: "E.164番号",
|
||||
jwt: "JWT",
|
||||
template_literal: "入力値",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `無効な入力: ${issue.expected}が期待されましたが、${(0, exports.parsedType)(issue.input)}が入力されました`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `無効な入力: ${util.stringifyPrimitive(issue.values[0])}が期待されました`;
|
||||
return `無効な選択: ${util.joinValues(issue.values, "、")}のいずれかである必要があります`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `大きすぎる値: ${issue.origin ?? "値"}は${issue.maximum.toString()}${sizing.unit ?? "要素"}${adj}である必要があります`;
|
||||
return `大きすぎる値: ${issue.origin ?? "値"}は${issue.maximum.toString()}${adj}である必要があります`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `小さすぎる値: ${issue.origin}は${issue.minimum.toString()}${sizing.unit}${adj}である必要があります`;
|
||||
return `小さすぎる値: ${issue.origin}は${issue.minimum.toString()}${adj}である必要があります`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `無効な文字列: "${_issue.prefix}"で始まる必要があります`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `無効な文字列: "${_issue.suffix}"で終わる必要があります`;
|
||||
if (_issue.format === "includes")
|
||||
return `無効な文字列: "${_issue.includes}"を含む必要があります`;
|
||||
if (_issue.format === "regex")
|
||||
return `無効な文字列: パターン${_issue.pattern}に一致する必要があります`;
|
||||
return `無効な${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `無効な数値: ${issue.divisor}の倍数である必要があります`;
|
||||
case "unrecognized_keys":
|
||||
return `認識されていないキー${issue.keys.length > 1 ? "群" : ""}: ${util.joinValues(issue.keys, "、")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin}内の無効なキー`;
|
||||
case "invalid_union":
|
||||
return "無効な入力";
|
||||
case "invalid_element":
|
||||
return `${issue.origin}内の無効な値`;
|
||||
default:
|
||||
return `無効な入力`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
148
node_modules/zod/dist/cjs/v4/locales/ko.js
generated
vendored
148
node_modules/zod/dist/cjs/v4/locales/ko.js
generated
vendored
@@ -1,148 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "문자", verb: "to have" },
|
||||
file: { unit: "바이트", verb: "to have" },
|
||||
array: { unit: "개", verb: "to have" },
|
||||
set: { unit: "개", verb: "to have" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "입력",
|
||||
email: "이메일 주소",
|
||||
url: "URL",
|
||||
emoji: "이모지",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO 날짜시간",
|
||||
date: "ISO 날짜",
|
||||
time: "ISO 시간",
|
||||
duration: "ISO 기간",
|
||||
ipv4: "IPv4 주소",
|
||||
ipv6: "IPv6 주소",
|
||||
cidrv4: "IPv4 범위",
|
||||
cidrv6: "IPv6 범위",
|
||||
base64: "base64 인코딩 문자열",
|
||||
base64url: "base64url 인코딩 문자열",
|
||||
json_string: "JSON 문자열",
|
||||
e164: "E.164 번호",
|
||||
jwt: "JWT",
|
||||
template_literal: "입력",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `잘못된 입력: 예상 타입은 ${issue.expected}, 받은 타입은 ${(0, exports.parsedType)(issue.input)}입니다`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `잘못된 입력: 값은 ${util.stringifyPrimitive(issue.values[0])} 이어야 합니다`;
|
||||
return `잘못된 옵션: ${util.joinValues(issue.values, "또는 ")} 중 하나여야 합니다`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "이하" : "미만";
|
||||
const suffix = adj === "미만" ? "이어야 합니다" : "여야 합니다";
|
||||
const sizing = getSizing(issue.origin);
|
||||
const unit = sizing?.unit ?? "요소";
|
||||
if (sizing)
|
||||
return `${issue.origin ?? "값"}이 너무 큽니다: ${issue.maximum.toString()}${unit} ${adj}${suffix}`;
|
||||
return `${issue.origin ?? "값"}이 너무 큽니다: ${issue.maximum.toString()} ${adj}${suffix}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? "이상" : "초과";
|
||||
const suffix = adj === "이상" ? "이어야 합니다" : "여야 합니다";
|
||||
const sizing = getSizing(issue.origin);
|
||||
const unit = sizing?.unit ?? "요소";
|
||||
if (sizing) {
|
||||
return `${issue.origin ?? "값"}이 너무 작습니다: ${issue.minimum.toString()}${unit} ${adj}${suffix}`;
|
||||
}
|
||||
return `${issue.origin ?? "값"}이 너무 작습니다: ${issue.minimum.toString()} ${adj}${suffix}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `잘못된 문자열: "${_issue.prefix}"(으)로 시작해야 합니다`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `잘못된 문자열: "${_issue.suffix}"(으)로 끝나야 합니다`;
|
||||
if (_issue.format === "includes")
|
||||
return `잘못된 문자열: "${_issue.includes}"을(를) 포함해야 합니다`;
|
||||
if (_issue.format === "regex")
|
||||
return `잘못된 문자열: 정규식 ${_issue.pattern} 패턴과 일치해야 합니다`;
|
||||
return `잘못된 ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `잘못된 숫자: ${issue.divisor}의 배수여야 합니다`;
|
||||
case "unrecognized_keys":
|
||||
return `인식할 수 없는 키: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `잘못된 키: ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return `잘못된 입력`;
|
||||
case "invalid_element":
|
||||
return `잘못된 값: ${issue.origin}`;
|
||||
default:
|
||||
return `잘못된 입력`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
145
node_modules/zod/dist/cjs/v4/locales/mk.js
generated
vendored
145
node_modules/zod/dist/cjs/v4/locales/mk.js
generated
vendored
@@ -1,145 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "знаци", verb: "да имаат" },
|
||||
file: { unit: "бајти", verb: "да имаат" },
|
||||
array: { unit: "ставки", verb: "да имаат" },
|
||||
set: { unit: "ставки", verb: "да имаат" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "број";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "низа";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "внес",
|
||||
email: "адреса на е-пошта",
|
||||
url: "URL",
|
||||
emoji: "емоџи",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO датум и време",
|
||||
date: "ISO датум",
|
||||
time: "ISO време",
|
||||
duration: "ISO времетраење",
|
||||
ipv4: "IPv4 адреса",
|
||||
ipv6: "IPv6 адреса",
|
||||
cidrv4: "IPv4 опсег",
|
||||
cidrv6: "IPv6 опсег",
|
||||
base64: "base64-енкодирана низа",
|
||||
base64url: "base64url-енкодирана низа",
|
||||
json_string: "JSON низа",
|
||||
e164: "E.164 број",
|
||||
jwt: "JWT",
|
||||
template_literal: "внес",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Грешен внес: се очекува ${issue.expected}, примено ${(0, exports.parsedType)(issue.input)}`;
|
||||
// return `Invalid input: expected ${issue.expected}, received ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Грешана опција: се очекува една ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Премногу голем: се очекува ${issue.origin ?? "вредноста"} да има ${adj}${issue.maximum.toString()} ${sizing.unit ?? "елементи"}`;
|
||||
return `Премногу голем: се очекува ${issue.origin ?? "вредноста"} да биде ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Премногу мал: се очекува ${issue.origin} да има ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Премногу мал: се очекува ${issue.origin} да биде ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `Неважечка низа: мора да започнува со "${_issue.prefix}"`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `Неважечка низа: мора да завршува со "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Неважечка низа: мора да вклучува "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Неважечка низа: мора да одгоара на патернот ${_issue.pattern}`;
|
||||
return `Invalid ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Грешен број: мора да биде делив со ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `${issue.keys.length > 1 ? "Непрепознаени клучеви" : "Непрепознаен клуч"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Грешен клуч во ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Грешен внес";
|
||||
case "invalid_element":
|
||||
return `Грешна вредност во ${issue.origin}`;
|
||||
default:
|
||||
return `Грешен внес`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
143
node_modules/zod/dist/cjs/v4/locales/ms.js
generated
vendored
143
node_modules/zod/dist/cjs/v4/locales/ms.js
generated
vendored
@@ -1,143 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "aksara", verb: "mempunyai" },
|
||||
file: { unit: "bait", verb: "mempunyai" },
|
||||
array: { unit: "elemen", verb: "mempunyai" },
|
||||
set: { unit: "elemen", verb: "mempunyai" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "nombor";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "input",
|
||||
email: "alamat e-mel",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "tarikh masa ISO",
|
||||
date: "tarikh ISO",
|
||||
time: "masa ISO",
|
||||
duration: "tempoh ISO",
|
||||
ipv4: "alamat IPv4",
|
||||
ipv6: "alamat IPv6",
|
||||
cidrv4: "julat IPv4",
|
||||
cidrv6: "julat IPv6",
|
||||
base64: "string dikodkan base64",
|
||||
base64url: "string dikodkan base64url",
|
||||
json_string: "string JSON",
|
||||
e164: "nombor E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Input tidak sah: dijangka ${issue.expected}, diterima ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Input tidak sah: dijangka ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Pilihan tidak sah: dijangka salah satu daripada ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Terlalu besar: dijangka ${issue.origin ?? "nilai"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemen"}`;
|
||||
return `Terlalu besar: dijangka ${issue.origin ?? "nilai"} adalah ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Terlalu kecil: dijangka ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Terlalu kecil: dijangka ${issue.origin} adalah ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `String tidak sah: mesti bermula dengan "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `String tidak sah: mesti berakhir dengan "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `String tidak sah: mesti mengandungi "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `String tidak sah: mesti sepadan dengan corak ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} tidak sah`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Nombor tidak sah: perlu gandaan ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Kunci tidak dikenali: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Kunci tidak sah dalam ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Input tidak sah";
|
||||
case "invalid_element":
|
||||
return `Nilai tidak sah dalam ${issue.origin}`;
|
||||
default:
|
||||
return `Input tidak sah`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
143
node_modules/zod/dist/cjs/v4/locales/no.js
generated
vendored
143
node_modules/zod/dist/cjs/v4/locales/no.js
generated
vendored
@@ -1,143 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "tegn", verb: "å ha" },
|
||||
file: { unit: "bytes", verb: "å ha" },
|
||||
array: { unit: "elementer", verb: "å inneholde" },
|
||||
set: { unit: "elementer", verb: "å inneholde" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "tall";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "liste";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "input",
|
||||
email: "e-postadresse",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO dato- og klokkeslett",
|
||||
date: "ISO-dato",
|
||||
time: "ISO-klokkeslett",
|
||||
duration: "ISO-varighet",
|
||||
ipv4: "IPv4-område",
|
||||
ipv6: "IPv6-område",
|
||||
cidrv4: "IPv4-spekter",
|
||||
cidrv6: "IPv6-spekter",
|
||||
base64: "base64-enkodet streng",
|
||||
base64url: "base64url-enkodet streng",
|
||||
json_string: "JSON-streng",
|
||||
e164: "E.164-nummer",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Ugyldig input: forventet ${issue.expected}, fikk ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Ugyldig verdi: forventet ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Ugyldig valg: forventet en av ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `For stor(t): forventet ${issue.origin ?? "value"} til å ha ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementer"}`;
|
||||
return `For stor(t): forventet ${issue.origin ?? "value"} til å ha ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `For lite(n): forventet ${issue.origin} til å ha ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `For lite(n): forventet ${issue.origin} til å ha ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Ugyldig streng: må starte med "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Ugyldig streng: må ende med "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Ugyldig streng: må inneholde "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Ugyldig streng: må matche mønsteret ${_issue.pattern}`;
|
||||
return `Ugyldig ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Ugyldig tall: må være et multiplum av ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `${issue.keys.length > 1 ? "Ukjente nøkler" : "Ukjent nøkkel"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Ugyldig nøkkel i ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Ugyldig input";
|
||||
case "invalid_element":
|
||||
return `Ugyldig verdi i ${issue.origin}`;
|
||||
default:
|
||||
return `Ugyldig input`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
144
node_modules/zod/dist/cjs/v4/locales/ota.js
generated
vendored
144
node_modules/zod/dist/cjs/v4/locales/ota.js
generated
vendored
@@ -1,144 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "harf", verb: "olmalıdır" },
|
||||
file: { unit: "bayt", verb: "olmalıdır" },
|
||||
array: { unit: "unsur", verb: "olmalıdır" },
|
||||
set: { unit: "unsur", verb: "olmalıdır" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "numara";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "saf";
|
||||
}
|
||||
if (data === null) {
|
||||
return "gayb";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "giren",
|
||||
email: "epostagâh",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO hengâmı",
|
||||
date: "ISO tarihi",
|
||||
time: "ISO zamanı",
|
||||
duration: "ISO müddeti",
|
||||
ipv4: "IPv4 nişânı",
|
||||
ipv6: "IPv6 nişânı",
|
||||
cidrv4: "IPv4 menzili",
|
||||
cidrv6: "IPv6 menzili",
|
||||
base64: "base64-şifreli metin",
|
||||
base64url: "base64url-şifreli metin",
|
||||
json_string: "JSON metin",
|
||||
e164: "E.164 sayısı",
|
||||
jwt: "JWT",
|
||||
template_literal: "giren",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Fâsit giren: umulan ${issue.expected}, alınan ${(0, exports.parsedType)(issue.input)}`;
|
||||
// return `Fâsit giren: umulan ${issue.expected}, alınan ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Fâsit giren: umulan ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Fâsit tercih: mûteberler ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Fazla büyük: ${issue.origin ?? "value"}, ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"} sahip olmalıydı.`;
|
||||
return `Fazla büyük: ${issue.origin ?? "value"}, ${adj}${issue.maximum.toString()} olmalıydı.`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Fazla küçük: ${issue.origin}, ${adj}${issue.minimum.toString()} ${sizing.unit} sahip olmalıydı.`;
|
||||
}
|
||||
return `Fazla küçük: ${issue.origin}, ${adj}${issue.minimum.toString()} olmalıydı.`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Fâsit metin: "${_issue.prefix}" ile başlamalı.`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Fâsit metin: "${_issue.suffix}" ile bitmeli.`;
|
||||
if (_issue.format === "includes")
|
||||
return `Fâsit metin: "${_issue.includes}" ihtivâ etmeli.`;
|
||||
if (_issue.format === "regex")
|
||||
return `Fâsit metin: ${_issue.pattern} nakşına uymalı.`;
|
||||
return `Fâsit ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Fâsit sayı: ${issue.divisor} katı olmalıydı.`;
|
||||
case "unrecognized_keys":
|
||||
return `Tanınmayan anahtar ${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} için tanınmayan anahtar var.`;
|
||||
case "invalid_union":
|
||||
return "Giren tanınamadı.";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} için tanınmayan kıymet var.`;
|
||||
default:
|
||||
return `Kıymet tanınamadı.`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
144
node_modules/zod/dist/cjs/v4/locales/pl.js
generated
vendored
144
node_modules/zod/dist/cjs/v4/locales/pl.js
generated
vendored
@@ -1,144 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "znaków", verb: "mieć" },
|
||||
file: { unit: "bajtów", verb: "mieć" },
|
||||
array: { unit: "elementów", verb: "mieć" },
|
||||
set: { unit: "elementów", verb: "mieć" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "liczba";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "tablica";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "wyrażenie",
|
||||
email: "adres email",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "data i godzina w formacie ISO",
|
||||
date: "data w formacie ISO",
|
||||
time: "godzina w formacie ISO",
|
||||
duration: "czas trwania ISO",
|
||||
ipv4: "adres IPv4",
|
||||
ipv6: "adres IPv6",
|
||||
cidrv4: "zakres IPv4",
|
||||
cidrv6: "zakres IPv6",
|
||||
base64: "ciąg znaków zakodowany w formacie base64",
|
||||
base64url: "ciąg znaków zakodowany w formacie base64url",
|
||||
json_string: "ciąg znaków w formacie JSON",
|
||||
e164: "liczba E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "wejście",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Nieprawidłowe dane wejściowe: oczekiwano ${issue.expected}, otrzymano ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Nieprawidłowe dane wejściowe: oczekiwano ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Nieprawidłowa opcja: oczekiwano jednej z wartości ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Za duża wartość: oczekiwano, że ${issue.origin ?? "wartość"} będzie mieć ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementów"}`;
|
||||
}
|
||||
return `Zbyt duż(y/a/e): oczekiwano, że ${issue.origin ?? "wartość"} będzie wynosić ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Za mała wartość: oczekiwano, że ${issue.origin ?? "wartość"} będzie mieć ${adj}${issue.minimum.toString()} ${sizing.unit ?? "elementów"}`;
|
||||
}
|
||||
return `Zbyt mał(y/a/e): oczekiwano, że ${issue.origin ?? "wartość"} będzie wynosić ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Nieprawidłowy ciąg znaków: musi zaczynać się od "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Nieprawidłowy ciąg znaków: musi kończyć się na "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Nieprawidłowy ciąg znaków: musi zawierać "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${_issue.pattern}`;
|
||||
return `Nieprawidłow(y/a/e) ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Nieprawidłowa liczba: musi być wielokrotnością ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Nierozpoznane klucze${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Nieprawidłowy klucz w ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Nieprawidłowe dane wejściowe";
|
||||
case "invalid_element":
|
||||
return `Nieprawidłowa wartość w ${issue.origin}`;
|
||||
default:
|
||||
return `Nieprawidłowe dane wejściowe`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
143
node_modules/zod/dist/cjs/v4/locales/pt.js
generated
vendored
143
node_modules/zod/dist/cjs/v4/locales/pt.js
generated
vendored
@@ -1,143 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "caracteres", verb: "ter" },
|
||||
file: { unit: "bytes", verb: "ter" },
|
||||
array: { unit: "itens", verb: "ter" },
|
||||
set: { unit: "itens", verb: "ter" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "número";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "nulo";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "padrão",
|
||||
email: "endereço de e-mail",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "data e hora ISO",
|
||||
date: "data ISO",
|
||||
time: "hora ISO",
|
||||
duration: "duração ISO",
|
||||
ipv4: "endereço IPv4",
|
||||
ipv6: "endereço IPv6",
|
||||
cidrv4: "faixa de IPv4",
|
||||
cidrv6: "faixa de IPv6",
|
||||
base64: "texto codificado em base64",
|
||||
base64url: "URL codificada em base64",
|
||||
json_string: "texto JSON",
|
||||
e164: "número E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "entrada",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Tipo inválido: esperado ${issue.expected}, recebido ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Entrada inválida: esperado ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Opção inválida: esperada uma das ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Muito grande: esperado que ${issue.origin ?? "valor"} tivesse ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementos"}`;
|
||||
return `Muito grande: esperado que ${issue.origin ?? "valor"} fosse ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Muito pequeno: esperado que ${issue.origin} tivesse ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Muito pequeno: esperado que ${issue.origin} fosse ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Texto inválido: deve começar com "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Texto inválido: deve terminar com "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Texto inválido: deve incluir "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Texto inválido: deve corresponder ao padrão ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} inválido`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Número inválido: deve ser múltiplo de ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Chave${issue.keys.length > 1 ? "s" : ""} desconhecida${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Chave inválida em ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Entrada inválida";
|
||||
case "invalid_element":
|
||||
return `Valor inválido em ${issue.origin}`;
|
||||
default:
|
||||
return `Campo inválido`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
191
node_modules/zod/dist/cjs/v4/locales/ru.js
generated
vendored
191
node_modules/zod/dist/cjs/v4/locales/ru.js
generated
vendored
@@ -1,191 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
function getRussianPlural(count, one, few, many) {
|
||||
const absCount = Math.abs(count);
|
||||
const lastDigit = absCount % 10;
|
||||
const lastTwoDigits = absCount % 100;
|
||||
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
||||
return many;
|
||||
}
|
||||
if (lastDigit === 1) {
|
||||
return one;
|
||||
}
|
||||
if (lastDigit >= 2 && lastDigit <= 4) {
|
||||
return few;
|
||||
}
|
||||
return many;
|
||||
}
|
||||
const Sizable = {
|
||||
string: {
|
||||
unit: {
|
||||
one: "символ",
|
||||
few: "символа",
|
||||
many: "символов",
|
||||
},
|
||||
verb: "иметь",
|
||||
},
|
||||
file: {
|
||||
unit: {
|
||||
one: "байт",
|
||||
few: "байта",
|
||||
many: "байт",
|
||||
},
|
||||
verb: "иметь",
|
||||
},
|
||||
array: {
|
||||
unit: {
|
||||
one: "элемент",
|
||||
few: "элемента",
|
||||
many: "элементов",
|
||||
},
|
||||
verb: "иметь",
|
||||
},
|
||||
set: {
|
||||
unit: {
|
||||
one: "элемент",
|
||||
few: "элемента",
|
||||
many: "элементов",
|
||||
},
|
||||
verb: "иметь",
|
||||
},
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "число";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "массив";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "ввод",
|
||||
email: "email адрес",
|
||||
url: "URL",
|
||||
emoji: "эмодзи",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO дата и время",
|
||||
date: "ISO дата",
|
||||
time: "ISO время",
|
||||
duration: "ISO длительность",
|
||||
ipv4: "IPv4 адрес",
|
||||
ipv6: "IPv6 адрес",
|
||||
cidrv4: "IPv4 диапазон",
|
||||
cidrv6: "IPv6 диапазон",
|
||||
base64: "строка в формате base64",
|
||||
base64url: "строка в формате base64url",
|
||||
json_string: "JSON строка",
|
||||
e164: "номер E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "ввод",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Неверный ввод: ожидалось ${issue.expected}, получено ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Неверный ввод: ожидалось ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Неверный вариант: ожидалось одно из ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
const maxValue = Number(issue.maximum);
|
||||
const unit = getRussianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
|
||||
return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет иметь ${adj}${issue.maximum.toString()} ${unit}`;
|
||||
}
|
||||
return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
const minValue = Number(issue.minimum);
|
||||
const unit = getRussianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
|
||||
return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет иметь ${adj}${issue.minimum.toString()} ${unit}`;
|
||||
}
|
||||
return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Неверная строка: должна начинаться с "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Неверная строка: должна заканчиваться на "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Неверная строка: должна содержать "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Неверная строка: должна соответствовать шаблону ${_issue.pattern}`;
|
||||
return `Неверный ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Неверное число: должно быть кратным ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Нераспознанн${issue.keys.length > 1 ? "ые" : "ый"} ключ${issue.keys.length > 1 ? "и" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Неверный ключ в ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Неверные входные данные";
|
||||
case "invalid_element":
|
||||
return `Неверное значение в ${issue.origin}`;
|
||||
default:
|
||||
return `Неверные входные данные`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
144
node_modules/zod/dist/cjs/v4/locales/sl.js
generated
vendored
144
node_modules/zod/dist/cjs/v4/locales/sl.js
generated
vendored
@@ -1,144 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "znakov", verb: "imeti" },
|
||||
file: { unit: "bajtov", verb: "imeti" },
|
||||
array: { unit: "elementov", verb: "imeti" },
|
||||
set: { unit: "elementov", verb: "imeti" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "število";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "tabela";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "vnos",
|
||||
email: "e-poštni naslov",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO datum in čas",
|
||||
date: "ISO datum",
|
||||
time: "ISO čas",
|
||||
duration: "ISO trajanje",
|
||||
ipv4: "IPv4 naslov",
|
||||
ipv6: "IPv6 naslov",
|
||||
cidrv4: "obseg IPv4",
|
||||
cidrv6: "obseg IPv6",
|
||||
base64: "base64 kodiran niz",
|
||||
base64url: "base64url kodiran niz",
|
||||
json_string: "JSON niz",
|
||||
e164: "E.164 številka",
|
||||
jwt: "JWT",
|
||||
template_literal: "vnos",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Neveljaven vnos: pričakovano ${issue.expected}, prejeto ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Neveljaven vnos: pričakovano ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Neveljavna možnost: pričakovano eno izmed ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} imelo ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementov"}`;
|
||||
return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Premajhno: pričakovano, da bo ${issue.origin} imelo ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Premajhno: pričakovano, da bo ${issue.origin} ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `Neveljaven niz: mora se začeti z "${_issue.prefix}"`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `Neveljaven niz: mora se končati z "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Neveljaven niz: mora vsebovati "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Neveljaven niz: mora ustrezati vzorcu ${_issue.pattern}`;
|
||||
return `Neveljaven ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Neveljavno število: mora biti večkratnik ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Neprepoznan${issue.keys.length > 1 ? "i ključi" : " ključ"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Neveljaven ključ v ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Neveljaven vnos";
|
||||
case "invalid_element":
|
||||
return `Neveljavna vrednost v ${issue.origin}`;
|
||||
default:
|
||||
return "Neveljaven vnos";
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
144
node_modules/zod/dist/cjs/v4/locales/ta.js
generated
vendored
144
node_modules/zod/dist/cjs/v4/locales/ta.js
generated
vendored
@@ -1,144 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "எழுத்துக்கள்", verb: "கொண்டிருக்க வேண்டும்" },
|
||||
file: { unit: "பைட்டுகள்", verb: "கொண்டிருக்க வேண்டும்" },
|
||||
array: { unit: "உறுப்புகள்", verb: "கொண்டிருக்க வேண்டும்" },
|
||||
set: { unit: "உறுப்புகள்", verb: "கொண்டிருக்க வேண்டும்" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "எண் அல்லாதது" : "எண்";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "அணி";
|
||||
}
|
||||
if (data === null) {
|
||||
return "வெறுமை";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "உள்ளீடு",
|
||||
email: "மின்னஞ்சல் முகவரி",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO தேதி நேரம்",
|
||||
date: "ISO தேதி",
|
||||
time: "ISO நேரம்",
|
||||
duration: "ISO கால அளவு",
|
||||
ipv4: "IPv4 முகவரி",
|
||||
ipv6: "IPv6 முகவரி",
|
||||
cidrv4: "IPv4 வரம்பு",
|
||||
cidrv6: "IPv6 வரம்பு",
|
||||
base64: "base64-encoded சரம்",
|
||||
base64url: "base64url-encoded சரம்",
|
||||
json_string: "JSON சரம்",
|
||||
e164: "E.164 எண்",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue.expected}, பெறப்பட்டது ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${util.joinValues(issue.values, "|")} இல் ஒன்று`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${issue.origin ?? "மதிப்பு"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "உறுப்புகள்"} ஆக இருக்க வேண்டும்`;
|
||||
}
|
||||
return `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${issue.origin ?? "மதிப்பு"} ${adj}${issue.maximum.toString()} ஆக இருக்க வேண்டும்`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} ஆக இருக்க வேண்டும்`; //
|
||||
}
|
||||
return `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${issue.origin} ${adj}${issue.minimum.toString()} ஆக இருக்க வேண்டும்`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `தவறான சரம்: "${_issue.prefix}" இல் தொடங்க வேண்டும்`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `தவறான சரம்: "${_issue.suffix}" இல் முடிவடைய வேண்டும்`;
|
||||
if (_issue.format === "includes")
|
||||
return `தவறான சரம்: "${_issue.includes}" ஐ உள்ளடக்க வேண்டும்`;
|
||||
if (_issue.format === "regex")
|
||||
return `தவறான சரம்: ${_issue.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;
|
||||
return `தவறான ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `தவறான எண்: ${issue.divisor} இன் பலமாக இருக்க வேண்டும்`;
|
||||
case "unrecognized_keys":
|
||||
return `அடையாளம் தெரியாத விசை${issue.keys.length > 1 ? "கள்" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} இல் தவறான விசை`;
|
||||
case "invalid_union":
|
||||
return "தவறான உள்ளீடு";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} இல் தவறான மதிப்பு`;
|
||||
default:
|
||||
return `தவறான உள்ளீடு`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
144
node_modules/zod/dist/cjs/v4/locales/th.js
generated
vendored
144
node_modules/zod/dist/cjs/v4/locales/th.js
generated
vendored
@@ -1,144 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "ตัวอักษร", verb: "ควรมี" },
|
||||
file: { unit: "ไบต์", verb: "ควรมี" },
|
||||
array: { unit: "รายการ", verb: "ควรมี" },
|
||||
set: { unit: "รายการ", verb: "ควรมี" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "ไม่ใช่ตัวเลข (NaN)" : "ตัวเลข";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "อาร์เรย์ (Array)";
|
||||
}
|
||||
if (data === null) {
|
||||
return "ไม่มีค่า (null)";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "ข้อมูลที่ป้อน",
|
||||
email: "ที่อยู่อีเมล",
|
||||
url: "URL",
|
||||
emoji: "อิโมจิ",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "วันที่เวลาแบบ ISO",
|
||||
date: "วันที่แบบ ISO",
|
||||
time: "เวลาแบบ ISO",
|
||||
duration: "ช่วงเวลาแบบ ISO",
|
||||
ipv4: "ที่อยู่ IPv4",
|
||||
ipv6: "ที่อยู่ IPv6",
|
||||
cidrv4: "ช่วง IP แบบ IPv4",
|
||||
cidrv6: "ช่วง IP แบบ IPv6",
|
||||
base64: "ข้อความแบบ Base64",
|
||||
base64url: "ข้อความแบบ Base64 สำหรับ URL",
|
||||
json_string: "ข้อความแบบ JSON",
|
||||
e164: "เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",
|
||||
jwt: "โทเคน JWT",
|
||||
template_literal: "ข้อมูลที่ป้อน",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue.expected} แต่ได้รับ ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `ค่าไม่ถูกต้อง: ควรเป็น ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "ไม่เกิน" : "น้อยกว่า";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `เกินกำหนด: ${issue.origin ?? "ค่า"} ควรมี${adj} ${issue.maximum.toString()} ${sizing.unit ?? "รายการ"}`;
|
||||
return `เกินกำหนด: ${issue.origin ?? "ค่า"} ควรมี${adj} ${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? "อย่างน้อย" : "มากกว่า";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `น้อยกว่ากำหนด: ${issue.origin} ควรมี${adj} ${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `น้อยกว่ากำหนด: ${issue.origin} ควรมี${adj} ${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${_issue.prefix}"`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${_issue.includes}" อยู่ในข้อความ`;
|
||||
if (_issue.format === "regex")
|
||||
return `รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${_issue.pattern}`;
|
||||
return `รูปแบบไม่ถูกต้อง: ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${issue.divisor} ได้ลงตัว`;
|
||||
case "unrecognized_keys":
|
||||
return `พบคีย์ที่ไม่รู้จัก: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `คีย์ไม่ถูกต้องใน ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";
|
||||
case "invalid_element":
|
||||
return `ข้อมูลไม่ถูกต้องใน ${issue.origin}`;
|
||||
default:
|
||||
return `ข้อมูลไม่ถูกต้อง`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
142
node_modules/zod/dist/cjs/v4/locales/tr.js
generated
vendored
142
node_modules/zod/dist/cjs/v4/locales/tr.js
generated
vendored
@@ -1,142 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "karakter", verb: "olmalı" },
|
||||
file: { unit: "bayt", verb: "olmalı" },
|
||||
array: { unit: "öğe", verb: "olmalı" },
|
||||
set: { unit: "öğe", verb: "olmalı" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "girdi",
|
||||
email: "e-posta adresi",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO tarih ve saat",
|
||||
date: "ISO tarih",
|
||||
time: "ISO saat",
|
||||
duration: "ISO süre",
|
||||
ipv4: "IPv4 adresi",
|
||||
ipv6: "IPv6 adresi",
|
||||
cidrv4: "IPv4 aralığı",
|
||||
cidrv6: "IPv6 aralığı",
|
||||
base64: "base64 ile şifrelenmiş metin",
|
||||
base64url: "base64url ile şifrelenmiş metin",
|
||||
json_string: "JSON dizesi",
|
||||
e164: "E.164 sayısı",
|
||||
jwt: "JWT",
|
||||
template_literal: "Şablon dizesi",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Geçersiz değer: beklenen ${issue.expected}, alınan ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Geçersiz değer: beklenen ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Geçersiz seçenek: aşağıdakilerden biri olmalı: ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Çok büyük: beklenen ${issue.origin ?? "değer"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "öğe"}`;
|
||||
return `Çok büyük: beklenen ${issue.origin ?? "değer"} ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Çok küçük: beklenen ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
return `Çok küçük: beklenen ${issue.origin} ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Geçersiz metin: "${_issue.prefix}" ile başlamalı`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Geçersiz metin: "${_issue.suffix}" ile bitmeli`;
|
||||
if (_issue.format === "includes")
|
||||
return `Geçersiz metin: "${_issue.includes}" içermeli`;
|
||||
if (_issue.format === "regex")
|
||||
return `Geçersiz metin: ${_issue.pattern} desenine uymalı`;
|
||||
return `Geçersiz ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Geçersiz sayı: ${issue.divisor} ile tam bölünebilmeli`;
|
||||
case "unrecognized_keys":
|
||||
return `Tanınmayan anahtar${issue.keys.length > 1 ? "lar" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} içinde geçersiz anahtar`;
|
||||
case "invalid_union":
|
||||
return "Geçersiz değer";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} içinde geçersiz değer`;
|
||||
default:
|
||||
return `Geçersiz değer`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
144
node_modules/zod/dist/cjs/v4/locales/ua.js
generated
vendored
144
node_modules/zod/dist/cjs/v4/locales/ua.js
generated
vendored
@@ -1,144 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "символів", verb: "матиме" },
|
||||
file: { unit: "байтів", verb: "матиме" },
|
||||
array: { unit: "елементів", verb: "матиме" },
|
||||
set: { unit: "елементів", verb: "матиме" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "число";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "масив";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "вхідні дані",
|
||||
email: "адреса електронної пошти",
|
||||
url: "URL",
|
||||
emoji: "емодзі",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "дата та час ISO",
|
||||
date: "дата ISO",
|
||||
time: "час ISO",
|
||||
duration: "тривалість ISO",
|
||||
ipv4: "адреса IPv4",
|
||||
ipv6: "адреса IPv6",
|
||||
cidrv4: "діапазон IPv4",
|
||||
cidrv6: "діапазон IPv6",
|
||||
base64: "рядок у кодуванні base64",
|
||||
base64url: "рядок у кодуванні base64url",
|
||||
json_string: "рядок JSON",
|
||||
e164: "номер E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "вхідні дані",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Неправильні вхідні дані: очікується ${issue.expected}, отримано ${(0, exports.parsedType)(issue.input)}`;
|
||||
// return `Неправильні вхідні дані: очікується ${issue.expected}, отримано ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Неправильні вхідні дані: очікується ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Неправильна опція: очікується одне з ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Занадто велике: очікується, що ${issue.origin ?? "значення"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "елементів"}`;
|
||||
return `Занадто велике: очікується, що ${issue.origin ?? "значення"} буде ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Занадто мале: очікується, що ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Занадто мале: очікується, що ${issue.origin} буде ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Неправильний рядок: повинен починатися з "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Неправильний рядок: повинен закінчуватися на "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Неправильний рядок: повинен містити "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Неправильний рядок: повинен відповідати шаблону ${_issue.pattern}`;
|
||||
return `Неправильний ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Неправильне число: повинно бути кратним ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Нерозпізнаний ключ${issue.keys.length > 1 ? "і" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Неправильний ключ у ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Неправильні вхідні дані";
|
||||
case "invalid_element":
|
||||
return `Неправильне значення у ${issue.origin}`;
|
||||
default:
|
||||
return `Неправильні вхідні дані`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
144
node_modules/zod/dist/cjs/v4/locales/ur.js
generated
vendored
144
node_modules/zod/dist/cjs/v4/locales/ur.js
generated
vendored
@@ -1,144 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "حروف", verb: "ہونا" },
|
||||
file: { unit: "بائٹس", verb: "ہونا" },
|
||||
array: { unit: "آئٹمز", verb: "ہونا" },
|
||||
set: { unit: "آئٹمز", verb: "ہونا" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "نمبر";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "آرے";
|
||||
}
|
||||
if (data === null) {
|
||||
return "نل";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "ان پٹ",
|
||||
email: "ای میل ایڈریس",
|
||||
url: "یو آر ایل",
|
||||
emoji: "ایموجی",
|
||||
uuid: "یو یو آئی ڈی",
|
||||
uuidv4: "یو یو آئی ڈی وی 4",
|
||||
uuidv6: "یو یو آئی ڈی وی 6",
|
||||
nanoid: "نینو آئی ڈی",
|
||||
guid: "جی یو آئی ڈی",
|
||||
cuid: "سی یو آئی ڈی",
|
||||
cuid2: "سی یو آئی ڈی 2",
|
||||
ulid: "یو ایل آئی ڈی",
|
||||
xid: "ایکس آئی ڈی",
|
||||
ksuid: "کے ایس یو آئی ڈی",
|
||||
datetime: "آئی ایس او ڈیٹ ٹائم",
|
||||
date: "آئی ایس او تاریخ",
|
||||
time: "آئی ایس او وقت",
|
||||
duration: "آئی ایس او مدت",
|
||||
ipv4: "آئی پی وی 4 ایڈریس",
|
||||
ipv6: "آئی پی وی 6 ایڈریس",
|
||||
cidrv4: "آئی پی وی 4 رینج",
|
||||
cidrv6: "آئی پی وی 6 رینج",
|
||||
base64: "بیس 64 ان کوڈڈ سٹرنگ",
|
||||
base64url: "بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",
|
||||
json_string: "جے ایس او این سٹرنگ",
|
||||
e164: "ای 164 نمبر",
|
||||
jwt: "جے ڈبلیو ٹی",
|
||||
template_literal: "ان پٹ",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `غلط ان پٹ: ${issue.expected} متوقع تھا، ${(0, exports.parsedType)(issue.input)} موصول ہوا`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `غلط ان پٹ: ${util.stringifyPrimitive(issue.values[0])} متوقع تھا`;
|
||||
return `غلط آپشن: ${util.joinValues(issue.values, "|")} میں سے ایک متوقع تھا`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `بہت بڑا: ${issue.origin ?? "ویلیو"} کے ${adj}${issue.maximum.toString()} ${sizing.unit ?? "عناصر"} ہونے متوقع تھے`;
|
||||
return `بہت بڑا: ${issue.origin ?? "ویلیو"} کا ${adj}${issue.maximum.toString()} ہونا متوقع تھا`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `بہت چھوٹا: ${issue.origin} کے ${adj}${issue.minimum.toString()} ${sizing.unit} ہونے متوقع تھے`;
|
||||
}
|
||||
return `بہت چھوٹا: ${issue.origin} کا ${adj}${issue.minimum.toString()} ہونا متوقع تھا`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `غلط سٹرنگ: "${_issue.prefix}" سے شروع ہونا چاہیے`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `غلط سٹرنگ: "${_issue.suffix}" پر ختم ہونا چاہیے`;
|
||||
if (_issue.format === "includes")
|
||||
return `غلط سٹرنگ: "${_issue.includes}" شامل ہونا چاہیے`;
|
||||
if (_issue.format === "regex")
|
||||
return `غلط سٹرنگ: پیٹرن ${_issue.pattern} سے میچ ہونا چاہیے`;
|
||||
return `غلط ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `غلط نمبر: ${issue.divisor} کا مضاعف ہونا چاہیے`;
|
||||
case "unrecognized_keys":
|
||||
return `غیر تسلیم شدہ کی${issue.keys.length > 1 ? "ز" : ""}: ${util.joinValues(issue.keys, "، ")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} میں غلط کی`;
|
||||
case "invalid_union":
|
||||
return "غلط ان پٹ";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} میں غلط ویلیو`;
|
||||
default:
|
||||
return `غلط ان پٹ`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
143
node_modules/zod/dist/cjs/v4/locales/vi.js
generated
vendored
143
node_modules/zod/dist/cjs/v4/locales/vi.js
generated
vendored
@@ -1,143 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "ký tự", verb: "có" },
|
||||
file: { unit: "byte", verb: "có" },
|
||||
array: { unit: "phần tử", verb: "có" },
|
||||
set: { unit: "phần tử", verb: "có" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "số";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "mảng";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "đầu vào",
|
||||
email: "địa chỉ email",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ngày giờ ISO",
|
||||
date: "ngày ISO",
|
||||
time: "giờ ISO",
|
||||
duration: "khoảng thời gian ISO",
|
||||
ipv4: "địa chỉ IPv4",
|
||||
ipv6: "địa chỉ IPv6",
|
||||
cidrv4: "dải IPv4",
|
||||
cidrv6: "dải IPv6",
|
||||
base64: "chuỗi mã hóa base64",
|
||||
base64url: "chuỗi mã hóa base64url",
|
||||
json_string: "chuỗi JSON",
|
||||
e164: "số E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "đầu vào",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Đầu vào không hợp lệ: mong đợi ${issue.expected}, nhận được ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Đầu vào không hợp lệ: mong đợi ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Quá lớn: mong đợi ${issue.origin ?? "giá trị"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "phần tử"}`;
|
||||
return `Quá lớn: mong đợi ${issue.origin ?? "giá trị"} ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Quá nhỏ: mong đợi ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Quá nhỏ: mong đợi ${issue.origin} ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Chuỗi không hợp lệ: phải bắt đầu bằng "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Chuỗi không hợp lệ: phải kết thúc bằng "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Chuỗi không hợp lệ: phải bao gồm "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Chuỗi không hợp lệ: phải khớp với mẫu ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} không hợp lệ`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Số không hợp lệ: phải là bội số của ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Khóa không được nhận dạng: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Khóa không hợp lệ trong ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Đầu vào không hợp lệ";
|
||||
case "invalid_element":
|
||||
return `Giá trị không hợp lệ trong ${issue.origin}`;
|
||||
default:
|
||||
return `Đầu vào không hợp lệ`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
143
node_modules/zod/dist/cjs/v4/locales/zh-CN.js
generated
vendored
143
node_modules/zod/dist/cjs/v4/locales/zh-CN.js
generated
vendored
@@ -1,143 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "字符", verb: "包含" },
|
||||
file: { unit: "字节", verb: "包含" },
|
||||
array: { unit: "项", verb: "包含" },
|
||||
set: { unit: "项", verb: "包含" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "非数字(NaN)" : "数字";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "数组";
|
||||
}
|
||||
if (data === null) {
|
||||
return "空值(null)";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "输入",
|
||||
email: "电子邮件",
|
||||
url: "URL",
|
||||
emoji: "表情符号",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO日期时间",
|
||||
date: "ISO日期",
|
||||
time: "ISO时间",
|
||||
duration: "ISO时长",
|
||||
ipv4: "IPv4地址",
|
||||
ipv6: "IPv6地址",
|
||||
cidrv4: "IPv4网段",
|
||||
cidrv6: "IPv6网段",
|
||||
base64: "base64编码字符串",
|
||||
base64url: "base64url编码字符串",
|
||||
json_string: "JSON字符串",
|
||||
e164: "E.164号码",
|
||||
jwt: "JWT",
|
||||
template_literal: "输入",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `无效输入:期望 ${issue.expected},实际接收 ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `无效输入:期望 ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `无效选项:期望以下之一 ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `数值过大:期望 ${issue.origin ?? "值"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "个元素"}`;
|
||||
return `数值过大:期望 ${issue.origin ?? "值"} ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `数值过小:期望 ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `数值过小:期望 ${issue.origin} ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `无效字符串:必须以 "${_issue.prefix}" 开头`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `无效字符串:必须以 "${_issue.suffix}" 结尾`;
|
||||
if (_issue.format === "includes")
|
||||
return `无效字符串:必须包含 "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `无效字符串:必须满足正则表达式 ${_issue.pattern}`;
|
||||
return `无效${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `无效数字:必须是 ${issue.divisor} 的倍数`;
|
||||
case "unrecognized_keys":
|
||||
return `出现未知的键(key): ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} 中的键(key)无效`;
|
||||
case "invalid_union":
|
||||
return "无效输入";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} 中包含无效值(value)`;
|
||||
default:
|
||||
return `无效输入`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
144
node_modules/zod/dist/cjs/v4/locales/zh-tw.js
generated
vendored
144
node_modules/zod/dist/cjs/v4/locales/zh-tw.js
generated
vendored
@@ -1,144 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.error = exports.parsedType = void 0;
|
||||
exports.default = default_1;
|
||||
const util = __importStar(require("../core/util.js"));
|
||||
const Sizable = {
|
||||
string: { unit: "字元", verb: "擁有" },
|
||||
file: { unit: "位元組", verb: "擁有" },
|
||||
array: { unit: "項目", verb: "擁有" },
|
||||
set: { unit: "項目", verb: "擁有" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.parsedType = parsedType;
|
||||
const Nouns = {
|
||||
regex: "輸入",
|
||||
email: "郵件地址",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO 日期時間",
|
||||
date: "ISO 日期",
|
||||
time: "ISO 時間",
|
||||
duration: "ISO 期間",
|
||||
ipv4: "IPv4 位址",
|
||||
ipv6: "IPv6 位址",
|
||||
cidrv4: "IPv4 範圍",
|
||||
cidrv6: "IPv6 範圍",
|
||||
base64: "base64 編碼字串",
|
||||
base64url: "base64url 編碼字串",
|
||||
json_string: "JSON 字串",
|
||||
e164: "E.164 數值",
|
||||
jwt: "JWT",
|
||||
template_literal: "輸入",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `無效的輸入值:預期為 ${issue.expected},但收到 ${(0, exports.parsedType)(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `無效的輸入值:預期為 ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `無效的選項:預期為以下其中之一 ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `數值過大:預期 ${issue.origin ?? "值"} 應為 ${adj}${issue.maximum.toString()} ${sizing.unit ?? "個元素"}`;
|
||||
return `數值過大:預期 ${issue.origin ?? "值"} 應為 ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `數值過小:預期 ${issue.origin} 應為 ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `數值過小:預期 ${issue.origin} 應為 ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `無效的字串:必須以 "${_issue.prefix}" 開頭`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `無效的字串:必須以 "${_issue.suffix}" 結尾`;
|
||||
if (_issue.format === "includes")
|
||||
return `無效的字串:必須包含 "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `無效的字串:必須符合格式 ${_issue.pattern}`;
|
||||
return `無效的 ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `無效的數字:必須為 ${issue.divisor} 的倍數`;
|
||||
case "unrecognized_keys":
|
||||
return `無法識別的鍵值${issue.keys.length > 1 ? "們" : ""}:${util.joinValues(issue.keys, "、")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} 中有無效的鍵值`;
|
||||
case "invalid_union":
|
||||
return "無效的輸入值";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} 中有無效的值`;
|
||||
default:
|
||||
return `無效的輸入值`;
|
||||
}
|
||||
};
|
||||
exports.error = error;
|
||||
function default_1() {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
51
node_modules/zod/dist/cjs/v4/mini/external.js
generated
vendored
51
node_modules/zod/dist/cjs/v4/mini/external.js
generated
vendored
@@ -1,51 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.locales = exports.toJSONSchema = exports.flattenError = exports.formatError = exports.prettifyError = exports.treeifyError = exports.regexes = exports.clone = exports.function = exports.$brand = exports.$input = exports.$output = exports.config = exports.registry = exports.globalRegistry = exports.core = void 0;
|
||||
exports.core = __importStar(require("zod/v4/core"));
|
||||
__exportStar(require("./parse.js"), exports);
|
||||
__exportStar(require("./schemas.js"), exports);
|
||||
__exportStar(require("./checks.js"), exports);
|
||||
var core_1 = require("zod/v4/core");
|
||||
Object.defineProperty(exports, "globalRegistry", { enumerable: true, get: function () { return core_1.globalRegistry; } });
|
||||
Object.defineProperty(exports, "registry", { enumerable: true, get: function () { return core_1.registry; } });
|
||||
Object.defineProperty(exports, "config", { enumerable: true, get: function () { return core_1.config; } });
|
||||
Object.defineProperty(exports, "$output", { enumerable: true, get: function () { return core_1.$output; } });
|
||||
Object.defineProperty(exports, "$input", { enumerable: true, get: function () { return core_1.$input; } });
|
||||
Object.defineProperty(exports, "$brand", { enumerable: true, get: function () { return core_1.$brand; } });
|
||||
Object.defineProperty(exports, "function", { enumerable: true, get: function () { return core_1.function; } });
|
||||
Object.defineProperty(exports, "clone", { enumerable: true, get: function () { return core_1.clone; } });
|
||||
Object.defineProperty(exports, "regexes", { enumerable: true, get: function () { return core_1.regexes; } });
|
||||
Object.defineProperty(exports, "treeifyError", { enumerable: true, get: function () { return core_1.treeifyError; } });
|
||||
Object.defineProperty(exports, "prettifyError", { enumerable: true, get: function () { return core_1.prettifyError; } });
|
||||
Object.defineProperty(exports, "formatError", { enumerable: true, get: function () { return core_1.formatError; } });
|
||||
Object.defineProperty(exports, "flattenError", { enumerable: true, get: function () { return core_1.flattenError; } });
|
||||
Object.defineProperty(exports, "toJSONSchema", { enumerable: true, get: function () { return core_1.toJSONSchema; } });
|
||||
Object.defineProperty(exports, "locales", { enumerable: true, get: function () { return core_1.locales; } });
|
||||
/** A special constant with type `never` */
|
||||
// export const NEVER = {} as never;
|
||||
3
node_modules/zod/dist/esm/index.js
generated
vendored
3
node_modules/zod/dist/esm/index.js
generated
vendored
@@ -1,3 +0,0 @@
|
||||
import z3 from "./v3/index.js";
|
||||
export * from "./v3/index.js";
|
||||
export default z3;
|
||||
3
node_modules/zod/dist/esm/package.json
generated
vendored
3
node_modules/zod/dist/esm/package.json
generated
vendored
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
74
node_modules/zod/dist/esm/v3/benchmarks/discriminatedUnion.js
generated
vendored
74
node_modules/zod/dist/esm/v3/benchmarks/discriminatedUnion.js
generated
vendored
@@ -1,74 +0,0 @@
|
||||
import Benchmark from "benchmark";
|
||||
import { z } from "zod/v3";
|
||||
const doubleSuite = new Benchmark.Suite("z.discriminatedUnion: double");
|
||||
const manySuite = new Benchmark.Suite("z.discriminatedUnion: many");
|
||||
const aSchema = z.object({
|
||||
type: z.literal("a"),
|
||||
});
|
||||
const objA = {
|
||||
type: "a",
|
||||
};
|
||||
const bSchema = z.object({
|
||||
type: z.literal("b"),
|
||||
});
|
||||
const objB = {
|
||||
type: "b",
|
||||
};
|
||||
const cSchema = z.object({
|
||||
type: z.literal("c"),
|
||||
});
|
||||
const objC = {
|
||||
type: "c",
|
||||
};
|
||||
const dSchema = z.object({
|
||||
type: z.literal("d"),
|
||||
});
|
||||
const double = z.discriminatedUnion("type", [aSchema, bSchema]);
|
||||
const many = z.discriminatedUnion("type", [aSchema, bSchema, cSchema, dSchema]);
|
||||
doubleSuite
|
||||
.add("valid: a", () => {
|
||||
double.parse(objA);
|
||||
})
|
||||
.add("valid: b", () => {
|
||||
double.parse(objB);
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
double.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.add("invalid: wrong shape", () => {
|
||||
try {
|
||||
double.parse(objC);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${doubleSuite.name}: ${e.target}`);
|
||||
});
|
||||
manySuite
|
||||
.add("valid: a", () => {
|
||||
many.parse(objA);
|
||||
})
|
||||
.add("valid: c", () => {
|
||||
many.parse(objC);
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
many.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.add("invalid: wrong shape", () => {
|
||||
try {
|
||||
many.parse({ type: "unknown" });
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${manySuite.name}: ${e.target}`);
|
||||
});
|
||||
export default {
|
||||
suites: [doubleSuite, manySuite],
|
||||
};
|
||||
54
node_modules/zod/dist/esm/v3/benchmarks/index.js
generated
vendored
54
node_modules/zod/dist/esm/v3/benchmarks/index.js
generated
vendored
@@ -1,54 +0,0 @@
|
||||
import datetimeBenchmarks from "./datetime.js";
|
||||
import discriminatedUnionBenchmarks from "./discriminatedUnion.js";
|
||||
import ipv4Benchmarks from "./ipv4.js";
|
||||
import objectBenchmarks from "./object.js";
|
||||
import primitiveBenchmarks from "./primitives.js";
|
||||
import realworld from "./realworld.js";
|
||||
import stringBenchmarks from "./string.js";
|
||||
import unionBenchmarks from "./union.js";
|
||||
const argv = process.argv.slice(2);
|
||||
let suites = [];
|
||||
if (!argv.length) {
|
||||
suites = [
|
||||
...realworld.suites,
|
||||
...primitiveBenchmarks.suites,
|
||||
...stringBenchmarks.suites,
|
||||
...objectBenchmarks.suites,
|
||||
...unionBenchmarks.suites,
|
||||
...discriminatedUnionBenchmarks.suites,
|
||||
];
|
||||
}
|
||||
else {
|
||||
if (argv.includes("--realworld")) {
|
||||
suites.push(...realworld.suites);
|
||||
}
|
||||
if (argv.includes("--primitives")) {
|
||||
suites.push(...primitiveBenchmarks.suites);
|
||||
}
|
||||
if (argv.includes("--string")) {
|
||||
suites.push(...stringBenchmarks.suites);
|
||||
}
|
||||
if (argv.includes("--object")) {
|
||||
suites.push(...objectBenchmarks.suites);
|
||||
}
|
||||
if (argv.includes("--union")) {
|
||||
suites.push(...unionBenchmarks.suites);
|
||||
}
|
||||
if (argv.includes("--discriminatedUnion")) {
|
||||
suites.push(...datetimeBenchmarks.suites);
|
||||
}
|
||||
if (argv.includes("--datetime")) {
|
||||
suites.push(...datetimeBenchmarks.suites);
|
||||
}
|
||||
if (argv.includes("--ipv4")) {
|
||||
suites.push(...ipv4Benchmarks.suites);
|
||||
}
|
||||
}
|
||||
for (const suite of suites) {
|
||||
suite.run({});
|
||||
}
|
||||
// exit on Ctrl-C
|
||||
process.on("SIGINT", function () {
|
||||
console.log("Exiting...");
|
||||
process.exit();
|
||||
});
|
||||
65
node_modules/zod/dist/esm/v3/benchmarks/object.js
generated
vendored
65
node_modules/zod/dist/esm/v3/benchmarks/object.js
generated
vendored
@@ -1,65 +0,0 @@
|
||||
import Benchmark from "benchmark";
|
||||
import { z } from "zod/v3";
|
||||
const emptySuite = new Benchmark.Suite("z.object: empty");
|
||||
const shortSuite = new Benchmark.Suite("z.object: short");
|
||||
const longSuite = new Benchmark.Suite("z.object: long");
|
||||
const empty = z.object({});
|
||||
const short = z.object({
|
||||
string: z.string(),
|
||||
});
|
||||
const long = z.object({
|
||||
string: z.string(),
|
||||
number: z.number(),
|
||||
boolean: z.boolean(),
|
||||
});
|
||||
emptySuite
|
||||
.add("valid", () => {
|
||||
empty.parse({});
|
||||
})
|
||||
.add("valid: extra keys", () => {
|
||||
empty.parse({ string: "string" });
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
empty.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${emptySuite.name}: ${e.target}`);
|
||||
});
|
||||
shortSuite
|
||||
.add("valid", () => {
|
||||
short.parse({ string: "string" });
|
||||
})
|
||||
.add("valid: extra keys", () => {
|
||||
short.parse({ string: "string", number: 42 });
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
short.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${shortSuite.name}: ${e.target}`);
|
||||
});
|
||||
longSuite
|
||||
.add("valid", () => {
|
||||
long.parse({ string: "string", number: 42, boolean: true });
|
||||
})
|
||||
.add("valid: extra keys", () => {
|
||||
long.parse({ string: "string", number: 42, boolean: true, list: [] });
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
long.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${longSuite.name}: ${e.target}`);
|
||||
});
|
||||
export default {
|
||||
suites: [emptySuite, shortSuite, longSuite],
|
||||
};
|
||||
154
node_modules/zod/dist/esm/v3/benchmarks/primitives.js
generated
vendored
154
node_modules/zod/dist/esm/v3/benchmarks/primitives.js
generated
vendored
@@ -1,154 +0,0 @@
|
||||
import Benchmark from "benchmark";
|
||||
import { z } from "zod/v3";
|
||||
import { Mocker } from "../tests/Mocker.js";
|
||||
const val = new Mocker();
|
||||
const enumSuite = new Benchmark.Suite("z.enum");
|
||||
const enumSchema = z.enum(["a", "b", "c"]);
|
||||
enumSuite
|
||||
.add("valid", () => {
|
||||
enumSchema.parse("a");
|
||||
})
|
||||
.add("invalid", () => {
|
||||
try {
|
||||
enumSchema.parse("x");
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`z.enum: ${e.target}`);
|
||||
});
|
||||
const longEnumSuite = new Benchmark.Suite("long z.enum");
|
||||
const longEnumSchema = z.enum([
|
||||
"one",
|
||||
"two",
|
||||
"three",
|
||||
"four",
|
||||
"five",
|
||||
"six",
|
||||
"seven",
|
||||
"eight",
|
||||
"nine",
|
||||
"ten",
|
||||
"eleven",
|
||||
"twelve",
|
||||
"thirteen",
|
||||
"fourteen",
|
||||
"fifteen",
|
||||
"sixteen",
|
||||
"seventeen",
|
||||
]);
|
||||
longEnumSuite
|
||||
.add("valid", () => {
|
||||
longEnumSchema.parse("five");
|
||||
})
|
||||
.add("invalid", () => {
|
||||
try {
|
||||
longEnumSchema.parse("invalid");
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`long z.enum: ${e.target}`);
|
||||
});
|
||||
const undefinedSuite = new Benchmark.Suite("z.undefined");
|
||||
const undefinedSchema = z.undefined();
|
||||
undefinedSuite
|
||||
.add("valid", () => {
|
||||
undefinedSchema.parse(undefined);
|
||||
})
|
||||
.add("invalid", () => {
|
||||
try {
|
||||
undefinedSchema.parse(1);
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`z.undefined: ${e.target}`);
|
||||
});
|
||||
const literalSuite = new Benchmark.Suite("z.literal");
|
||||
const short = "short";
|
||||
const bad = "bad";
|
||||
const literalSchema = z.literal("short");
|
||||
literalSuite
|
||||
.add("valid", () => {
|
||||
literalSchema.parse(short);
|
||||
})
|
||||
.add("invalid", () => {
|
||||
try {
|
||||
literalSchema.parse(bad);
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`z.literal: ${e.target}`);
|
||||
});
|
||||
const numberSuite = new Benchmark.Suite("z.number");
|
||||
const numberSchema = z.number().int();
|
||||
numberSuite
|
||||
.add("valid", () => {
|
||||
numberSchema.parse(1);
|
||||
})
|
||||
.add("invalid type", () => {
|
||||
try {
|
||||
numberSchema.parse("bad");
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.add("invalid number", () => {
|
||||
try {
|
||||
numberSchema.parse(0.5);
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`z.number: ${e.target}`);
|
||||
});
|
||||
const dateSuite = new Benchmark.Suite("z.date");
|
||||
const plainDate = z.date();
|
||||
const minMaxDate = z.date().min(new Date("2021-01-01")).max(new Date("2030-01-01"));
|
||||
dateSuite
|
||||
.add("valid", () => {
|
||||
plainDate.parse(new Date());
|
||||
})
|
||||
.add("invalid", () => {
|
||||
try {
|
||||
plainDate.parse(1);
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.add("valid min and max", () => {
|
||||
minMaxDate.parse(new Date("2023-01-01"));
|
||||
})
|
||||
.add("invalid min", () => {
|
||||
try {
|
||||
minMaxDate.parse(new Date("2019-01-01"));
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.add("invalid max", () => {
|
||||
try {
|
||||
minMaxDate.parse(new Date("2031-01-01"));
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`z.date: ${e.target}`);
|
||||
});
|
||||
const symbolSuite = new Benchmark.Suite("z.symbol");
|
||||
const symbolSchema = z.symbol();
|
||||
symbolSuite
|
||||
.add("valid", () => {
|
||||
symbolSchema.parse(val.symbol);
|
||||
})
|
||||
.add("invalid", () => {
|
||||
try {
|
||||
symbolSchema.parse(1);
|
||||
}
|
||||
catch (_e) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`z.symbol: ${e.target}`);
|
||||
});
|
||||
export default {
|
||||
suites: [enumSuite, longEnumSuite, undefinedSuite, literalSuite, numberSuite, dateSuite, symbolSuite],
|
||||
};
|
||||
51
node_modules/zod/dist/esm/v3/benchmarks/realworld.js
generated
vendored
51
node_modules/zod/dist/esm/v3/benchmarks/realworld.js
generated
vendored
@@ -1,51 +0,0 @@
|
||||
import Benchmark from "benchmark";
|
||||
import { z } from "zod/v3";
|
||||
const shortSuite = new Benchmark.Suite("realworld");
|
||||
const People = z.array(z.object({
|
||||
type: z.literal("person"),
|
||||
hair: z.enum(["blue", "brown"]),
|
||||
active: z.boolean(),
|
||||
name: z.string(),
|
||||
age: z.number().int(),
|
||||
hobbies: z.array(z.string()),
|
||||
address: z.object({
|
||||
street: z.string(),
|
||||
zip: z.string(),
|
||||
country: z.string(),
|
||||
}),
|
||||
}));
|
||||
let i = 0;
|
||||
function num() {
|
||||
return ++i;
|
||||
}
|
||||
function str() {
|
||||
return (++i % 100).toString(16);
|
||||
}
|
||||
function array(fn) {
|
||||
return Array.from({ length: ++i % 10 }, () => fn());
|
||||
}
|
||||
const people = Array.from({ length: 100 }, () => {
|
||||
return {
|
||||
type: "person",
|
||||
hair: i % 2 ? "blue" : "brown",
|
||||
active: !!(i % 2),
|
||||
name: str(),
|
||||
age: num(),
|
||||
hobbies: array(str),
|
||||
address: {
|
||||
street: str(),
|
||||
zip: str(),
|
||||
country: str(),
|
||||
},
|
||||
};
|
||||
});
|
||||
shortSuite
|
||||
.add("valid", () => {
|
||||
People.parse(people);
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${shortSuite.name}: ${e.target}`);
|
||||
});
|
||||
export default {
|
||||
suites: [shortSuite],
|
||||
};
|
||||
74
node_modules/zod/dist/esm/v3/benchmarks/union.js
generated
vendored
74
node_modules/zod/dist/esm/v3/benchmarks/union.js
generated
vendored
@@ -1,74 +0,0 @@
|
||||
import Benchmark from "benchmark";
|
||||
import { z } from "zod/v3";
|
||||
const doubleSuite = new Benchmark.Suite("z.union: double");
|
||||
const manySuite = new Benchmark.Suite("z.union: many");
|
||||
const aSchema = z.object({
|
||||
type: z.literal("a"),
|
||||
});
|
||||
const objA = {
|
||||
type: "a",
|
||||
};
|
||||
const bSchema = z.object({
|
||||
type: z.literal("b"),
|
||||
});
|
||||
const objB = {
|
||||
type: "b",
|
||||
};
|
||||
const cSchema = z.object({
|
||||
type: z.literal("c"),
|
||||
});
|
||||
const objC = {
|
||||
type: "c",
|
||||
};
|
||||
const dSchema = z.object({
|
||||
type: z.literal("d"),
|
||||
});
|
||||
const double = z.union([aSchema, bSchema]);
|
||||
const many = z.union([aSchema, bSchema, cSchema, dSchema]);
|
||||
doubleSuite
|
||||
.add("valid: a", () => {
|
||||
double.parse(objA);
|
||||
})
|
||||
.add("valid: b", () => {
|
||||
double.parse(objB);
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
double.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.add("invalid: wrong shape", () => {
|
||||
try {
|
||||
double.parse(objC);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${doubleSuite.name}: ${e.target}`);
|
||||
});
|
||||
manySuite
|
||||
.add("valid: a", () => {
|
||||
many.parse(objA);
|
||||
})
|
||||
.add("valid: c", () => {
|
||||
many.parse(objC);
|
||||
})
|
||||
.add("invalid: null", () => {
|
||||
try {
|
||||
many.parse(null);
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.add("invalid: wrong shape", () => {
|
||||
try {
|
||||
many.parse({ type: "unknown" });
|
||||
}
|
||||
catch (_err) { }
|
||||
})
|
||||
.on("cycle", (e) => {
|
||||
console.log(`${manySuite.name}: ${e.target}`);
|
||||
});
|
||||
export default {
|
||||
suites: [doubleSuite, manySuite],
|
||||
};
|
||||
53
node_modules/zod/dist/esm/v3/tests/Mocker.js
generated
vendored
53
node_modules/zod/dist/esm/v3/tests/Mocker.js
generated
vendored
@@ -1,53 +0,0 @@
|
||||
function getRandomInt(max) {
|
||||
return Math.floor(Math.random() * Math.floor(max));
|
||||
}
|
||||
const testSymbol = Symbol("test");
|
||||
export class Mocker {
|
||||
constructor() {
|
||||
this.pick = (...args) => {
|
||||
return args[getRandomInt(args.length)];
|
||||
};
|
||||
}
|
||||
get string() {
|
||||
return Math.random().toString(36).substring(7);
|
||||
}
|
||||
get number() {
|
||||
return Math.random() * 100;
|
||||
}
|
||||
get bigint() {
|
||||
return BigInt(Math.floor(Math.random() * 10000));
|
||||
}
|
||||
get boolean() {
|
||||
return Math.random() < 0.5;
|
||||
}
|
||||
get date() {
|
||||
return new Date(Math.floor(Date.now() * Math.random()));
|
||||
}
|
||||
get symbol() {
|
||||
return testSymbol;
|
||||
}
|
||||
get null() {
|
||||
return null;
|
||||
}
|
||||
get undefined() {
|
||||
return undefined;
|
||||
}
|
||||
get stringOptional() {
|
||||
return this.pick(this.string, this.undefined);
|
||||
}
|
||||
get stringNullable() {
|
||||
return this.pick(this.string, this.null);
|
||||
}
|
||||
get numberOptional() {
|
||||
return this.pick(this.number, this.undefined);
|
||||
}
|
||||
get numberNullable() {
|
||||
return this.pick(this.number, this.null);
|
||||
}
|
||||
get booleanOptional() {
|
||||
return this.pick(this.boolean, this.undefined);
|
||||
}
|
||||
get booleanNullable() {
|
||||
return this.pick(this.boolean, this.null);
|
||||
}
|
||||
}
|
||||
11
node_modules/zod/dist/esm/v4/classic/external.js
generated
vendored
11
node_modules/zod/dist/esm/v4/classic/external.js
generated
vendored
@@ -1,11 +0,0 @@
|
||||
export * as core from "zod/v4/core";
|
||||
export * from "./schemas.js";
|
||||
export * from "./checks.js";
|
||||
export * from "./errors.js";
|
||||
export * from "./parse.js";
|
||||
export * from "./compat.js";
|
||||
// zod-specified
|
||||
import { config } from "zod/v4/core";
|
||||
import en from "zod/v4/locales/en.js";
|
||||
config(en());
|
||||
export { globalRegistry, registry, config, function, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, locales, } from "zod/v4/core";
|
||||
6
node_modules/zod/dist/esm/v4/core/config.js
generated
vendored
6
node_modules/zod/dist/esm/v4/core/config.js
generated
vendored
@@ -1,6 +0,0 @@
|
||||
export const globalConfig = {};
|
||||
export function config(config) {
|
||||
if (config)
|
||||
Object.assign(globalConfig, config);
|
||||
return globalConfig;
|
||||
}
|
||||
53
node_modules/zod/dist/esm/v4/core/core.js
generated
vendored
53
node_modules/zod/dist/esm/v4/core/core.js
generated
vendored
@@ -1,53 +0,0 @@
|
||||
export /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, params) {
|
||||
const Parent = params?.Parent ?? Object;
|
||||
class _ extends Parent {
|
||||
constructor(def) {
|
||||
var _a;
|
||||
super();
|
||||
const th = this;
|
||||
_.init(th, def);
|
||||
(_a = th._zod).deferred ?? (_a.deferred = []);
|
||||
for (const fn of th._zod.deferred) {
|
||||
fn();
|
||||
}
|
||||
}
|
||||
static init(inst, def) {
|
||||
var _a;
|
||||
Object.defineProperty(inst, "_zod", {
|
||||
value: inst._zod ?? {},
|
||||
enumerable: false,
|
||||
});
|
||||
// inst._zod ??= {} as any;
|
||||
(_a = inst._zod).traits ?? (_a.traits = new Set());
|
||||
// const seen = inst._zod.traits.has(name);
|
||||
inst._zod.traits.add(name);
|
||||
initializer(inst, def);
|
||||
// support prototype modifications
|
||||
for (const k in _.prototype) {
|
||||
Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });
|
||||
}
|
||||
inst._zod.constr = _;
|
||||
inst._zod.def = def;
|
||||
}
|
||||
static [Symbol.hasInstance](inst) {
|
||||
if (params?.Parent && inst instanceof params.Parent)
|
||||
return true;
|
||||
return inst?._zod?.traits?.has(name);
|
||||
}
|
||||
}
|
||||
Object.defineProperty(_, "name", { value: name });
|
||||
return _;
|
||||
}
|
||||
////////////////////////////// UTILITIES ///////////////////////////////////////
|
||||
export const $brand = Symbol("zod_brand");
|
||||
export class $ZodAsyncError extends Error {
|
||||
constructor() {
|
||||
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
||||
}
|
||||
}
|
||||
export const globalConfig = {};
|
||||
export function config(newConfig) {
|
||||
if (newConfig)
|
||||
Object.assign(globalConfig, newConfig);
|
||||
return globalConfig;
|
||||
}
|
||||
664
node_modules/zod/dist/esm/v4/core/to-json-schema.js
generated
vendored
664
node_modules/zod/dist/esm/v4/core/to-json-schema.js
generated
vendored
@@ -1,664 +0,0 @@
|
||||
import { $ZodRegistry, globalRegistry } from "./registries.js";
|
||||
const formatMap = {
|
||||
guid: "uuid",
|
||||
url: "uri",
|
||||
datetime: "date-time",
|
||||
json_string: "json-string",
|
||||
};
|
||||
export class JSONSchemaGenerator {
|
||||
constructor(params) {
|
||||
this.counter = 0;
|
||||
this.metadataRegistry = params?.metadata ?? globalRegistry;
|
||||
this.target = params?.target ?? "draft-2020-12";
|
||||
this.unrepresentable = params?.unrepresentable ?? "throw";
|
||||
this.override = params?.override ?? (() => { });
|
||||
this.io = params?.io ?? "output";
|
||||
this.seen = new Map();
|
||||
}
|
||||
process(schema, _params = { path: [], schemaPath: [] }) {
|
||||
var _a;
|
||||
const def = schema._zod.def;
|
||||
// check for schema in seens
|
||||
const seen = this.seen.get(schema);
|
||||
if (seen) {
|
||||
seen.count++;
|
||||
// check if cycle
|
||||
const isCycle = _params.schemaPath.includes(schema);
|
||||
if (isCycle) {
|
||||
seen.cycle = _params.path;
|
||||
}
|
||||
seen.count++;
|
||||
// break cycle
|
||||
return seen.schema;
|
||||
}
|
||||
// initialize
|
||||
const result = { schema: {}, count: 1, cycle: undefined };
|
||||
this.seen.set(schema, result);
|
||||
if (schema._zod.toJSONSchema) {
|
||||
// custom method overrides default behavior
|
||||
result.schema = schema._zod.toJSONSchema();
|
||||
}
|
||||
// check if external
|
||||
// const ext = this.external?.registry.get(schema)?.id;
|
||||
// if (ext) {
|
||||
// result.external = ext;
|
||||
// }
|
||||
const params = {
|
||||
..._params,
|
||||
schemaPath: [..._params.schemaPath, schema],
|
||||
path: _params.path,
|
||||
};
|
||||
const parent = schema._zod.parent;
|
||||
// if (parent) {
|
||||
// // schema was cloned from another schema
|
||||
// result.ref = parent;
|
||||
// this.process(parent, params);
|
||||
// this.seen.get(parent)!.isParent = true;
|
||||
// }
|
||||
if (parent) {
|
||||
// schema was cloned from another schema
|
||||
result.ref = parent;
|
||||
this.process(parent, params);
|
||||
this.seen.get(parent).isParent = true;
|
||||
}
|
||||
else {
|
||||
const _json = result.schema;
|
||||
switch (def.type) {
|
||||
case "string": {
|
||||
const json = _json;
|
||||
json.type = "string";
|
||||
const { minimum, maximum, format, pattern, contentEncoding } = schema._zod.bag;
|
||||
if (typeof minimum === "number")
|
||||
json.minLength = minimum;
|
||||
if (typeof maximum === "number")
|
||||
json.maxLength = maximum;
|
||||
// custom pattern overrides format
|
||||
if (format) {
|
||||
json.format = formatMap[format] ?? format;
|
||||
}
|
||||
if (pattern) {
|
||||
json.pattern = pattern.source;
|
||||
}
|
||||
if (contentEncoding)
|
||||
json.contentEncoding = contentEncoding;
|
||||
break;
|
||||
}
|
||||
case "number": {
|
||||
const json = _json;
|
||||
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
|
||||
if (typeof format === "string" && format.includes("int"))
|
||||
json.type = "integer";
|
||||
else
|
||||
json.type = "number";
|
||||
if (typeof exclusiveMinimum === "number")
|
||||
json.exclusiveMinimum = exclusiveMinimum;
|
||||
if (typeof minimum === "number") {
|
||||
json.minimum = minimum;
|
||||
if (typeof exclusiveMinimum === "number") {
|
||||
if (exclusiveMinimum >= minimum)
|
||||
delete json.minimum;
|
||||
else
|
||||
delete json.exclusiveMinimum;
|
||||
}
|
||||
}
|
||||
if (typeof exclusiveMaximum === "number")
|
||||
json.exclusiveMaximum = exclusiveMaximum;
|
||||
if (typeof maximum === "number") {
|
||||
json.maximum = maximum;
|
||||
if (typeof exclusiveMaximum === "number") {
|
||||
if (exclusiveMaximum <= maximum)
|
||||
delete json.maximum;
|
||||
else
|
||||
delete json.exclusiveMaximum;
|
||||
}
|
||||
}
|
||||
if (typeof multipleOf === "number")
|
||||
json.multipleOf = multipleOf;
|
||||
break;
|
||||
}
|
||||
case "boolean": {
|
||||
const json = _json;
|
||||
json.type = "boolean";
|
||||
break;
|
||||
}
|
||||
case "bigint": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("BigInt cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "symbol": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Symbols cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "undefined": {
|
||||
const json = _json;
|
||||
json.type = "null";
|
||||
break;
|
||||
}
|
||||
case "null": {
|
||||
_json.type = "null";
|
||||
break;
|
||||
}
|
||||
case "any": {
|
||||
break;
|
||||
}
|
||||
case "unknown": {
|
||||
break;
|
||||
}
|
||||
case "never": {
|
||||
_json.not = {};
|
||||
break;
|
||||
}
|
||||
case "void": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Void cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "date": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Date cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "array": {
|
||||
const json = _json;
|
||||
const { minimum, maximum } = schema._zod.bag;
|
||||
if (typeof minimum === "number")
|
||||
json.minItems = minimum;
|
||||
if (typeof maximum === "number")
|
||||
json.maxItems = maximum;
|
||||
json.type = "array";
|
||||
json.items = this.process(def.element, { ...params, path: [...params.path, "items"] });
|
||||
break;
|
||||
}
|
||||
case "object": {
|
||||
const json = _json;
|
||||
json.type = "object";
|
||||
json.properties = {};
|
||||
const shape = def.shape; // params.shapeCache.get(schema)!;
|
||||
for (const key in shape) {
|
||||
json.properties[key] = this.process(shape[key], {
|
||||
...params,
|
||||
path: [...params.path, "properties", key],
|
||||
});
|
||||
}
|
||||
// required keys
|
||||
const allKeys = new Set(Object.keys(shape));
|
||||
// const optionalKeys = new Set(def.optional);
|
||||
const requiredKeys = new Set([...allKeys].filter((key) => {
|
||||
const v = def.shape[key]._zod;
|
||||
if (this.io === "input") {
|
||||
return v.optin === undefined;
|
||||
}
|
||||
else {
|
||||
return v.optout === undefined;
|
||||
}
|
||||
}));
|
||||
json.required = Array.from(requiredKeys);
|
||||
// catchall
|
||||
if (def.catchall?._zod.def.type === "never") {
|
||||
json.additionalProperties = false;
|
||||
}
|
||||
else if (def.catchall) {
|
||||
json.additionalProperties = this.process(def.catchall, {
|
||||
...params,
|
||||
path: [...params.path, "additionalProperties"],
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "union": {
|
||||
const json = _json;
|
||||
json.anyOf = def.options.map((x, i) => this.process(x, {
|
||||
...params,
|
||||
path: [...params.path, "anyOf", i],
|
||||
}));
|
||||
break;
|
||||
}
|
||||
case "intersection": {
|
||||
const json = _json;
|
||||
json.allOf = [
|
||||
this.process(def.left, {
|
||||
...params,
|
||||
path: [...params.path, "allOf", 0],
|
||||
}),
|
||||
this.process(def.right, {
|
||||
...params,
|
||||
path: [...params.path, "allOf", 1],
|
||||
}),
|
||||
];
|
||||
break;
|
||||
}
|
||||
case "tuple": {
|
||||
const json = _json;
|
||||
json.type = "array";
|
||||
const prefixItems = def.items.map((x, i) => this.process(x, { ...params, path: [...params.path, "prefixItems", i] }));
|
||||
if (this.target === "draft-2020-12") {
|
||||
json.prefixItems = prefixItems;
|
||||
}
|
||||
else {
|
||||
json.items = prefixItems;
|
||||
}
|
||||
if (def.rest) {
|
||||
const rest = this.process(def.rest, {
|
||||
...params,
|
||||
path: [...params.path, "items"],
|
||||
});
|
||||
if (this.target === "draft-2020-12") {
|
||||
json.items = rest;
|
||||
}
|
||||
else {
|
||||
json.additionalItems = rest;
|
||||
}
|
||||
}
|
||||
// additionalItems
|
||||
if (def.rest) {
|
||||
json.items = this.process(def.rest, {
|
||||
...params,
|
||||
path: [...params.path, "items"],
|
||||
});
|
||||
}
|
||||
// length
|
||||
const { minimum, maximum } = schema._zod.bag;
|
||||
if (typeof minimum === "number")
|
||||
json.minItems = minimum;
|
||||
if (typeof maximum === "number")
|
||||
json.maxItems = maximum;
|
||||
break;
|
||||
}
|
||||
case "record": {
|
||||
const json = _json;
|
||||
json.type = "object";
|
||||
json.propertyNames = this.process(def.keyType, { ...params, path: [...params.path, "propertyNames"] });
|
||||
json.additionalProperties = this.process(def.valueType, {
|
||||
...params,
|
||||
path: [...params.path, "additionalProperties"],
|
||||
});
|
||||
break;
|
||||
}
|
||||
case "map": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Map cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "set": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Set cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "enum": {
|
||||
const json = _json;
|
||||
json.enum = Object.values(def.entries);
|
||||
break;
|
||||
}
|
||||
case "literal": {
|
||||
const json = _json;
|
||||
const vals = [];
|
||||
for (const val of def.values) {
|
||||
if (val === undefined) {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
||||
}
|
||||
else {
|
||||
// do not add to vals
|
||||
}
|
||||
}
|
||||
else if (typeof val === "bigint") {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
||||
}
|
||||
else {
|
||||
vals.push(Number(val));
|
||||
}
|
||||
}
|
||||
else {
|
||||
vals.push(val);
|
||||
}
|
||||
}
|
||||
if (vals.length === 0) {
|
||||
// do nothing (an undefined literal was stripped)
|
||||
}
|
||||
else if (vals.length === 1) {
|
||||
const val = vals[0];
|
||||
json.const = val;
|
||||
}
|
||||
else {
|
||||
json.enum = vals;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "file": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("File cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "transform": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Transforms cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "nullable": {
|
||||
const inner = this.process(def.innerType, params);
|
||||
_json.anyOf = [inner, { type: "null" }];
|
||||
break;
|
||||
}
|
||||
case "nonoptional": {
|
||||
this.process(def.innerType, params);
|
||||
result.ref = def.innerType;
|
||||
break;
|
||||
}
|
||||
case "success": {
|
||||
const json = _json;
|
||||
json.type = "boolean";
|
||||
break;
|
||||
}
|
||||
case "default": {
|
||||
this.process(def.innerType, params);
|
||||
result.ref = def.innerType;
|
||||
_json.default = def.defaultValue;
|
||||
break;
|
||||
}
|
||||
case "prefault": {
|
||||
this.process(def.innerType, params);
|
||||
result.ref = def.innerType;
|
||||
if (this.io === "input")
|
||||
_json._prefault = def.defaultValue;
|
||||
break;
|
||||
}
|
||||
case "catch": {
|
||||
// use conditionals
|
||||
this.process(def.innerType, params);
|
||||
result.ref = def.innerType;
|
||||
let catchValue;
|
||||
try {
|
||||
catchValue = def.catchValue(undefined);
|
||||
}
|
||||
catch {
|
||||
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
||||
}
|
||||
_json.default = catchValue;
|
||||
break;
|
||||
}
|
||||
case "nan": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("NaN cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "template_literal": {
|
||||
const json = _json;
|
||||
const pattern = schema._zod.pattern;
|
||||
if (!pattern)
|
||||
throw new Error("Pattern not found in template literal");
|
||||
json.type = "string";
|
||||
json.pattern = pattern.source;
|
||||
break;
|
||||
}
|
||||
case "pipe": {
|
||||
const innerType = this.io === "input" ? def.in : def.out;
|
||||
this.process(innerType, params);
|
||||
result.ref = innerType;
|
||||
break;
|
||||
}
|
||||
case "readonly": {
|
||||
this.process(def.innerType, params);
|
||||
result.ref = def.innerType;
|
||||
_json.readOnly = true;
|
||||
break;
|
||||
}
|
||||
// passthrough types
|
||||
case "promise": {
|
||||
this.process(def.innerType, params);
|
||||
result.ref = def.innerType;
|
||||
break;
|
||||
}
|
||||
case "optional": {
|
||||
this.process(def.innerType, params);
|
||||
result.ref = def.innerType;
|
||||
break;
|
||||
}
|
||||
case "lazy": {
|
||||
const innerType = schema._zod.innerType;
|
||||
this.process(innerType, params);
|
||||
result.ref = innerType;
|
||||
break;
|
||||
}
|
||||
case "custom": {
|
||||
if (this.unrepresentable === "throw") {
|
||||
throw new Error("Custom types cannot be represented in JSON Schema");
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
def;
|
||||
}
|
||||
}
|
||||
}
|
||||
// metadata
|
||||
const meta = this.metadataRegistry.get(schema);
|
||||
if (meta)
|
||||
Object.assign(result.schema, meta);
|
||||
if (this.io === "input" && def.type === "pipe") {
|
||||
// examples/defaults only apply to output type of pipe
|
||||
delete result.schema.examples;
|
||||
delete result.schema.default;
|
||||
if (result.schema._prefault)
|
||||
result.schema.default = result.schema._prefault;
|
||||
}
|
||||
if (this.io === "input" && result.schema._prefault)
|
||||
(_a = result.schema).default ?? (_a.default = result.schema._prefault);
|
||||
delete result.schema._prefault;
|
||||
// pulling fresh from this.seen in case it was overwritten
|
||||
const _result = this.seen.get(schema);
|
||||
return _result.schema;
|
||||
}
|
||||
emit(schema, _params) {
|
||||
const params = {
|
||||
cycles: _params?.cycles ?? "ref",
|
||||
reused: _params?.reused ?? "inline",
|
||||
// unrepresentable: _params?.unrepresentable ?? "throw",
|
||||
// uri: _params?.uri ?? ((id) => `${id}`),
|
||||
external: _params?.external ?? undefined,
|
||||
};
|
||||
// iterate over seen map;
|
||||
const root = this.seen.get(schema);
|
||||
if (!root)
|
||||
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
||||
// initialize result with root schema fields
|
||||
// Object.assign(result, seen.cached);
|
||||
const makeURI = (entry) => {
|
||||
// comparing the seen objects because sometimes
|
||||
// multiple schemas map to the same seen object.
|
||||
// e.g. lazy
|
||||
// external is configured
|
||||
const defsSegment = this.target === "draft-2020-12" ? "$defs" : "definitions";
|
||||
if (params.external) {
|
||||
const externalId = params.external.registry.get(entry[0])?.id; // ?? "__shared";// `__schema${this.counter++}`;
|
||||
// check if schema is in the external registry
|
||||
if (externalId)
|
||||
return { ref: params.external.uri(externalId) };
|
||||
// otherwise, add to __shared
|
||||
const id = entry[1].defId ?? entry[1].schema.id ?? `schema${this.counter++}`;
|
||||
entry[1].defId = id;
|
||||
return { defId: id, ref: `${params.external.uri("__shared")}#/${defsSegment}/${id}` };
|
||||
}
|
||||
if (entry[1] === root) {
|
||||
return { ref: "#" };
|
||||
}
|
||||
// self-contained schema
|
||||
const uriPrefix = `#`;
|
||||
const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
|
||||
const defId = entry[1].schema.id ?? `__schema${this.counter++}`;
|
||||
return { defId, ref: defUriPrefix + defId };
|
||||
};
|
||||
const extractToDef = (entry) => {
|
||||
if (entry[1].schema.$ref) {
|
||||
return;
|
||||
}
|
||||
const seen = entry[1];
|
||||
const { ref, defId } = makeURI(entry);
|
||||
seen.def = { ...seen.schema };
|
||||
// defId won't be set if the schema is a reference to an external schema
|
||||
if (defId)
|
||||
seen.defId = defId;
|
||||
// wipe away all properties except $ref
|
||||
const schema = seen.schema;
|
||||
for (const key in schema) {
|
||||
delete schema[key];
|
||||
schema.$ref = ref;
|
||||
}
|
||||
};
|
||||
// extract schemas into $defs
|
||||
for (const entry of this.seen.entries()) {
|
||||
const seen = entry[1];
|
||||
// convert root schema to # $ref
|
||||
// also prevents root schema from being extracted
|
||||
if (schema === entry[0]) {
|
||||
// do not copy to defs...this is the root schema
|
||||
extractToDef(entry);
|
||||
continue;
|
||||
}
|
||||
// extract schemas that are in the external registry
|
||||
if (params.external) {
|
||||
const ext = params.external.registry.get(entry[0])?.id;
|
||||
if (schema !== entry[0] && ext) {
|
||||
extractToDef(entry);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// extract schemas with `id` meta
|
||||
const id = this.metadataRegistry.get(entry[0])?.id;
|
||||
if (id) {
|
||||
extractToDef(entry);
|
||||
continue;
|
||||
}
|
||||
// break cycles
|
||||
if (seen.cycle) {
|
||||
if (params.cycles === "throw") {
|
||||
throw new Error("Cycle detected: " +
|
||||
`#/${seen.cycle?.join("/")}/<root>` +
|
||||
'\n\nSet the `cycles` parameter to `"ref"` to resolve cyclical schemas with defs.');
|
||||
}
|
||||
else if (params.cycles === "ref") {
|
||||
extractToDef(entry);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// extract reused schemas
|
||||
if (seen.count > 1) {
|
||||
if (params.reused === "ref") {
|
||||
extractToDef(entry);
|
||||
// biome-ignore lint:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
// flatten _refs
|
||||
const flattenRef = (zodSchema, params) => {
|
||||
const seen = this.seen.get(zodSchema);
|
||||
const schema = seen.def ?? seen.schema;
|
||||
const _schema = { ...schema };
|
||||
if (seen.ref === null) {
|
||||
return;
|
||||
}
|
||||
const ref = seen.ref;
|
||||
seen.ref = null;
|
||||
if (ref) {
|
||||
flattenRef(ref, params);
|
||||
const refSchema = this.seen.get(ref).schema;
|
||||
if (refSchema.$ref && params.target === "draft-7") {
|
||||
schema.allOf = schema.allOf ?? [];
|
||||
schema.allOf.push(refSchema);
|
||||
}
|
||||
else {
|
||||
Object.assign(schema, refSchema);
|
||||
Object.assign(schema, _schema); // this is to prevent overwriting any fields in the original schema
|
||||
}
|
||||
}
|
||||
if (!seen.isParent)
|
||||
this.override({
|
||||
zodSchema,
|
||||
jsonSchema: schema,
|
||||
});
|
||||
};
|
||||
for (const entry of [...this.seen.entries()].reverse()) {
|
||||
flattenRef(entry[0], { target: this.target });
|
||||
}
|
||||
const result = { ...root.def };
|
||||
const defs = params.external?.defs ?? {};
|
||||
for (const entry of this.seen.entries()) {
|
||||
const seen = entry[1];
|
||||
if (seen.def && seen.defId) {
|
||||
defs[seen.defId] = seen.def;
|
||||
}
|
||||
}
|
||||
// set definitions in result
|
||||
if (!params.external && Object.keys(defs).length > 0) {
|
||||
if (this.target === "draft-2020-12") {
|
||||
result.$defs = defs;
|
||||
}
|
||||
else {
|
||||
result.definitions = defs;
|
||||
}
|
||||
}
|
||||
if (this.target === "draft-2020-12") {
|
||||
result.$schema = "https://json-schema.org/draft/2020-12/schema";
|
||||
}
|
||||
else if (this.target === "draft-7") {
|
||||
result.$schema = "http://json-schema.org/draft-07/schema#";
|
||||
}
|
||||
else {
|
||||
console.warn(`Invalid target: ${this.target}`);
|
||||
}
|
||||
try {
|
||||
// this "finalizes" this schema and ensures all cycles are removed
|
||||
// each call to .emit() is functionally independent
|
||||
// though the seen map is shared
|
||||
return JSON.parse(JSON.stringify(result));
|
||||
}
|
||||
catch (_err) {
|
||||
throw new Error("Error converting schema to JSON.");
|
||||
}
|
||||
}
|
||||
}
|
||||
export function toJSONSchema(input, _params) {
|
||||
if (input instanceof $ZodRegistry) {
|
||||
const gen = new JSONSchemaGenerator(_params);
|
||||
const defs = {};
|
||||
for (const entry of input._idmap.entries()) {
|
||||
const [_, schema] = entry;
|
||||
gen.process(schema);
|
||||
}
|
||||
const schemas = {};
|
||||
const external = {
|
||||
registry: input,
|
||||
uri: _params?.uri || ((id) => id),
|
||||
defs,
|
||||
};
|
||||
for (const entry of input._idmap.entries()) {
|
||||
const [key, schema] = entry;
|
||||
schemas[key] = gen.emit(schema, {
|
||||
..._params,
|
||||
external,
|
||||
});
|
||||
}
|
||||
if (Object.keys(defs).length > 0) {
|
||||
const defsSegment = gen.target === "draft-2020-12" ? "$defs" : "definitions";
|
||||
schemas.__shared = {
|
||||
[defsSegment]: defs,
|
||||
};
|
||||
}
|
||||
return { schemas };
|
||||
}
|
||||
const gen = new JSONSchemaGenerator(_params);
|
||||
gen.process(input);
|
||||
return gen.emit(input, _params);
|
||||
}
|
||||
115
node_modules/zod/dist/esm/v4/locales/ar.js
generated
vendored
115
node_modules/zod/dist/esm/v4/locales/ar.js
generated
vendored
@@ -1,115 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "حرف", verb: "أن يحوي" },
|
||||
file: { unit: "بايت", verb: "أن يحوي" },
|
||||
array: { unit: "عنصر", verb: "أن يحوي" },
|
||||
set: { unit: "عنصر", verb: "أن يحوي" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "مدخل",
|
||||
email: "بريد إلكتروني",
|
||||
url: "رابط",
|
||||
emoji: "إيموجي",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "تاريخ ووقت بمعيار ISO",
|
||||
date: "تاريخ بمعيار ISO",
|
||||
time: "وقت بمعيار ISO",
|
||||
duration: "مدة بمعيار ISO",
|
||||
ipv4: "عنوان IPv4",
|
||||
ipv6: "عنوان IPv6",
|
||||
cidrv4: "مدى عناوين بصيغة IPv4",
|
||||
cidrv6: "مدى عناوين بصيغة IPv6",
|
||||
base64: "نَص بترميز base64-encoded",
|
||||
base64url: "نَص بترميز base64url-encoded",
|
||||
json_string: "نَص على هيئة JSON",
|
||||
e164: "رقم هاتف بمعيار E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "مدخل",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `مدخلات غير مقبولة: يفترض إدخال ${issue.expected}، ولكن تم إدخال ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `مدخلات غير مقبولة: يفترض إدخال ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return ` أكبر من اللازم: يفترض أن تكون ${issue.origin ?? "القيمة"} ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "عنصر"}`;
|
||||
return `أكبر من اللازم: يفترض أن تكون ${issue.origin ?? "القيمة"} ${adj} ${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `أصغر من اللازم: يفترض لـ ${issue.origin} أن يكون ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `أصغر من اللازم: يفترض لـ ${issue.origin} أن يكون ${adj} ${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `نَص غير مقبول: يجب أن يبدأ بـ "${issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `نَص غير مقبول: يجب أن ينتهي بـ "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `نَص غير مقبول: يجب أن يتضمَّن "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `نَص غير مقبول: يجب أن يطابق النمط ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} غير مقبول`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `رقم غير مقبول: يجب أن يكون من مضاعفات ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `معرف${issue.keys.length > 1 ? "ات" : ""} غريب${issue.keys.length > 1 ? "ة" : ""}: ${util.joinValues(issue.keys, "، ")}`;
|
||||
case "invalid_key":
|
||||
return `معرف غير مقبول في ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "مدخل غير مقبول";
|
||||
case "invalid_element":
|
||||
return `مدخل غير مقبول في ${issue.origin}`;
|
||||
default:
|
||||
return "مدخل غير مقبول";
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
114
node_modules/zod/dist/esm/v4/locales/az.js
generated
vendored
114
node_modules/zod/dist/esm/v4/locales/az.js
generated
vendored
@@ -1,114 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "simvol", verb: "olmalıdır" },
|
||||
file: { unit: "bayt", verb: "olmalıdır" },
|
||||
array: { unit: "element", verb: "olmalıdır" },
|
||||
set: { unit: "element", verb: "olmalıdır" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "input",
|
||||
email: "email address",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO datetime",
|
||||
date: "ISO date",
|
||||
time: "ISO time",
|
||||
duration: "ISO duration",
|
||||
ipv4: "IPv4 address",
|
||||
ipv6: "IPv6 address",
|
||||
cidrv4: "IPv4 range",
|
||||
cidrv6: "IPv6 range",
|
||||
base64: "base64-encoded string",
|
||||
base64url: "base64url-encoded string",
|
||||
json_string: "JSON string",
|
||||
e164: "E.164 number",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Yanlış dəyər: gözlənilən ${issue.expected}, daxil olan ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Yanlış dəyər: gözlənilən ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Yanlış seçim: aşağıdakılardan biri olmalıdır: ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Çox böyük: gözlənilən ${issue.origin ?? "dəyər"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "element"}`;
|
||||
return `Çox böyük: gözlənilən ${issue.origin ?? "dəyər"} ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Çox kiçik: gözlənilən ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
return `Çox kiçik: gözlənilən ${issue.origin} ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Yanlış mətn: "${_issue.prefix}" ilə başlamalıdır`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Yanlış mətn: "${_issue.suffix}" ilə bitməlidir`;
|
||||
if (_issue.format === "includes")
|
||||
return `Yanlış mətn: "${_issue.includes}" daxil olmalıdır`;
|
||||
if (_issue.format === "regex")
|
||||
return `Yanlış mətn: ${_issue.pattern} şablonuna uyğun olmalıdır`;
|
||||
return `Yanlış ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Yanlış ədəd: ${issue.divisor} ilə bölünə bilən olmalıdır`;
|
||||
case "unrecognized_keys":
|
||||
return `Tanınmayan açar${issue.keys.length > 1 ? "lar" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} daxilində yanlış açar`;
|
||||
case "invalid_union":
|
||||
return "Yanlış dəyər";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} daxilində yanlış dəyər`;
|
||||
default:
|
||||
return `Yanlış dəyər`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
163
node_modules/zod/dist/esm/v4/locales/be.js
generated
vendored
163
node_modules/zod/dist/esm/v4/locales/be.js
generated
vendored
@@ -1,163 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
function getBelarusianPlural(count, one, few, many) {
|
||||
const absCount = Math.abs(count);
|
||||
const lastDigit = absCount % 10;
|
||||
const lastTwoDigits = absCount % 100;
|
||||
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
||||
return many;
|
||||
}
|
||||
if (lastDigit === 1) {
|
||||
return one;
|
||||
}
|
||||
if (lastDigit >= 2 && lastDigit <= 4) {
|
||||
return few;
|
||||
}
|
||||
return many;
|
||||
}
|
||||
const Sizable = {
|
||||
string: {
|
||||
unit: {
|
||||
one: "сімвал",
|
||||
few: "сімвалы",
|
||||
many: "сімвалаў",
|
||||
},
|
||||
verb: "мець",
|
||||
},
|
||||
array: {
|
||||
unit: {
|
||||
one: "элемент",
|
||||
few: "элементы",
|
||||
many: "элементаў",
|
||||
},
|
||||
verb: "мець",
|
||||
},
|
||||
set: {
|
||||
unit: {
|
||||
one: "элемент",
|
||||
few: "элементы",
|
||||
many: "элементаў",
|
||||
},
|
||||
verb: "мець",
|
||||
},
|
||||
file: {
|
||||
unit: {
|
||||
one: "байт",
|
||||
few: "байты",
|
||||
many: "байтаў",
|
||||
},
|
||||
verb: "мець",
|
||||
},
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "лік";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "масіў";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "увод",
|
||||
email: "email адрас",
|
||||
url: "URL",
|
||||
emoji: "эмодзі",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO дата і час",
|
||||
date: "ISO дата",
|
||||
time: "ISO час",
|
||||
duration: "ISO працягласць",
|
||||
ipv4: "IPv4 адрас",
|
||||
ipv6: "IPv6 адрас",
|
||||
cidrv4: "IPv4 дыяпазон",
|
||||
cidrv6: "IPv6 дыяпазон",
|
||||
base64: "радок у фармаце base64",
|
||||
base64url: "радок у фармаце base64url",
|
||||
json_string: "JSON радок",
|
||||
e164: "нумар E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "увод",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Няправільны ўвод: чакаўся ${issue.expected}, атрымана ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Няправільны ўвод: чакалася ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Няправільны варыянт: чакаўся адзін з ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
const maxValue = Number(issue.maximum);
|
||||
const unit = getBelarusianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
|
||||
return `Занадта вялікі: чакалася, што ${issue.origin ?? "значэнне"} павінна ${sizing.verb} ${adj}${issue.maximum.toString()} ${unit}`;
|
||||
}
|
||||
return `Занадта вялікі: чакалася, што ${issue.origin ?? "значэнне"} павінна быць ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
const minValue = Number(issue.minimum);
|
||||
const unit = getBelarusianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
|
||||
return `Занадта малы: чакалася, што ${issue.origin} павінна ${sizing.verb} ${adj}${issue.minimum.toString()} ${unit}`;
|
||||
}
|
||||
return `Занадта малы: чакалася, што ${issue.origin} павінна быць ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Няправільны радок: павінен пачынацца з "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Няправільны радок: павінен заканчвацца на "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Няправільны радок: павінен змяшчаць "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Няправільны радок: павінен адпавядаць шаблону ${_issue.pattern}`;
|
||||
return `Няправільны ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Няправільны лік: павінен быць кратным ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Нераспазнаны ${issue.keys.length > 1 ? "ключы" : "ключ"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Няправільны ключ у ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Няправільны ўвод";
|
||||
case "invalid_element":
|
||||
return `Няправільнае значэнне ў ${issue.origin}`;
|
||||
default:
|
||||
return `Няправільны ўвод`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
117
node_modules/zod/dist/esm/v4/locales/ca.js
generated
vendored
117
node_modules/zod/dist/esm/v4/locales/ca.js
generated
vendored
@@ -1,117 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "caràcters", verb: "contenir" },
|
||||
file: { unit: "bytes", verb: "contenir" },
|
||||
array: { unit: "elements", verb: "contenir" },
|
||||
set: { unit: "elements", verb: "contenir" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "entrada",
|
||||
email: "adreça electrònica",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "data i hora ISO",
|
||||
date: "data ISO",
|
||||
time: "hora ISO",
|
||||
duration: "durada ISO",
|
||||
ipv4: "adreça IPv4",
|
||||
ipv6: "adreça IPv6",
|
||||
cidrv4: "rang IPv4",
|
||||
cidrv6: "rang IPv6",
|
||||
base64: "cadena codificada en base64",
|
||||
base64url: "cadena codificada en base64url",
|
||||
json_string: "cadena JSON",
|
||||
e164: "número E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "entrada",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Tipus invàlid: s'esperava ${issue.expected}, s'ha rebut ${parsedType(issue.input)}`;
|
||||
// return `Tipus invàlid: s'esperava ${issue.expected}, s'ha rebut ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Valor invàlid: s'esperava ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Opció invàlida: s'esperava una de ${util.joinValues(issue.values, " o ")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "com a màxim" : "menys de";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Massa gran: s'esperava que ${issue.origin ?? "el valor"} contingués ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
|
||||
return `Massa gran: s'esperava que ${issue.origin ?? "el valor"} fos ${adj} ${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? "com a mínim" : "més de";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Massa petit: s'esperava que ${issue.origin} contingués ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Massa petit: s'esperava que ${issue.origin} fos ${adj} ${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `Format invàlid: ha de començar amb "${_issue.prefix}"`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `Format invàlid: ha d'acabar amb "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Format invàlid: ha d'incloure "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Format invàlid: ha de coincidir amb el patró ${_issue.pattern}`;
|
||||
return `Format invàlid per a ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Número invàlid: ha de ser múltiple de ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Clau${issue.keys.length > 1 ? "s" : ""} no reconeguda${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Clau invàlida a ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Entrada invàlida"; // Could also be "Tipus d'unió invàlid" but "Entrada invàlida" is more general
|
||||
case "invalid_element":
|
||||
return `Element invàlid a ${issue.origin}`;
|
||||
default:
|
||||
return `Entrada invàlida`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
134
node_modules/zod/dist/esm/v4/locales/cs.js
generated
vendored
134
node_modules/zod/dist/esm/v4/locales/cs.js
generated
vendored
@@ -1,134 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "znaků", verb: "mít" },
|
||||
file: { unit: "bajtů", verb: "mít" },
|
||||
array: { unit: "prvků", verb: "mít" },
|
||||
set: { unit: "prvků", verb: "mít" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "číslo";
|
||||
}
|
||||
case "string": {
|
||||
return "řetězec";
|
||||
}
|
||||
case "boolean": {
|
||||
return "boolean";
|
||||
}
|
||||
case "bigint": {
|
||||
return "bigint";
|
||||
}
|
||||
case "function": {
|
||||
return "funkce";
|
||||
}
|
||||
case "symbol": {
|
||||
return "symbol";
|
||||
}
|
||||
case "undefined": {
|
||||
return "undefined";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "pole";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "regulární výraz",
|
||||
email: "e-mailová adresa",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "datum a čas ve formátu ISO",
|
||||
date: "datum ve formátu ISO",
|
||||
time: "čas ve formátu ISO",
|
||||
duration: "doba trvání ISO",
|
||||
ipv4: "IPv4 adresa",
|
||||
ipv6: "IPv6 adresa",
|
||||
cidrv4: "rozsah IPv4",
|
||||
cidrv6: "rozsah IPv6",
|
||||
base64: "řetězec zakódovaný ve formátu base64",
|
||||
base64url: "řetězec zakódovaný ve formátu base64url",
|
||||
json_string: "řetězec ve formátu JSON",
|
||||
e164: "číslo E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "vstup",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Neplatný vstup: očekáváno ${issue.expected}, obdrženo ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Neplatný vstup: očekáváno ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Neplatná možnost: očekávána jedna z hodnot ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Hodnota je příliš velká: ${issue.origin ?? "hodnota"} musí mít ${adj}${issue.maximum.toString()} ${sizing.unit ?? "prvků"}`;
|
||||
}
|
||||
return `Hodnota je příliš velká: ${issue.origin ?? "hodnota"} musí být ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Hodnota je příliš malá: ${issue.origin ?? "hodnota"} musí mít ${adj}${issue.minimum.toString()} ${sizing.unit ?? "prvků"}`;
|
||||
}
|
||||
return `Hodnota je příliš malá: ${issue.origin ?? "hodnota"} musí být ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Neplatný řetězec: musí začínat na "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Neplatný řetězec: musí končit na "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Neplatný řetězec: musí obsahovat "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Neplatný řetězec: musí odpovídat vzoru ${_issue.pattern}`;
|
||||
return `Neplatný formát ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Neplatné číslo: musí být násobkem ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Neznámé klíče: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Neplatný klíč v ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Neplatný vstup";
|
||||
case "invalid_element":
|
||||
return `Neplatná hodnota v ${issue.origin}`;
|
||||
default:
|
||||
return `Neplatný vstup`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
115
node_modules/zod/dist/esm/v4/locales/de.js
generated
vendored
115
node_modules/zod/dist/esm/v4/locales/de.js
generated
vendored
@@ -1,115 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "Zeichen", verb: "zu haben" },
|
||||
file: { unit: "Bytes", verb: "zu haben" },
|
||||
array: { unit: "Elemente", verb: "zu haben" },
|
||||
set: { unit: "Elemente", verb: "zu haben" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "Zahl";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "Array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "Eingabe",
|
||||
email: "E-Mail-Adresse",
|
||||
url: "URL",
|
||||
emoji: "Emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO-Datum und -Uhrzeit",
|
||||
date: "ISO-Datum",
|
||||
time: "ISO-Uhrzeit",
|
||||
duration: "ISO-Dauer",
|
||||
ipv4: "IPv4-Adresse",
|
||||
ipv6: "IPv6-Adresse",
|
||||
cidrv4: "IPv4-Bereich",
|
||||
cidrv6: "IPv6-Bereich",
|
||||
base64: "Base64-codierter String",
|
||||
base64url: "Base64-URL-codierter String",
|
||||
json_string: "JSON-String",
|
||||
e164: "E.164-Nummer",
|
||||
jwt: "JWT",
|
||||
template_literal: "Eingabe",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Ungültige Eingabe: erwartet ${issue.expected}, erhalten ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Ungültige Eingabe: erwartet ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Ungültige Option: erwartet eine von ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Zu groß: erwartet, dass ${issue.origin ?? "Wert"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "Elemente"} hat`;
|
||||
return `Zu groß: erwartet, dass ${issue.origin ?? "Wert"} ${adj}${issue.maximum.toString()} ist`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Zu klein: erwartet, dass ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} hat`;
|
||||
}
|
||||
return `Zu klein: erwartet, dass ${issue.origin} ${adj}${issue.minimum.toString()} ist`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Ungültiger String: muss mit "${_issue.prefix}" beginnen`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Ungültiger String: muss mit "${_issue.suffix}" enden`;
|
||||
if (_issue.format === "includes")
|
||||
return `Ungültiger String: muss "${_issue.includes}" enthalten`;
|
||||
if (_issue.format === "regex")
|
||||
return `Ungültiger String: muss dem Muster ${_issue.pattern} entsprechen`;
|
||||
return `Ungültig: ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Ungültige Zahl: muss ein Vielfaches von ${issue.divisor} sein`;
|
||||
case "unrecognized_keys":
|
||||
return `${issue.keys.length > 1 ? "Unbekannte Schlüssel" : "Unbekannter Schlüssel"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Ungültiger Schlüssel in ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Ungültige Eingabe";
|
||||
case "invalid_element":
|
||||
return `Ungültiger Wert in ${issue.origin}`;
|
||||
default:
|
||||
return `Ungültige Eingabe`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
117
node_modules/zod/dist/esm/v4/locales/en.js
generated
vendored
117
node_modules/zod/dist/esm/v4/locales/en.js
generated
vendored
@@ -1,117 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "characters", verb: "to have" },
|
||||
file: { unit: "bytes", verb: "to have" },
|
||||
array: { unit: "items", verb: "to have" },
|
||||
set: { unit: "items", verb: "to have" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "input",
|
||||
email: "email address",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO datetime",
|
||||
date: "ISO date",
|
||||
time: "ISO time",
|
||||
duration: "ISO duration",
|
||||
ipv4: "IPv4 address",
|
||||
ipv6: "IPv6 address",
|
||||
cidrv4: "IPv4 range",
|
||||
cidrv6: "IPv6 range",
|
||||
base64: "base64-encoded string",
|
||||
base64url: "base64url-encoded string",
|
||||
json_string: "JSON string",
|
||||
e164: "E.164 number",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Invalid input: expected ${issue.expected}, received ${parsedType(issue.input)}`;
|
||||
// return `Invalid input: expected ${issue.expected}, received ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Invalid option: expected one of ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Too big: expected ${issue.origin ?? "value"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
|
||||
return `Too big: expected ${issue.origin ?? "value"} to be ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `Invalid string: must start with "${_issue.prefix}"`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `Invalid string: must end with "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Invalid string: must include "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Invalid string: must match pattern ${_issue.pattern}`;
|
||||
return `Invalid ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Invalid number: must be a multiple of ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Unrecognized key${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Invalid key in ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Invalid input";
|
||||
case "invalid_element":
|
||||
return `Invalid value in ${issue.origin}`;
|
||||
default:
|
||||
return `Invalid input`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
116
node_modules/zod/dist/esm/v4/locales/es.js
generated
vendored
116
node_modules/zod/dist/esm/v4/locales/es.js
generated
vendored
@@ -1,116 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "caracteres", verb: "tener" },
|
||||
file: { unit: "bytes", verb: "tener" },
|
||||
array: { unit: "elementos", verb: "tener" },
|
||||
set: { unit: "elementos", verb: "tener" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "número";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "arreglo";
|
||||
}
|
||||
if (data === null) {
|
||||
return "nulo";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "entrada",
|
||||
email: "dirección de correo electrónico",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "fecha y hora ISO",
|
||||
date: "fecha ISO",
|
||||
time: "hora ISO",
|
||||
duration: "duración ISO",
|
||||
ipv4: "dirección IPv4",
|
||||
ipv6: "dirección IPv6",
|
||||
cidrv4: "rango IPv4",
|
||||
cidrv6: "rango IPv6",
|
||||
base64: "cadena codificada en base64",
|
||||
base64url: "URL codificada en base64",
|
||||
json_string: "cadena JSON",
|
||||
e164: "número E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "entrada",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Entrada inválida: se esperaba ${issue.expected}, recibido ${parsedType(issue.input)}`;
|
||||
// return `Entrada inválida: se esperaba ${issue.expected}, recibido ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Entrada inválida: se esperaba ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Opción inválida: se esperaba una de ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Demasiado grande: se esperaba que ${issue.origin ?? "valor"} tuviera ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementos"}`;
|
||||
return `Demasiado grande: se esperaba que ${issue.origin ?? "valor"} fuera ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Demasiado pequeño: se esperaba que ${issue.origin} tuviera ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Demasiado pequeño: se esperaba que ${issue.origin} fuera ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Cadena inválida: debe comenzar con "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Cadena inválida: debe terminar en "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Cadena inválida: debe incluir "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Cadena inválida: debe coincidir con el patrón ${_issue.pattern}`;
|
||||
return `Inválido ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Número inválido: debe ser múltiplo de ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Llave${issue.keys.length > 1 ? "s" : ""} desconocida${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Llave inválida en ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Entrada inválida";
|
||||
case "invalid_element":
|
||||
return `Valor inválido en ${issue.origin}`;
|
||||
default:
|
||||
return `Entrada inválida`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
121
node_modules/zod/dist/esm/v4/locales/fa.js
generated
vendored
121
node_modules/zod/dist/esm/v4/locales/fa.js
generated
vendored
@@ -1,121 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "کاراکتر", verb: "داشته باشد" },
|
||||
file: { unit: "بایت", verb: "داشته باشد" },
|
||||
array: { unit: "آیتم", verb: "داشته باشد" },
|
||||
set: { unit: "آیتم", verb: "داشته باشد" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "عدد";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "آرایه";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "ورودی",
|
||||
email: "آدرس ایمیل",
|
||||
url: "URL",
|
||||
emoji: "ایموجی",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "تاریخ و زمان ایزو",
|
||||
date: "تاریخ ایزو",
|
||||
time: "زمان ایزو",
|
||||
duration: "مدت زمان ایزو",
|
||||
ipv4: "IPv4 آدرس",
|
||||
ipv6: "IPv6 آدرس",
|
||||
cidrv4: "IPv4 دامنه",
|
||||
cidrv6: "IPv6 دامنه",
|
||||
base64: "base64-encoded رشته",
|
||||
base64url: "base64url-encoded رشته",
|
||||
json_string: "JSON رشته",
|
||||
e164: "E.164 عدد",
|
||||
jwt: "JWT",
|
||||
template_literal: "ورودی",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `ورودی نامعتبر: میبایست ${issue.expected} میبود، ${parsedType(issue.input)} دریافت شد`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1) {
|
||||
return `ورودی نامعتبر: میبایست ${util.stringifyPrimitive(issue.values[0])} میبود`;
|
||||
}
|
||||
return `گزینه نامعتبر: میبایست یکی از ${util.joinValues(issue.values, "|")} میبود`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `خیلی بزرگ: ${issue.origin ?? "مقدار"} باید ${adj}${issue.maximum.toString()} ${sizing.unit ?? "عنصر"} باشد`;
|
||||
}
|
||||
return `خیلی بزرگ: ${issue.origin ?? "مقدار"} باید ${adj}${issue.maximum.toString()} باشد`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `خیلی کوچک: ${issue.origin} باید ${adj}${issue.minimum.toString()} ${sizing.unit} باشد`;
|
||||
}
|
||||
return `خیلی کوچک: ${issue.origin} باید ${adj}${issue.minimum.toString()} باشد`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `رشته نامعتبر: باید با "${_issue.prefix}" شروع شود`;
|
||||
}
|
||||
if (_issue.format === "ends_with") {
|
||||
return `رشته نامعتبر: باید با "${_issue.suffix}" تمام شود`;
|
||||
}
|
||||
if (_issue.format === "includes") {
|
||||
return `رشته نامعتبر: باید شامل "${_issue.includes}" باشد`;
|
||||
}
|
||||
if (_issue.format === "regex") {
|
||||
return `رشته نامعتبر: باید با الگوی ${_issue.pattern} مطابقت داشته باشد`;
|
||||
}
|
||||
return `${Nouns[_issue.format] ?? issue.format} نامعتبر`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `عدد نامعتبر: باید مضرب ${issue.divisor} باشد`;
|
||||
case "unrecognized_keys":
|
||||
return `کلید${issue.keys.length > 1 ? "های" : ""} ناشناس: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `کلید ناشناس در ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return `ورودی نامعتبر`;
|
||||
case "invalid_element":
|
||||
return `مقدار نامعتبر در ${issue.origin}`;
|
||||
default:
|
||||
return `ورودی نامعتبر`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
121
node_modules/zod/dist/esm/v4/locales/fi.js
generated
vendored
121
node_modules/zod/dist/esm/v4/locales/fi.js
generated
vendored
@@ -1,121 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "merkkiä", subject: "merkkijonon" },
|
||||
file: { unit: "tavua", subject: "tiedoston" },
|
||||
array: { unit: "alkiota", subject: "listan" },
|
||||
set: { unit: "alkiota", subject: "joukon" },
|
||||
number: { unit: "", subject: "luvun" },
|
||||
bigint: { unit: "", subject: "suuren kokonaisluvun" },
|
||||
int: { unit: "", subject: "kokonaisluvun" },
|
||||
date: { unit: "", subject: "päivämäärän" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "säännöllinen lauseke",
|
||||
email: "sähköpostiosoite",
|
||||
url: "URL-osoite",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO-aikaleima",
|
||||
date: "ISO-päivämäärä",
|
||||
time: "ISO-aika",
|
||||
duration: "ISO-kesto",
|
||||
ipv4: "IPv4-osoite",
|
||||
ipv6: "IPv6-osoite",
|
||||
cidrv4: "IPv4-alue",
|
||||
cidrv6: "IPv6-alue",
|
||||
base64: "base64-koodattu merkkijono",
|
||||
base64url: "base64url-koodattu merkkijono",
|
||||
json_string: "JSON-merkkijono",
|
||||
e164: "E.164-luku",
|
||||
jwt: "JWT",
|
||||
template_literal: "templaattimerkkijono",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Virheellinen tyyppi: odotettiin ${issue.expected}, oli ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Virheellinen syöte: täytyy olla ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Virheellinen valinta: täytyy olla yksi seuraavista: ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Liian suuri: ${sizing.subject} täytyy olla ${adj}${issue.maximum.toString()} ${sizing.unit}`.trim();
|
||||
}
|
||||
return `Liian suuri: arvon täytyy olla ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Liian pieni: ${sizing.subject} täytyy olla ${adj}${issue.minimum.toString()} ${sizing.unit}`.trim();
|
||||
}
|
||||
return `Liian pieni: arvon täytyy olla ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Virheellinen syöte: täytyy alkaa "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Virheellinen syöte: täytyy loppua "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Virheellinen syöte: täytyy sisältää "${_issue.includes}"`;
|
||||
if (_issue.format === "regex") {
|
||||
return `Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${_issue.pattern}`;
|
||||
}
|
||||
return `Virheellinen ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Virheellinen luku: täytyy olla luvun ${issue.divisor} monikerta`;
|
||||
case "unrecognized_keys":
|
||||
return `${issue.keys.length > 1 ? "Tuntemattomat avaimet" : "Tuntematon avain"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return "Virheellinen avain tietueessa";
|
||||
case "invalid_union":
|
||||
return "Virheellinen unioni";
|
||||
case "invalid_element":
|
||||
return "Virheellinen arvo joukossa";
|
||||
default:
|
||||
return `Virheellinen syöte`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
115
node_modules/zod/dist/esm/v4/locales/fr.js
generated
vendored
115
node_modules/zod/dist/esm/v4/locales/fr.js
generated
vendored
@@ -1,115 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "caractères", verb: "avoir" },
|
||||
file: { unit: "octets", verb: "avoir" },
|
||||
array: { unit: "éléments", verb: "avoir" },
|
||||
set: { unit: "éléments", verb: "avoir" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "nombre";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "tableau";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "entrée",
|
||||
email: "adresse e-mail",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "date et heure ISO",
|
||||
date: "date ISO",
|
||||
time: "heure ISO",
|
||||
duration: "durée ISO",
|
||||
ipv4: "adresse IPv4",
|
||||
ipv6: "adresse IPv6",
|
||||
cidrv4: "plage IPv4",
|
||||
cidrv6: "plage IPv6",
|
||||
base64: "chaîne encodée en base64",
|
||||
base64url: "chaîne encodée en base64url",
|
||||
json_string: "chaîne JSON",
|
||||
e164: "numéro E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "entrée",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Entrée invalide : ${issue.expected} attendu, ${parsedType(issue.input)} reçu`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Entrée invalide : ${util.stringifyPrimitive(issue.values[0])} attendu`;
|
||||
return `Option invalide : une valeur parmi ${util.joinValues(issue.values, "|")} attendue`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Trop grand : ${issue.origin ?? "valeur"} doit ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "élément(s)"}`;
|
||||
return `Trop grand : ${issue.origin ?? "valeur"} doit être ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Trop petit : ${issue.origin} doit ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Trop petit : ${issue.origin} doit être ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Chaîne invalide : doit commencer par "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Chaîne invalide : doit se terminer par "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Chaîne invalide : doit inclure "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Chaîne invalide : doit correspondre au modèle ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} invalide`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Nombre invalide : doit être un multiple de ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Clé${issue.keys.length > 1 ? "s" : ""} non reconnue${issue.keys.length > 1 ? "s" : ""} : ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Clé invalide dans ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Entrée invalide";
|
||||
case "invalid_element":
|
||||
return `Valeur invalide dans ${issue.origin}`;
|
||||
default:
|
||||
return `Entrée invalide`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
116
node_modules/zod/dist/esm/v4/locales/frCA.js
generated
vendored
116
node_modules/zod/dist/esm/v4/locales/frCA.js
generated
vendored
@@ -1,116 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "caractères", verb: "avoir" },
|
||||
file: { unit: "octets", verb: "avoir" },
|
||||
array: { unit: "éléments", verb: "avoir" },
|
||||
set: { unit: "éléments", verb: "avoir" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "entrée",
|
||||
email: "adresse courriel",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "date-heure ISO",
|
||||
date: "date ISO",
|
||||
time: "heure ISO",
|
||||
duration: "durée ISO",
|
||||
ipv4: "adresse IPv4",
|
||||
ipv6: "adresse IPv6",
|
||||
cidrv4: "plage IPv4",
|
||||
cidrv6: "plage IPv6",
|
||||
base64: "chaîne encodée en base64",
|
||||
base64url: "chaîne encodée en base64url",
|
||||
json_string: "chaîne JSON",
|
||||
e164: "numéro E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "entrée",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Entrée invalide : attendu ${issue.expected}, reçu ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Entrée invalide : attendu ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Option invalide : attendu l'une des valeurs suivantes ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "≤" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Trop grand : attendu que ${issue.origin ?? "la valeur"} ait ${adj}${issue.maximum.toString()} ${sizing.unit}`;
|
||||
return `Trop grand : attendu que ${issue.origin ?? "la valeur"} soit ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? "≥" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Trop petit : attendu que ${issue.origin} ait ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Trop petit : attendu que ${issue.origin} soit ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `Chaîne invalide : doit commencer par "${_issue.prefix}"`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `Chaîne invalide : doit se terminer par "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Chaîne invalide : doit inclure "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Chaîne invalide : doit correspondre au motif ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} invalide`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Nombre invalide : doit être un multiple de ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Clé${issue.keys.length > 1 ? "s" : ""} non reconnue${issue.keys.length > 1 ? "s" : ""} : ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Clé invalide dans ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Entrée invalide";
|
||||
case "invalid_element":
|
||||
return `Valeur invalide dans ${issue.origin}`;
|
||||
default:
|
||||
return `Entrée invalide`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
116
node_modules/zod/dist/esm/v4/locales/he.js
generated
vendored
116
node_modules/zod/dist/esm/v4/locales/he.js
generated
vendored
@@ -1,116 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "אותיות", verb: "לכלול" },
|
||||
file: { unit: "בייטים", verb: "לכלול" },
|
||||
array: { unit: "פריטים", verb: "לכלול" },
|
||||
set: { unit: "פריטים", verb: "לכלול" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "קלט",
|
||||
email: "כתובת אימייל",
|
||||
url: "כתובת רשת",
|
||||
emoji: "אימוג'י",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "תאריך וזמן ISO",
|
||||
date: "תאריך ISO",
|
||||
time: "זמן ISO",
|
||||
duration: "משך זמן ISO",
|
||||
ipv4: "כתובת IPv4",
|
||||
ipv6: "כתובת IPv6",
|
||||
cidrv4: "טווח IPv4",
|
||||
cidrv6: "טווח IPv6",
|
||||
base64: "מחרוזת בבסיס 64",
|
||||
base64url: "מחרוזת בבסיס 64 לכתובות רשת",
|
||||
json_string: "מחרוזת JSON",
|
||||
e164: "מספר E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "קלט",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `קלט לא תקין: צריך ${issue.expected}, התקבל ${parsedType(issue.input)}`;
|
||||
// return `Invalid input: expected ${issue.expected}, received ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `קלט לא תקין: צריך ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `קלט לא תקין: צריך אחת מהאפשרויות ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `גדול מדי: ${issue.origin ?? "value"} צריך להיות ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
|
||||
return `גדול מדי: ${issue.origin ?? "value"} צריך להיות ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `קטן מדי: ${issue.origin} צריך להיות ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `קטן מדי: ${issue.origin} צריך להיות ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `מחרוזת לא תקינה: חייבת להתחיל ב"${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `מחרוזת לא תקינה: חייבת להסתיים ב "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `מחרוזת לא תקינה: חייבת לכלול "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `מחרוזת לא תקינה: חייבת להתאים לתבנית ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} לא תקין`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `מספר לא תקין: חייב להיות מכפלה של ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `מפתח${issue.keys.length > 1 ? "ות" : ""} לא מזוה${issue.keys.length > 1 ? "ים" : "ה"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `מפתח לא תקין ב${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "קלט לא תקין";
|
||||
case "invalid_element":
|
||||
return `ערך לא תקין ב${issue.origin}`;
|
||||
default:
|
||||
return `קלט לא תקין`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
116
node_modules/zod/dist/esm/v4/locales/hu.js
generated
vendored
116
node_modules/zod/dist/esm/v4/locales/hu.js
generated
vendored
@@ -1,116 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "karakter", verb: "legyen" },
|
||||
file: { unit: "byte", verb: "legyen" },
|
||||
array: { unit: "elem", verb: "legyen" },
|
||||
set: { unit: "elem", verb: "legyen" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "szám";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "tömb";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "bemenet",
|
||||
email: "email cím",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO időbélyeg",
|
||||
date: "ISO dátum",
|
||||
time: "ISO idő",
|
||||
duration: "ISO időintervallum",
|
||||
ipv4: "IPv4 cím",
|
||||
ipv6: "IPv6 cím",
|
||||
cidrv4: "IPv4 tartomány",
|
||||
cidrv6: "IPv6 tartomány",
|
||||
base64: "base64-kódolt string",
|
||||
base64url: "base64url-kódolt string",
|
||||
json_string: "JSON string",
|
||||
e164: "E.164 szám",
|
||||
jwt: "JWT",
|
||||
template_literal: "bemenet",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Érvénytelen bemenet: a várt érték ${issue.expected}, a kapott érték ${parsedType(issue.input)}`;
|
||||
// return `Invalid input: expected ${issue.expected}, received ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Érvénytelen bemenet: a várt érték ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Érvénytelen opció: valamelyik érték várt ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Túl nagy: ${issue.origin ?? "érték"} mérete túl nagy ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elem"}`;
|
||||
return `Túl nagy: a bemeneti érték ${issue.origin ?? "érték"} túl nagy: ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Túl kicsi: a bemeneti érték ${issue.origin} mérete túl kicsi ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Túl kicsi: a bemeneti érték ${issue.origin} túl kicsi ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Érvénytelen string: "${_issue.prefix}" értékkel kell kezdődnie`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Érvénytelen string: "${_issue.suffix}" értékkel kell végződnie`;
|
||||
if (_issue.format === "includes")
|
||||
return `Érvénytelen string: "${_issue.includes}" értéket kell tartalmaznia`;
|
||||
if (_issue.format === "regex")
|
||||
return `Érvénytelen string: ${_issue.pattern} mintának kell megfelelnie`;
|
||||
return `Érvénytelen ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Érvénytelen szám: ${issue.divisor} többszörösének kell lennie`;
|
||||
case "unrecognized_keys":
|
||||
return `Ismeretlen kulcs${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Érvénytelen kulcs ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Érvénytelen bemenet";
|
||||
case "invalid_element":
|
||||
return `Érvénytelen érték: ${issue.origin}`;
|
||||
default:
|
||||
return `Érvénytelen bemenet`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
115
node_modules/zod/dist/esm/v4/locales/id.js
generated
vendored
115
node_modules/zod/dist/esm/v4/locales/id.js
generated
vendored
@@ -1,115 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "karakter", verb: "memiliki" },
|
||||
file: { unit: "byte", verb: "memiliki" },
|
||||
array: { unit: "item", verb: "memiliki" },
|
||||
set: { unit: "item", verb: "memiliki" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "input",
|
||||
email: "alamat email",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "tanggal dan waktu format ISO",
|
||||
date: "tanggal format ISO",
|
||||
time: "jam format ISO",
|
||||
duration: "durasi format ISO",
|
||||
ipv4: "alamat IPv4",
|
||||
ipv6: "alamat IPv6",
|
||||
cidrv4: "rentang alamat IPv4",
|
||||
cidrv6: "rentang alamat IPv6",
|
||||
base64: "string dengan enkode base64",
|
||||
base64url: "string dengan enkode base64url",
|
||||
json_string: "string JSON",
|
||||
e164: "angka E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Input tidak valid: diharapkan ${issue.expected}, diterima ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Input tidak valid: diharapkan ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Pilihan tidak valid: diharapkan salah satu dari ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Terlalu besar: diharapkan ${issue.origin ?? "value"} memiliki ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemen"}`;
|
||||
return `Terlalu besar: diharapkan ${issue.origin ?? "value"} menjadi ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Terlalu kecil: diharapkan ${issue.origin} memiliki ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Terlalu kecil: diharapkan ${issue.origin} menjadi ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `String tidak valid: harus dimulai dengan "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `String tidak valid: harus berakhir dengan "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `String tidak valid: harus menyertakan "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `String tidak valid: harus sesuai pola ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} tidak valid`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Angka tidak valid: harus kelipatan dari ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Kunci tidak dikenali ${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Kunci tidak valid di ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Input tidak valid";
|
||||
case "invalid_element":
|
||||
return `Nilai tidak valid di ${issue.origin}`;
|
||||
default:
|
||||
return `Input tidak valid`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
116
node_modules/zod/dist/esm/v4/locales/it.js
generated
vendored
116
node_modules/zod/dist/esm/v4/locales/it.js
generated
vendored
@@ -1,116 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "caratteri", verb: "avere" },
|
||||
file: { unit: "byte", verb: "avere" },
|
||||
array: { unit: "elementi", verb: "avere" },
|
||||
set: { unit: "elementi", verb: "avere" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "numero";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "vettore";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "input",
|
||||
email: "indirizzo email",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "data e ora ISO",
|
||||
date: "data ISO",
|
||||
time: "ora ISO",
|
||||
duration: "durata ISO",
|
||||
ipv4: "indirizzo IPv4",
|
||||
ipv6: "indirizzo IPv6",
|
||||
cidrv4: "intervallo IPv4",
|
||||
cidrv6: "intervallo IPv6",
|
||||
base64: "stringa codificata in base64",
|
||||
base64url: "URL codificata in base64",
|
||||
json_string: "stringa JSON",
|
||||
e164: "numero E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Input non valido: atteso ${issue.expected}, ricevuto ${parsedType(issue.input)}`;
|
||||
// return `Input non valido: atteso ${issue.expected}, ricevuto ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Input non valido: atteso ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Opzione non valida: atteso uno tra ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Troppo grande: ${issue.origin ?? "valore"} deve avere ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementi"}`;
|
||||
return `Troppo grande: ${issue.origin ?? "valore"} deve essere ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Troppo piccolo: ${issue.origin} deve avere ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Troppo piccolo: ${issue.origin} deve essere ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Stringa non valida: deve iniziare con "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Stringa non valida: deve terminare con "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Stringa non valida: deve includere "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Stringa non valida: deve corrispondere al pattern ${_issue.pattern}`;
|
||||
return `Invalid ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Numero non valido: deve essere un multiplo di ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Chiav${issue.keys.length > 1 ? "i" : "e"} non riconosciut${issue.keys.length > 1 ? "e" : "a"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Chiave non valida in ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Input non valido";
|
||||
case "invalid_element":
|
||||
return `Valore non valido in ${issue.origin}`;
|
||||
default:
|
||||
return `Input non valido`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
114
node_modules/zod/dist/esm/v4/locales/ja.js
generated
vendored
114
node_modules/zod/dist/esm/v4/locales/ja.js
generated
vendored
@@ -1,114 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "文字", verb: "である" },
|
||||
file: { unit: "バイト", verb: "である" },
|
||||
array: { unit: "要素", verb: "である" },
|
||||
set: { unit: "要素", verb: "である" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "数値";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "配列";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "入力値",
|
||||
email: "メールアドレス",
|
||||
url: "URL",
|
||||
emoji: "絵文字",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO日時",
|
||||
date: "ISO日付",
|
||||
time: "ISO時刻",
|
||||
duration: "ISO期間",
|
||||
ipv4: "IPv4アドレス",
|
||||
ipv6: "IPv6アドレス",
|
||||
cidrv4: "IPv4範囲",
|
||||
cidrv6: "IPv6範囲",
|
||||
base64: "base64エンコード文字列",
|
||||
base64url: "base64urlエンコード文字列",
|
||||
json_string: "JSON文字列",
|
||||
e164: "E.164番号",
|
||||
jwt: "JWT",
|
||||
template_literal: "入力値",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `無効な入力: ${issue.expected}が期待されましたが、${parsedType(issue.input)}が入力されました`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `無効な入力: ${util.stringifyPrimitive(issue.values[0])}が期待されました`;
|
||||
return `無効な選択: ${util.joinValues(issue.values, "、")}のいずれかである必要があります`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `大きすぎる値: ${issue.origin ?? "値"}は${issue.maximum.toString()}${sizing.unit ?? "要素"}${adj}である必要があります`;
|
||||
return `大きすぎる値: ${issue.origin ?? "値"}は${issue.maximum.toString()}${adj}である必要があります`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `小さすぎる値: ${issue.origin}は${issue.minimum.toString()}${sizing.unit}${adj}である必要があります`;
|
||||
return `小さすぎる値: ${issue.origin}は${issue.minimum.toString()}${adj}である必要があります`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `無効な文字列: "${_issue.prefix}"で始まる必要があります`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `無効な文字列: "${_issue.suffix}"で終わる必要があります`;
|
||||
if (_issue.format === "includes")
|
||||
return `無効な文字列: "${_issue.includes}"を含む必要があります`;
|
||||
if (_issue.format === "regex")
|
||||
return `無効な文字列: パターン${_issue.pattern}に一致する必要があります`;
|
||||
return `無効な${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `無効な数値: ${issue.divisor}の倍数である必要があります`;
|
||||
case "unrecognized_keys":
|
||||
return `認識されていないキー${issue.keys.length > 1 ? "群" : ""}: ${util.joinValues(issue.keys, "、")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin}内の無効なキー`;
|
||||
case "invalid_union":
|
||||
return "無効な入力";
|
||||
case "invalid_element":
|
||||
return `${issue.origin}内の無効な値`;
|
||||
default:
|
||||
return `無効な入力`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
120
node_modules/zod/dist/esm/v4/locales/ko.js
generated
vendored
120
node_modules/zod/dist/esm/v4/locales/ko.js
generated
vendored
@@ -1,120 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "문자", verb: "to have" },
|
||||
file: { unit: "바이트", verb: "to have" },
|
||||
array: { unit: "개", verb: "to have" },
|
||||
set: { unit: "개", verb: "to have" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "입력",
|
||||
email: "이메일 주소",
|
||||
url: "URL",
|
||||
emoji: "이모지",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO 날짜시간",
|
||||
date: "ISO 날짜",
|
||||
time: "ISO 시간",
|
||||
duration: "ISO 기간",
|
||||
ipv4: "IPv4 주소",
|
||||
ipv6: "IPv6 주소",
|
||||
cidrv4: "IPv4 범위",
|
||||
cidrv6: "IPv6 범위",
|
||||
base64: "base64 인코딩 문자열",
|
||||
base64url: "base64url 인코딩 문자열",
|
||||
json_string: "JSON 문자열",
|
||||
e164: "E.164 번호",
|
||||
jwt: "JWT",
|
||||
template_literal: "입력",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `잘못된 입력: 예상 타입은 ${issue.expected}, 받은 타입은 ${parsedType(issue.input)}입니다`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `잘못된 입력: 값은 ${util.stringifyPrimitive(issue.values[0])} 이어야 합니다`;
|
||||
return `잘못된 옵션: ${util.joinValues(issue.values, "또는 ")} 중 하나여야 합니다`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "이하" : "미만";
|
||||
const suffix = adj === "미만" ? "이어야 합니다" : "여야 합니다";
|
||||
const sizing = getSizing(issue.origin);
|
||||
const unit = sizing?.unit ?? "요소";
|
||||
if (sizing)
|
||||
return `${issue.origin ?? "값"}이 너무 큽니다: ${issue.maximum.toString()}${unit} ${adj}${suffix}`;
|
||||
return `${issue.origin ?? "값"}이 너무 큽니다: ${issue.maximum.toString()} ${adj}${suffix}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? "이상" : "초과";
|
||||
const suffix = adj === "이상" ? "이어야 합니다" : "여야 합니다";
|
||||
const sizing = getSizing(issue.origin);
|
||||
const unit = sizing?.unit ?? "요소";
|
||||
if (sizing) {
|
||||
return `${issue.origin ?? "값"}이 너무 작습니다: ${issue.minimum.toString()}${unit} ${adj}${suffix}`;
|
||||
}
|
||||
return `${issue.origin ?? "값"}이 너무 작습니다: ${issue.minimum.toString()} ${adj}${suffix}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `잘못된 문자열: "${_issue.prefix}"(으)로 시작해야 합니다`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `잘못된 문자열: "${_issue.suffix}"(으)로 끝나야 합니다`;
|
||||
if (_issue.format === "includes")
|
||||
return `잘못된 문자열: "${_issue.includes}"을(를) 포함해야 합니다`;
|
||||
if (_issue.format === "regex")
|
||||
return `잘못된 문자열: 정규식 ${_issue.pattern} 패턴과 일치해야 합니다`;
|
||||
return `잘못된 ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `잘못된 숫자: ${issue.divisor}의 배수여야 합니다`;
|
||||
case "unrecognized_keys":
|
||||
return `인식할 수 없는 키: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `잘못된 키: ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return `잘못된 입력`;
|
||||
case "invalid_element":
|
||||
return `잘못된 값: ${issue.origin}`;
|
||||
default:
|
||||
return `잘못된 입력`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
117
node_modules/zod/dist/esm/v4/locales/mk.js
generated
vendored
117
node_modules/zod/dist/esm/v4/locales/mk.js
generated
vendored
@@ -1,117 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "знаци", verb: "да имаат" },
|
||||
file: { unit: "бајти", verb: "да имаат" },
|
||||
array: { unit: "ставки", verb: "да имаат" },
|
||||
set: { unit: "ставки", verb: "да имаат" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "број";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "низа";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "внес",
|
||||
email: "адреса на е-пошта",
|
||||
url: "URL",
|
||||
emoji: "емоџи",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO датум и време",
|
||||
date: "ISO датум",
|
||||
time: "ISO време",
|
||||
duration: "ISO времетраење",
|
||||
ipv4: "IPv4 адреса",
|
||||
ipv6: "IPv6 адреса",
|
||||
cidrv4: "IPv4 опсег",
|
||||
cidrv6: "IPv6 опсег",
|
||||
base64: "base64-енкодирана низа",
|
||||
base64url: "base64url-енкодирана низа",
|
||||
json_string: "JSON низа",
|
||||
e164: "E.164 број",
|
||||
jwt: "JWT",
|
||||
template_literal: "внес",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Грешен внес: се очекува ${issue.expected}, примено ${parsedType(issue.input)}`;
|
||||
// return `Invalid input: expected ${issue.expected}, received ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Грешана опција: се очекува една ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Премногу голем: се очекува ${issue.origin ?? "вредноста"} да има ${adj}${issue.maximum.toString()} ${sizing.unit ?? "елементи"}`;
|
||||
return `Премногу голем: се очекува ${issue.origin ?? "вредноста"} да биде ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Премногу мал: се очекува ${issue.origin} да има ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Премногу мал: се очекува ${issue.origin} да биде ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `Неважечка низа: мора да започнува со "${_issue.prefix}"`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `Неважечка низа: мора да завршува со "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Неважечка низа: мора да вклучува "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Неважечка низа: мора да одгоара на патернот ${_issue.pattern}`;
|
||||
return `Invalid ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Грешен број: мора да биде делив со ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `${issue.keys.length > 1 ? "Непрепознаени клучеви" : "Непрепознаен клуч"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Грешен клуч во ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Грешен внес";
|
||||
case "invalid_element":
|
||||
return `Грешна вредност во ${issue.origin}`;
|
||||
default:
|
||||
return `Грешен внес`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
115
node_modules/zod/dist/esm/v4/locales/ms.js
generated
vendored
115
node_modules/zod/dist/esm/v4/locales/ms.js
generated
vendored
@@ -1,115 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "aksara", verb: "mempunyai" },
|
||||
file: { unit: "bait", verb: "mempunyai" },
|
||||
array: { unit: "elemen", verb: "mempunyai" },
|
||||
set: { unit: "elemen", verb: "mempunyai" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "nombor";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "input",
|
||||
email: "alamat e-mel",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "tarikh masa ISO",
|
||||
date: "tarikh ISO",
|
||||
time: "masa ISO",
|
||||
duration: "tempoh ISO",
|
||||
ipv4: "alamat IPv4",
|
||||
ipv6: "alamat IPv6",
|
||||
cidrv4: "julat IPv4",
|
||||
cidrv6: "julat IPv6",
|
||||
base64: "string dikodkan base64",
|
||||
base64url: "string dikodkan base64url",
|
||||
json_string: "string JSON",
|
||||
e164: "nombor E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Input tidak sah: dijangka ${issue.expected}, diterima ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Input tidak sah: dijangka ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Pilihan tidak sah: dijangka salah satu daripada ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Terlalu besar: dijangka ${issue.origin ?? "nilai"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemen"}`;
|
||||
return `Terlalu besar: dijangka ${issue.origin ?? "nilai"} adalah ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Terlalu kecil: dijangka ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Terlalu kecil: dijangka ${issue.origin} adalah ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `String tidak sah: mesti bermula dengan "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `String tidak sah: mesti berakhir dengan "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `String tidak sah: mesti mengandungi "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `String tidak sah: mesti sepadan dengan corak ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} tidak sah`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Nombor tidak sah: perlu gandaan ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Kunci tidak dikenali: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Kunci tidak sah dalam ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Input tidak sah";
|
||||
case "invalid_element":
|
||||
return `Nilai tidak sah dalam ${issue.origin}`;
|
||||
default:
|
||||
return `Input tidak sah`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
115
node_modules/zod/dist/esm/v4/locales/no.js
generated
vendored
115
node_modules/zod/dist/esm/v4/locales/no.js
generated
vendored
@@ -1,115 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "tegn", verb: "å ha" },
|
||||
file: { unit: "bytes", verb: "å ha" },
|
||||
array: { unit: "elementer", verb: "å inneholde" },
|
||||
set: { unit: "elementer", verb: "å inneholde" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "tall";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "liste";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "input",
|
||||
email: "e-postadresse",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO dato- og klokkeslett",
|
||||
date: "ISO-dato",
|
||||
time: "ISO-klokkeslett",
|
||||
duration: "ISO-varighet",
|
||||
ipv4: "IPv4-område",
|
||||
ipv6: "IPv6-område",
|
||||
cidrv4: "IPv4-spekter",
|
||||
cidrv6: "IPv6-spekter",
|
||||
base64: "base64-enkodet streng",
|
||||
base64url: "base64url-enkodet streng",
|
||||
json_string: "JSON-streng",
|
||||
e164: "E.164-nummer",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Ugyldig input: forventet ${issue.expected}, fikk ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Ugyldig verdi: forventet ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Ugyldig valg: forventet en av ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `For stor(t): forventet ${issue.origin ?? "value"} til å ha ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementer"}`;
|
||||
return `For stor(t): forventet ${issue.origin ?? "value"} til å ha ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `For lite(n): forventet ${issue.origin} til å ha ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `For lite(n): forventet ${issue.origin} til å ha ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Ugyldig streng: må starte med "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Ugyldig streng: må ende med "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Ugyldig streng: må inneholde "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Ugyldig streng: må matche mønsteret ${_issue.pattern}`;
|
||||
return `Ugyldig ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Ugyldig tall: må være et multiplum av ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `${issue.keys.length > 1 ? "Ukjente nøkler" : "Ukjent nøkkel"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Ugyldig nøkkel i ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Ugyldig input";
|
||||
case "invalid_element":
|
||||
return `Ugyldig verdi i ${issue.origin}`;
|
||||
default:
|
||||
return `Ugyldig input`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
116
node_modules/zod/dist/esm/v4/locales/ota.js
generated
vendored
116
node_modules/zod/dist/esm/v4/locales/ota.js
generated
vendored
@@ -1,116 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "harf", verb: "olmalıdır" },
|
||||
file: { unit: "bayt", verb: "olmalıdır" },
|
||||
array: { unit: "unsur", verb: "olmalıdır" },
|
||||
set: { unit: "unsur", verb: "olmalıdır" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "numara";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "saf";
|
||||
}
|
||||
if (data === null) {
|
||||
return "gayb";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "giren",
|
||||
email: "epostagâh",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO hengâmı",
|
||||
date: "ISO tarihi",
|
||||
time: "ISO zamanı",
|
||||
duration: "ISO müddeti",
|
||||
ipv4: "IPv4 nişânı",
|
||||
ipv6: "IPv6 nişânı",
|
||||
cidrv4: "IPv4 menzili",
|
||||
cidrv6: "IPv6 menzili",
|
||||
base64: "base64-şifreli metin",
|
||||
base64url: "base64url-şifreli metin",
|
||||
json_string: "JSON metin",
|
||||
e164: "E.164 sayısı",
|
||||
jwt: "JWT",
|
||||
template_literal: "giren",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Fâsit giren: umulan ${issue.expected}, alınan ${parsedType(issue.input)}`;
|
||||
// return `Fâsit giren: umulan ${issue.expected}, alınan ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Fâsit giren: umulan ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Fâsit tercih: mûteberler ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Fazla büyük: ${issue.origin ?? "value"}, ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"} sahip olmalıydı.`;
|
||||
return `Fazla büyük: ${issue.origin ?? "value"}, ${adj}${issue.maximum.toString()} olmalıydı.`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Fazla küçük: ${issue.origin}, ${adj}${issue.minimum.toString()} ${sizing.unit} sahip olmalıydı.`;
|
||||
}
|
||||
return `Fazla küçük: ${issue.origin}, ${adj}${issue.minimum.toString()} olmalıydı.`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Fâsit metin: "${_issue.prefix}" ile başlamalı.`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Fâsit metin: "${_issue.suffix}" ile bitmeli.`;
|
||||
if (_issue.format === "includes")
|
||||
return `Fâsit metin: "${_issue.includes}" ihtivâ etmeli.`;
|
||||
if (_issue.format === "regex")
|
||||
return `Fâsit metin: ${_issue.pattern} nakşına uymalı.`;
|
||||
return `Fâsit ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Fâsit sayı: ${issue.divisor} katı olmalıydı.`;
|
||||
case "unrecognized_keys":
|
||||
return `Tanınmayan anahtar ${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} için tanınmayan anahtar var.`;
|
||||
case "invalid_union":
|
||||
return "Giren tanınamadı.";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} için tanınmayan kıymet var.`;
|
||||
default:
|
||||
return `Kıymet tanınamadı.`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
116
node_modules/zod/dist/esm/v4/locales/pl.js
generated
vendored
116
node_modules/zod/dist/esm/v4/locales/pl.js
generated
vendored
@@ -1,116 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "znaków", verb: "mieć" },
|
||||
file: { unit: "bajtów", verb: "mieć" },
|
||||
array: { unit: "elementów", verb: "mieć" },
|
||||
set: { unit: "elementów", verb: "mieć" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "liczba";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "tablica";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "wyrażenie",
|
||||
email: "adres email",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "data i godzina w formacie ISO",
|
||||
date: "data w formacie ISO",
|
||||
time: "godzina w formacie ISO",
|
||||
duration: "czas trwania ISO",
|
||||
ipv4: "adres IPv4",
|
||||
ipv6: "adres IPv6",
|
||||
cidrv4: "zakres IPv4",
|
||||
cidrv6: "zakres IPv6",
|
||||
base64: "ciąg znaków zakodowany w formacie base64",
|
||||
base64url: "ciąg znaków zakodowany w formacie base64url",
|
||||
json_string: "ciąg znaków w formacie JSON",
|
||||
e164: "liczba E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "wejście",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Nieprawidłowe dane wejściowe: oczekiwano ${issue.expected}, otrzymano ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Nieprawidłowe dane wejściowe: oczekiwano ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Nieprawidłowa opcja: oczekiwano jednej z wartości ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Za duża wartość: oczekiwano, że ${issue.origin ?? "wartość"} będzie mieć ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementów"}`;
|
||||
}
|
||||
return `Zbyt duż(y/a/e): oczekiwano, że ${issue.origin ?? "wartość"} będzie wynosić ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Za mała wartość: oczekiwano, że ${issue.origin ?? "wartość"} będzie mieć ${adj}${issue.minimum.toString()} ${sizing.unit ?? "elementów"}`;
|
||||
}
|
||||
return `Zbyt mał(y/a/e): oczekiwano, że ${issue.origin ?? "wartość"} będzie wynosić ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Nieprawidłowy ciąg znaków: musi zaczynać się od "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Nieprawidłowy ciąg znaków: musi kończyć się na "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Nieprawidłowy ciąg znaków: musi zawierać "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${_issue.pattern}`;
|
||||
return `Nieprawidłow(y/a/e) ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Nieprawidłowa liczba: musi być wielokrotnością ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Nierozpoznane klucze${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Nieprawidłowy klucz w ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Nieprawidłowe dane wejściowe";
|
||||
case "invalid_element":
|
||||
return `Nieprawidłowa wartość w ${issue.origin}`;
|
||||
default:
|
||||
return `Nieprawidłowe dane wejściowe`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
115
node_modules/zod/dist/esm/v4/locales/pt.js
generated
vendored
115
node_modules/zod/dist/esm/v4/locales/pt.js
generated
vendored
@@ -1,115 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "caracteres", verb: "ter" },
|
||||
file: { unit: "bytes", verb: "ter" },
|
||||
array: { unit: "itens", verb: "ter" },
|
||||
set: { unit: "itens", verb: "ter" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "número";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "nulo";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "padrão",
|
||||
email: "endereço de e-mail",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "data e hora ISO",
|
||||
date: "data ISO",
|
||||
time: "hora ISO",
|
||||
duration: "duração ISO",
|
||||
ipv4: "endereço IPv4",
|
||||
ipv6: "endereço IPv6",
|
||||
cidrv4: "faixa de IPv4",
|
||||
cidrv6: "faixa de IPv6",
|
||||
base64: "texto codificado em base64",
|
||||
base64url: "URL codificada em base64",
|
||||
json_string: "texto JSON",
|
||||
e164: "número E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "entrada",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Tipo inválido: esperado ${issue.expected}, recebido ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Entrada inválida: esperado ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Opção inválida: esperada uma das ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Muito grande: esperado que ${issue.origin ?? "valor"} tivesse ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementos"}`;
|
||||
return `Muito grande: esperado que ${issue.origin ?? "valor"} fosse ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Muito pequeno: esperado que ${issue.origin} tivesse ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Muito pequeno: esperado que ${issue.origin} fosse ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Texto inválido: deve começar com "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Texto inválido: deve terminar com "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Texto inválido: deve incluir "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Texto inválido: deve corresponder ao padrão ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} inválido`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Número inválido: deve ser múltiplo de ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Chave${issue.keys.length > 1 ? "s" : ""} desconhecida${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Chave inválida em ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Entrada inválida";
|
||||
case "invalid_element":
|
||||
return `Valor inválido em ${issue.origin}`;
|
||||
default:
|
||||
return `Campo inválido`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
163
node_modules/zod/dist/esm/v4/locales/ru.js
generated
vendored
163
node_modules/zod/dist/esm/v4/locales/ru.js
generated
vendored
@@ -1,163 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
function getRussianPlural(count, one, few, many) {
|
||||
const absCount = Math.abs(count);
|
||||
const lastDigit = absCount % 10;
|
||||
const lastTwoDigits = absCount % 100;
|
||||
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
||||
return many;
|
||||
}
|
||||
if (lastDigit === 1) {
|
||||
return one;
|
||||
}
|
||||
if (lastDigit >= 2 && lastDigit <= 4) {
|
||||
return few;
|
||||
}
|
||||
return many;
|
||||
}
|
||||
const Sizable = {
|
||||
string: {
|
||||
unit: {
|
||||
one: "символ",
|
||||
few: "символа",
|
||||
many: "символов",
|
||||
},
|
||||
verb: "иметь",
|
||||
},
|
||||
file: {
|
||||
unit: {
|
||||
one: "байт",
|
||||
few: "байта",
|
||||
many: "байт",
|
||||
},
|
||||
verb: "иметь",
|
||||
},
|
||||
array: {
|
||||
unit: {
|
||||
one: "элемент",
|
||||
few: "элемента",
|
||||
many: "элементов",
|
||||
},
|
||||
verb: "иметь",
|
||||
},
|
||||
set: {
|
||||
unit: {
|
||||
one: "элемент",
|
||||
few: "элемента",
|
||||
many: "элементов",
|
||||
},
|
||||
verb: "иметь",
|
||||
},
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "число";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "массив";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "ввод",
|
||||
email: "email адрес",
|
||||
url: "URL",
|
||||
emoji: "эмодзи",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO дата и время",
|
||||
date: "ISO дата",
|
||||
time: "ISO время",
|
||||
duration: "ISO длительность",
|
||||
ipv4: "IPv4 адрес",
|
||||
ipv6: "IPv6 адрес",
|
||||
cidrv4: "IPv4 диапазон",
|
||||
cidrv6: "IPv6 диапазон",
|
||||
base64: "строка в формате base64",
|
||||
base64url: "строка в формате base64url",
|
||||
json_string: "JSON строка",
|
||||
e164: "номер E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "ввод",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Неверный ввод: ожидалось ${issue.expected}, получено ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Неверный ввод: ожидалось ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Неверный вариант: ожидалось одно из ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
const maxValue = Number(issue.maximum);
|
||||
const unit = getRussianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
|
||||
return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет иметь ${adj}${issue.maximum.toString()} ${unit}`;
|
||||
}
|
||||
return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
const minValue = Number(issue.minimum);
|
||||
const unit = getRussianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
|
||||
return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет иметь ${adj}${issue.minimum.toString()} ${unit}`;
|
||||
}
|
||||
return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Неверная строка: должна начинаться с "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Неверная строка: должна заканчиваться на "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Неверная строка: должна содержать "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Неверная строка: должна соответствовать шаблону ${_issue.pattern}`;
|
||||
return `Неверный ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Неверное число: должно быть кратным ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Нераспознанн${issue.keys.length > 1 ? "ые" : "ый"} ключ${issue.keys.length > 1 ? "и" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Неверный ключ в ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Неверные входные данные";
|
||||
case "invalid_element":
|
||||
return `Неверное значение в ${issue.origin}`;
|
||||
default:
|
||||
return `Неверные входные данные`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
116
node_modules/zod/dist/esm/v4/locales/sl.js
generated
vendored
116
node_modules/zod/dist/esm/v4/locales/sl.js
generated
vendored
@@ -1,116 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "znakov", verb: "imeti" },
|
||||
file: { unit: "bajtov", verb: "imeti" },
|
||||
array: { unit: "elementov", verb: "imeti" },
|
||||
set: { unit: "elementov", verb: "imeti" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "število";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "tabela";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "vnos",
|
||||
email: "e-poštni naslov",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO datum in čas",
|
||||
date: "ISO datum",
|
||||
time: "ISO čas",
|
||||
duration: "ISO trajanje",
|
||||
ipv4: "IPv4 naslov",
|
||||
ipv6: "IPv6 naslov",
|
||||
cidrv4: "obseg IPv4",
|
||||
cidrv6: "obseg IPv6",
|
||||
base64: "base64 kodiran niz",
|
||||
base64url: "base64url kodiran niz",
|
||||
json_string: "JSON niz",
|
||||
e164: "E.164 številka",
|
||||
jwt: "JWT",
|
||||
template_literal: "vnos",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Neveljaven vnos: pričakovano ${issue.expected}, prejeto ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Neveljaven vnos: pričakovano ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Neveljavna možnost: pričakovano eno izmed ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} imelo ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementov"}`;
|
||||
return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Premajhno: pričakovano, da bo ${issue.origin} imelo ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Premajhno: pričakovano, da bo ${issue.origin} ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `Neveljaven niz: mora se začeti z "${_issue.prefix}"`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `Neveljaven niz: mora se končati z "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Neveljaven niz: mora vsebovati "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Neveljaven niz: mora ustrezati vzorcu ${_issue.pattern}`;
|
||||
return `Neveljaven ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Neveljavno število: mora biti večkratnik ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Neprepoznan${issue.keys.length > 1 ? "i ključi" : " ključ"}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Neveljaven ključ v ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Neveljaven vnos";
|
||||
case "invalid_element":
|
||||
return `Neveljavna vrednost v ${issue.origin}`;
|
||||
default:
|
||||
return "Neveljaven vnos";
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
116
node_modules/zod/dist/esm/v4/locales/ta.js
generated
vendored
116
node_modules/zod/dist/esm/v4/locales/ta.js
generated
vendored
@@ -1,116 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "எழுத்துக்கள்", verb: "கொண்டிருக்க வேண்டும்" },
|
||||
file: { unit: "பைட்டுகள்", verb: "கொண்டிருக்க வேண்டும்" },
|
||||
array: { unit: "உறுப்புகள்", verb: "கொண்டிருக்க வேண்டும்" },
|
||||
set: { unit: "உறுப்புகள்", verb: "கொண்டிருக்க வேண்டும்" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "எண் அல்லாதது" : "எண்";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "அணி";
|
||||
}
|
||||
if (data === null) {
|
||||
return "வெறுமை";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "உள்ளீடு",
|
||||
email: "மின்னஞ்சல் முகவரி",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO தேதி நேரம்",
|
||||
date: "ISO தேதி",
|
||||
time: "ISO நேரம்",
|
||||
duration: "ISO கால அளவு",
|
||||
ipv4: "IPv4 முகவரி",
|
||||
ipv6: "IPv6 முகவரி",
|
||||
cidrv4: "IPv4 வரம்பு",
|
||||
cidrv6: "IPv6 வரம்பு",
|
||||
base64: "base64-encoded சரம்",
|
||||
base64url: "base64url-encoded சரம்",
|
||||
json_string: "JSON சரம்",
|
||||
e164: "E.164 எண்",
|
||||
jwt: "JWT",
|
||||
template_literal: "input",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue.expected}, பெறப்பட்டது ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${util.joinValues(issue.values, "|")} இல் ஒன்று`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${issue.origin ?? "மதிப்பு"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "உறுப்புகள்"} ஆக இருக்க வேண்டும்`;
|
||||
}
|
||||
return `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${issue.origin ?? "மதிப்பு"} ${adj}${issue.maximum.toString()} ஆக இருக்க வேண்டும்`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} ஆக இருக்க வேண்டும்`; //
|
||||
}
|
||||
return `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${issue.origin} ${adj}${issue.minimum.toString()} ஆக இருக்க வேண்டும்`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `தவறான சரம்: "${_issue.prefix}" இல் தொடங்க வேண்டும்`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `தவறான சரம்: "${_issue.suffix}" இல் முடிவடைய வேண்டும்`;
|
||||
if (_issue.format === "includes")
|
||||
return `தவறான சரம்: "${_issue.includes}" ஐ உள்ளடக்க வேண்டும்`;
|
||||
if (_issue.format === "regex")
|
||||
return `தவறான சரம்: ${_issue.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;
|
||||
return `தவறான ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `தவறான எண்: ${issue.divisor} இன் பலமாக இருக்க வேண்டும்`;
|
||||
case "unrecognized_keys":
|
||||
return `அடையாளம் தெரியாத விசை${issue.keys.length > 1 ? "கள்" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} இல் தவறான விசை`;
|
||||
case "invalid_union":
|
||||
return "தவறான உள்ளீடு";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} இல் தவறான மதிப்பு`;
|
||||
default:
|
||||
return `தவறான உள்ளீடு`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
116
node_modules/zod/dist/esm/v4/locales/th.js
generated
vendored
116
node_modules/zod/dist/esm/v4/locales/th.js
generated
vendored
@@ -1,116 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "ตัวอักษร", verb: "ควรมี" },
|
||||
file: { unit: "ไบต์", verb: "ควรมี" },
|
||||
array: { unit: "รายการ", verb: "ควรมี" },
|
||||
set: { unit: "รายการ", verb: "ควรมี" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "ไม่ใช่ตัวเลข (NaN)" : "ตัวเลข";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "อาร์เรย์ (Array)";
|
||||
}
|
||||
if (data === null) {
|
||||
return "ไม่มีค่า (null)";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "ข้อมูลที่ป้อน",
|
||||
email: "ที่อยู่อีเมล",
|
||||
url: "URL",
|
||||
emoji: "อิโมจิ",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "วันที่เวลาแบบ ISO",
|
||||
date: "วันที่แบบ ISO",
|
||||
time: "เวลาแบบ ISO",
|
||||
duration: "ช่วงเวลาแบบ ISO",
|
||||
ipv4: "ที่อยู่ IPv4",
|
||||
ipv6: "ที่อยู่ IPv6",
|
||||
cidrv4: "ช่วง IP แบบ IPv4",
|
||||
cidrv6: "ช่วง IP แบบ IPv6",
|
||||
base64: "ข้อความแบบ Base64",
|
||||
base64url: "ข้อความแบบ Base64 สำหรับ URL",
|
||||
json_string: "ข้อความแบบ JSON",
|
||||
e164: "เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",
|
||||
jwt: "โทเคน JWT",
|
||||
template_literal: "ข้อมูลที่ป้อน",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue.expected} แต่ได้รับ ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `ค่าไม่ถูกต้อง: ควรเป็น ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "ไม่เกิน" : "น้อยกว่า";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `เกินกำหนด: ${issue.origin ?? "ค่า"} ควรมี${adj} ${issue.maximum.toString()} ${sizing.unit ?? "รายการ"}`;
|
||||
return `เกินกำหนด: ${issue.origin ?? "ค่า"} ควรมี${adj} ${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? "อย่างน้อย" : "มากกว่า";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `น้อยกว่ากำหนด: ${issue.origin} ควรมี${adj} ${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `น้อยกว่ากำหนด: ${issue.origin} ควรมี${adj} ${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${_issue.prefix}"`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${_issue.includes}" อยู่ในข้อความ`;
|
||||
if (_issue.format === "regex")
|
||||
return `รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${_issue.pattern}`;
|
||||
return `รูปแบบไม่ถูกต้อง: ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${issue.divisor} ได้ลงตัว`;
|
||||
case "unrecognized_keys":
|
||||
return `พบคีย์ที่ไม่รู้จัก: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `คีย์ไม่ถูกต้องใน ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";
|
||||
case "invalid_element":
|
||||
return `ข้อมูลไม่ถูกต้องใน ${issue.origin}`;
|
||||
default:
|
||||
return `ข้อมูลไม่ถูกต้อง`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
114
node_modules/zod/dist/esm/v4/locales/tr.js
generated
vendored
114
node_modules/zod/dist/esm/v4/locales/tr.js
generated
vendored
@@ -1,114 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "karakter", verb: "olmalı" },
|
||||
file: { unit: "bayt", verb: "olmalı" },
|
||||
array: { unit: "öğe", verb: "olmalı" },
|
||||
set: { unit: "öğe", verb: "olmalı" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "girdi",
|
||||
email: "e-posta adresi",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO tarih ve saat",
|
||||
date: "ISO tarih",
|
||||
time: "ISO saat",
|
||||
duration: "ISO süre",
|
||||
ipv4: "IPv4 adresi",
|
||||
ipv6: "IPv6 adresi",
|
||||
cidrv4: "IPv4 aralığı",
|
||||
cidrv6: "IPv6 aralığı",
|
||||
base64: "base64 ile şifrelenmiş metin",
|
||||
base64url: "base64url ile şifrelenmiş metin",
|
||||
json_string: "JSON dizesi",
|
||||
e164: "E.164 sayısı",
|
||||
jwt: "JWT",
|
||||
template_literal: "Şablon dizesi",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Geçersiz değer: beklenen ${issue.expected}, alınan ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Geçersiz değer: beklenen ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Geçersiz seçenek: aşağıdakilerden biri olmalı: ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Çok büyük: beklenen ${issue.origin ?? "değer"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "öğe"}`;
|
||||
return `Çok büyük: beklenen ${issue.origin ?? "değer"} ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Çok küçük: beklenen ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
return `Çok küçük: beklenen ${issue.origin} ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Geçersiz metin: "${_issue.prefix}" ile başlamalı`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Geçersiz metin: "${_issue.suffix}" ile bitmeli`;
|
||||
if (_issue.format === "includes")
|
||||
return `Geçersiz metin: "${_issue.includes}" içermeli`;
|
||||
if (_issue.format === "regex")
|
||||
return `Geçersiz metin: ${_issue.pattern} desenine uymalı`;
|
||||
return `Geçersiz ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Geçersiz sayı: ${issue.divisor} ile tam bölünebilmeli`;
|
||||
case "unrecognized_keys":
|
||||
return `Tanınmayan anahtar${issue.keys.length > 1 ? "lar" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} içinde geçersiz anahtar`;
|
||||
case "invalid_union":
|
||||
return "Geçersiz değer";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} içinde geçersiz değer`;
|
||||
default:
|
||||
return `Geçersiz değer`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
116
node_modules/zod/dist/esm/v4/locales/ua.js
generated
vendored
116
node_modules/zod/dist/esm/v4/locales/ua.js
generated
vendored
@@ -1,116 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "символів", verb: "матиме" },
|
||||
file: { unit: "байтів", verb: "матиме" },
|
||||
array: { unit: "елементів", verb: "матиме" },
|
||||
set: { unit: "елементів", verb: "матиме" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "число";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "масив";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "вхідні дані",
|
||||
email: "адреса електронної пошти",
|
||||
url: "URL",
|
||||
emoji: "емодзі",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "дата та час ISO",
|
||||
date: "дата ISO",
|
||||
time: "час ISO",
|
||||
duration: "тривалість ISO",
|
||||
ipv4: "адреса IPv4",
|
||||
ipv6: "адреса IPv6",
|
||||
cidrv4: "діапазон IPv4",
|
||||
cidrv6: "діапазон IPv6",
|
||||
base64: "рядок у кодуванні base64",
|
||||
base64url: "рядок у кодуванні base64url",
|
||||
json_string: "рядок JSON",
|
||||
e164: "номер E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "вхідні дані",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Неправильні вхідні дані: очікується ${issue.expected}, отримано ${parsedType(issue.input)}`;
|
||||
// return `Неправильні вхідні дані: очікується ${issue.expected}, отримано ${util.getParsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Неправильні вхідні дані: очікується ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Неправильна опція: очікується одне з ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Занадто велике: очікується, що ${issue.origin ?? "значення"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "елементів"}`;
|
||||
return `Занадто велике: очікується, що ${issue.origin ?? "значення"} буде ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Занадто мале: очікується, що ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Занадто мале: очікується, що ${issue.origin} буде ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Неправильний рядок: повинен починатися з "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Неправильний рядок: повинен закінчуватися на "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Неправильний рядок: повинен містити "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Неправильний рядок: повинен відповідати шаблону ${_issue.pattern}`;
|
||||
return `Неправильний ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Неправильне число: повинно бути кратним ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Нерозпізнаний ключ${issue.keys.length > 1 ? "і" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Неправильний ключ у ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Неправильні вхідні дані";
|
||||
case "invalid_element":
|
||||
return `Неправильне значення у ${issue.origin}`;
|
||||
default:
|
||||
return `Неправильні вхідні дані`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
116
node_modules/zod/dist/esm/v4/locales/ur.js
generated
vendored
116
node_modules/zod/dist/esm/v4/locales/ur.js
generated
vendored
@@ -1,116 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "حروف", verb: "ہونا" },
|
||||
file: { unit: "بائٹس", verb: "ہونا" },
|
||||
array: { unit: "آئٹمز", verb: "ہونا" },
|
||||
set: { unit: "آئٹمز", verb: "ہونا" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "نمبر";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "آرے";
|
||||
}
|
||||
if (data === null) {
|
||||
return "نل";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "ان پٹ",
|
||||
email: "ای میل ایڈریس",
|
||||
url: "یو آر ایل",
|
||||
emoji: "ایموجی",
|
||||
uuid: "یو یو آئی ڈی",
|
||||
uuidv4: "یو یو آئی ڈی وی 4",
|
||||
uuidv6: "یو یو آئی ڈی وی 6",
|
||||
nanoid: "نینو آئی ڈی",
|
||||
guid: "جی یو آئی ڈی",
|
||||
cuid: "سی یو آئی ڈی",
|
||||
cuid2: "سی یو آئی ڈی 2",
|
||||
ulid: "یو ایل آئی ڈی",
|
||||
xid: "ایکس آئی ڈی",
|
||||
ksuid: "کے ایس یو آئی ڈی",
|
||||
datetime: "آئی ایس او ڈیٹ ٹائم",
|
||||
date: "آئی ایس او تاریخ",
|
||||
time: "آئی ایس او وقت",
|
||||
duration: "آئی ایس او مدت",
|
||||
ipv4: "آئی پی وی 4 ایڈریس",
|
||||
ipv6: "آئی پی وی 6 ایڈریس",
|
||||
cidrv4: "آئی پی وی 4 رینج",
|
||||
cidrv6: "آئی پی وی 6 رینج",
|
||||
base64: "بیس 64 ان کوڈڈ سٹرنگ",
|
||||
base64url: "بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",
|
||||
json_string: "جے ایس او این سٹرنگ",
|
||||
e164: "ای 164 نمبر",
|
||||
jwt: "جے ڈبلیو ٹی",
|
||||
template_literal: "ان پٹ",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `غلط ان پٹ: ${issue.expected} متوقع تھا، ${parsedType(issue.input)} موصول ہوا`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `غلط ان پٹ: ${util.stringifyPrimitive(issue.values[0])} متوقع تھا`;
|
||||
return `غلط آپشن: ${util.joinValues(issue.values, "|")} میں سے ایک متوقع تھا`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `بہت بڑا: ${issue.origin ?? "ویلیو"} کے ${adj}${issue.maximum.toString()} ${sizing.unit ?? "عناصر"} ہونے متوقع تھے`;
|
||||
return `بہت بڑا: ${issue.origin ?? "ویلیو"} کا ${adj}${issue.maximum.toString()} ہونا متوقع تھا`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `بہت چھوٹا: ${issue.origin} کے ${adj}${issue.minimum.toString()} ${sizing.unit} ہونے متوقع تھے`;
|
||||
}
|
||||
return `بہت چھوٹا: ${issue.origin} کا ${adj}${issue.minimum.toString()} ہونا متوقع تھا`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `غلط سٹرنگ: "${_issue.prefix}" سے شروع ہونا چاہیے`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `غلط سٹرنگ: "${_issue.suffix}" پر ختم ہونا چاہیے`;
|
||||
if (_issue.format === "includes")
|
||||
return `غلط سٹرنگ: "${_issue.includes}" شامل ہونا چاہیے`;
|
||||
if (_issue.format === "regex")
|
||||
return `غلط سٹرنگ: پیٹرن ${_issue.pattern} سے میچ ہونا چاہیے`;
|
||||
return `غلط ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `غلط نمبر: ${issue.divisor} کا مضاعف ہونا چاہیے`;
|
||||
case "unrecognized_keys":
|
||||
return `غیر تسلیم شدہ کی${issue.keys.length > 1 ? "ز" : ""}: ${util.joinValues(issue.keys, "، ")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} میں غلط کی`;
|
||||
case "invalid_union":
|
||||
return "غلط ان پٹ";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} میں غلط ویلیو`;
|
||||
default:
|
||||
return `غلط ان پٹ`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
115
node_modules/zod/dist/esm/v4/locales/vi.js
generated
vendored
115
node_modules/zod/dist/esm/v4/locales/vi.js
generated
vendored
@@ -1,115 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "ký tự", verb: "có" },
|
||||
file: { unit: "byte", verb: "có" },
|
||||
array: { unit: "phần tử", verb: "có" },
|
||||
set: { unit: "phần tử", verb: "có" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "số";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "mảng";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "đầu vào",
|
||||
email: "địa chỉ email",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ngày giờ ISO",
|
||||
date: "ngày ISO",
|
||||
time: "giờ ISO",
|
||||
duration: "khoảng thời gian ISO",
|
||||
ipv4: "địa chỉ IPv4",
|
||||
ipv6: "địa chỉ IPv6",
|
||||
cidrv4: "dải IPv4",
|
||||
cidrv6: "dải IPv6",
|
||||
base64: "chuỗi mã hóa base64",
|
||||
base64url: "chuỗi mã hóa base64url",
|
||||
json_string: "chuỗi JSON",
|
||||
e164: "số E.164",
|
||||
jwt: "JWT",
|
||||
template_literal: "đầu vào",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `Đầu vào không hợp lệ: mong đợi ${issue.expected}, nhận được ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `Đầu vào không hợp lệ: mong đợi ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `Quá lớn: mong đợi ${issue.origin ?? "giá trị"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "phần tử"}`;
|
||||
return `Quá lớn: mong đợi ${issue.origin ?? "giá trị"} ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `Quá nhỏ: mong đợi ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `Quá nhỏ: mong đợi ${issue.origin} ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `Chuỗi không hợp lệ: phải bắt đầu bằng "${_issue.prefix}"`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `Chuỗi không hợp lệ: phải kết thúc bằng "${_issue.suffix}"`;
|
||||
if (_issue.format === "includes")
|
||||
return `Chuỗi không hợp lệ: phải bao gồm "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `Chuỗi không hợp lệ: phải khớp với mẫu ${_issue.pattern}`;
|
||||
return `${Nouns[_issue.format] ?? issue.format} không hợp lệ`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Số không hợp lệ: phải là bội số của ${issue.divisor}`;
|
||||
case "unrecognized_keys":
|
||||
return `Khóa không được nhận dạng: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Khóa không hợp lệ trong ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Đầu vào không hợp lệ";
|
||||
case "invalid_element":
|
||||
return `Giá trị không hợp lệ trong ${issue.origin}`;
|
||||
default:
|
||||
return `Đầu vào không hợp lệ`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
115
node_modules/zod/dist/esm/v4/locales/zh-CN.js
generated
vendored
115
node_modules/zod/dist/esm/v4/locales/zh-CN.js
generated
vendored
@@ -1,115 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "字符", verb: "包含" },
|
||||
file: { unit: "字节", verb: "包含" },
|
||||
array: { unit: "项", verb: "包含" },
|
||||
set: { unit: "项", verb: "包含" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "非数字(NaN)" : "数字";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "数组";
|
||||
}
|
||||
if (data === null) {
|
||||
return "空值(null)";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "输入",
|
||||
email: "电子邮件",
|
||||
url: "URL",
|
||||
emoji: "表情符号",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO日期时间",
|
||||
date: "ISO日期",
|
||||
time: "ISO时间",
|
||||
duration: "ISO时长",
|
||||
ipv4: "IPv4地址",
|
||||
ipv6: "IPv6地址",
|
||||
cidrv4: "IPv4网段",
|
||||
cidrv6: "IPv6网段",
|
||||
base64: "base64编码字符串",
|
||||
base64url: "base64url编码字符串",
|
||||
json_string: "JSON字符串",
|
||||
e164: "E.164号码",
|
||||
jwt: "JWT",
|
||||
template_literal: "输入",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `无效输入:期望 ${issue.expected},实际接收 ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `无效输入:期望 ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `无效选项:期望以下之一 ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `数值过大:期望 ${issue.origin ?? "值"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "个元素"}`;
|
||||
return `数值过大:期望 ${issue.origin ?? "值"} ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `数值过小:期望 ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `数值过小:期望 ${issue.origin} ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with")
|
||||
return `无效字符串:必须以 "${_issue.prefix}" 开头`;
|
||||
if (_issue.format === "ends_with")
|
||||
return `无效字符串:必须以 "${_issue.suffix}" 结尾`;
|
||||
if (_issue.format === "includes")
|
||||
return `无效字符串:必须包含 "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `无效字符串:必须满足正则表达式 ${_issue.pattern}`;
|
||||
return `无效${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `无效数字:必须是 ${issue.divisor} 的倍数`;
|
||||
case "unrecognized_keys":
|
||||
return `出现未知的键(key): ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} 中的键(key)无效`;
|
||||
case "invalid_union":
|
||||
return "无效输入";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} 中包含无效值(value)`;
|
||||
default:
|
||||
return `无效输入`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
116
node_modules/zod/dist/esm/v4/locales/zh-tw.js
generated
vendored
116
node_modules/zod/dist/esm/v4/locales/zh-tw.js
generated
vendored
@@ -1,116 +0,0 @@
|
||||
import * as util from "../core/util.js";
|
||||
const Sizable = {
|
||||
string: { unit: "字元", verb: "擁有" },
|
||||
file: { unit: "位元組", verb: "擁有" },
|
||||
array: { unit: "項目", verb: "擁有" },
|
||||
set: { unit: "項目", verb: "擁有" },
|
||||
};
|
||||
function getSizing(origin) {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
export const parsedType = (data) => {
|
||||
const t = typeof data;
|
||||
switch (t) {
|
||||
case "number": {
|
||||
return Number.isNaN(data) ? "NaN" : "number";
|
||||
}
|
||||
case "object": {
|
||||
if (Array.isArray(data)) {
|
||||
return "array";
|
||||
}
|
||||
if (data === null) {
|
||||
return "null";
|
||||
}
|
||||
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
||||
return data.constructor.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const Nouns = {
|
||||
regex: "輸入",
|
||||
email: "郵件地址",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO 日期時間",
|
||||
date: "ISO 日期",
|
||||
time: "ISO 時間",
|
||||
duration: "ISO 期間",
|
||||
ipv4: "IPv4 位址",
|
||||
ipv6: "IPv6 位址",
|
||||
cidrv4: "IPv4 範圍",
|
||||
cidrv6: "IPv6 範圍",
|
||||
base64: "base64 編碼字串",
|
||||
base64url: "base64url 編碼字串",
|
||||
json_string: "JSON 字串",
|
||||
e164: "E.164 數值",
|
||||
jwt: "JWT",
|
||||
template_literal: "輸入",
|
||||
};
|
||||
const error = (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type":
|
||||
return `無效的輸入值:預期為 ${issue.expected},但收到 ${parsedType(issue.input)}`;
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1)
|
||||
return `無效的輸入值:預期為 ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `無效的選項:預期為以下其中之一 ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing)
|
||||
return `數值過大:預期 ${issue.origin ?? "值"} 應為 ${adj}${issue.maximum.toString()} ${sizing.unit ?? "個元素"}`;
|
||||
return `數值過大:預期 ${issue.origin ?? "值"} 應為 ${adj}${issue.maximum.toString()}`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
if (sizing) {
|
||||
return `數值過小:預期 ${issue.origin} 應為 ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
||||
}
|
||||
return `數值過小:預期 ${issue.origin} 應為 ${adj}${issue.minimum.toString()}`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `無效的字串:必須以 "${_issue.prefix}" 開頭`;
|
||||
}
|
||||
if (_issue.format === "ends_with")
|
||||
return `無效的字串:必須以 "${_issue.suffix}" 結尾`;
|
||||
if (_issue.format === "includes")
|
||||
return `無效的字串:必須包含 "${_issue.includes}"`;
|
||||
if (_issue.format === "regex")
|
||||
return `無效的字串:必須符合格式 ${_issue.pattern}`;
|
||||
return `無效的 ${Nouns[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `無效的數字:必須為 ${issue.divisor} 的倍數`;
|
||||
case "unrecognized_keys":
|
||||
return `無法識別的鍵值${issue.keys.length > 1 ? "們" : ""}:${util.joinValues(issue.keys, "、")}`;
|
||||
case "invalid_key":
|
||||
return `${issue.origin} 中有無效的鍵值`;
|
||||
case "invalid_union":
|
||||
return "無效的輸入值";
|
||||
case "invalid_element":
|
||||
return `${issue.origin} 中有無效的值`;
|
||||
default:
|
||||
return `無效的輸入值`;
|
||||
}
|
||||
};
|
||||
export { error };
|
||||
export default function () {
|
||||
return {
|
||||
localeError: error,
|
||||
};
|
||||
}
|
||||
7
node_modules/zod/dist/esm/v4/mini/external.js
generated
vendored
7
node_modules/zod/dist/esm/v4/mini/external.js
generated
vendored
@@ -1,7 +0,0 @@
|
||||
export * as core from "zod/v4/core";
|
||||
export * from "./parse.js";
|
||||
export * from "./schemas.js";
|
||||
export * from "./checks.js";
|
||||
export { globalRegistry, registry, config, $output, $input, $brand, function, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, locales, } from "zod/v4/core";
|
||||
/** A special constant with type `never` */
|
||||
// export const NEVER = {} as never;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user