Download .opencode/node_modules/zod/src/v4/locales/he.ts from Chenloong999/opencode-data: direct link, hf CLI and curl.
- Browser
- Download file 4.77 kB
-
https://huggingface.co/datasets/Chenloong999/opencode-data/resolve/main/.opencode/node_modules/zod/src/v4/locales/he.ts
- Command line
-
hf download hf://datasets/Chenloong999/opencode-data/.opencode/node_modules/zod/src/v4/locales/he.ts
-
curl -L -o he.ts https://huggingface.co/datasets/Chenloong999/opencode-data/resolve/main/.opencode/node_modules/zod/src/v4/locales/he.ts
4.77 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: "讗讜转讬讜转", verb: "诇讻诇讜诇" }, | |
| file: { unit: "讘讬讬讟讬诐", verb: "诇讻诇讜诇" }, | |
| array: { unit: "驻专讬讟讬诐", verb: "诇讻诇讜诇" }, | |
| set: { unit: "驻专讬讟讬诐", verb: "诇讻诇讜诇" }, | |
| }; | |
| 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" : "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: { | |
| [k in $ZodStringFormats | (string & {})]?: string; | |
| } = { | |
| 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: "拽诇讟", | |
| }; | |
| return (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 as errors.$ZodStringFormatIssues; | |
| 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 default function (): { localeError: errors.$ZodErrorMap } { | |
| return { | |
| localeError: error(), | |
| }; | |
| } | |