Files
aitbc/dev/env/node_modules/zod/v4/locales/zh-TW.js
aitbc 816e258d4c refactor: move brother_node development artifact to dev/test-nodes subdirectory
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.
2026-03-30 17:09:06 +02:00

118 lines
4.5 KiB
JavaScript
Executable File
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.

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" : "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: "輸入",
};
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(),
};
}