Download .opencode/node_modules/zod/src/v4/locales/pl.ts from Chenloong999/opencode-data: direct link, hf CLI and curl.
- Browser
- Download file 4.74 kB
-
https://huggingface.co/datasets/Chenloong999/opencode-data/resolve/main/.opencode/node_modules/zod/src/v4/locales/pl.ts
- Command line
-
hf download hf://datasets/Chenloong999/opencode-data/.opencode/node_modules/zod/src/v4/locales/pl.ts
-
curl -L -o pl.ts https://huggingface.co/datasets/Chenloong999/opencode-data/resolve/main/.opencode/node_modules/zod/src/v4/locales/pl.ts
4.74 kB
| import type { $ZodStringFormats } from "../core/checks.js"; | |
| import type * as errors from "../core/errors.js"; | |
| import * as util from "../core/util.js"; | |
| const error: () => errors.$ZodErrorMap = () => { | |
| const Sizable: Record<string, { unit: string; verb: string }> = { | |
| 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: string): { unit: string; verb: string } | null { | |
| return Sizable[origin] ?? null; | |
| } | |
| const parsedType = (data: any): string => { | |
| 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: { | |
| [k in $ZodStringFormats | (string & {})]?: string; | |
| } = { | |
| 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", | |
| }; | |
| return (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 as errors.$ZodStringFormatIssues; | |
| 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 default function (): { localeError: errors.$ZodErrorMap } { | |
| return { | |
| localeError: error(), | |
| }; | |
| } | |