Development Artifact Cleanup: ✅ BROTHER_NODE REORGANIZATION: Moved development test node to appropriate location - dev/test-nodes/brother_node/: Moved from root directory for better organization - Contains development configuration, test logs, and test chain data - No impact on production systems - purely development/testing artifact ✅ DEVELOPMENT ARTIFACTS IDENTIFIED: - Chain ID: aitbc-brother-chain (test/development chain) - Ports: 8010 (P2P) and 8011 (RPC) - different from production - Environment: .env file with test configuration - Logs: rpc.log and node.log from development testing session (March 15, 2026) ✅ ROOT DIRECTORY CLEANUP: Removed development clutter from production directory - brother_node/ moved to dev/test-nodes/brother_node/ - Root directory now contains only production-ready components - Development artifacts properly organized in dev/ subdirectory DIRECTORY STRUCTURE IMPROVEMENT: 📁 dev/test-nodes/: Development and testing node configurations 🏗️ Root Directory: Clean production structure with only essential components 🧪 Development Isolation: Test environments separated from production BENEFITS: ✅ Clean Production Directory: No development artifacts in root ✅ Better Organization: Development nodes grouped in dev/ subdirectory ✅ Clear Separation: Production vs development environments clearly distinguished ✅ Maintainability: Easier to identify and manage development components RESULT: Successfully moved brother_node development artifact to dev/test-nodes/ subdirectory, cleaning up the root directory while preserving development testing environment for future use.
118 lines
5.2 KiB
JavaScript
Executable File
118 lines
5.2 KiB
JavaScript
Executable File
import * as util from "../core/util.js";
|
|
const error = () => {
|
|
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;
|
|
};
|
|
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: "ان پٹ",
|
|
};
|
|
return (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 default function () {
|
|
return {
|
|
localeError: error(),
|
|
};
|
|
}
|