team-1/node_modules/zod/v4/locales/bg.cjs
2025-08-01 21:10:03 +02:00

156 lines
6.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"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.parsedType = void 0;
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
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 error = () => {
const Sizable = {
string: { unit: "символа", verb: "да съдържа" },
file: { unit: "байта", verb: "да съдържа" },
array: { unit: "елемента", verb: "да съдържа" },
set: { unit: "елемента", verb: "да съдържа" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
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: "вход",
};
return (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}`;
let invalid_adj = "Невалиден";
if (_issue.format === "emoji")
invalid_adj = "Невалидно";
if (_issue.format === "datetime")
invalid_adj = "Невалидно";
if (_issue.format === "date")
invalid_adj = "Невалидна";
if (_issue.format === "time")
invalid_adj = "Невалидно";
if (_issue.format === "duration")
invalid_adj = "Невалидна";
return `${invalid_adj} ${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 `Невалиден вход`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}