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.
134 lines
4.0 KiB
JavaScript
Executable File
134 lines
4.0 KiB
JavaScript
Executable File
export var util;
|
|
(function (util) {
|
|
util.assertEqual = (_) => { };
|
|
function assertIs(_arg) { }
|
|
util.assertIs = assertIs;
|
|
function assertNever(_x) {
|
|
throw new Error();
|
|
}
|
|
util.assertNever = assertNever;
|
|
util.arrayToEnum = (items) => {
|
|
const obj = {};
|
|
for (const item of items) {
|
|
obj[item] = item;
|
|
}
|
|
return obj;
|
|
};
|
|
util.getValidEnumValues = (obj) => {
|
|
const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
|
|
const filtered = {};
|
|
for (const k of validKeys) {
|
|
filtered[k] = obj[k];
|
|
}
|
|
return util.objectValues(filtered);
|
|
};
|
|
util.objectValues = (obj) => {
|
|
return util.objectKeys(obj).map(function (e) {
|
|
return obj[e];
|
|
});
|
|
};
|
|
util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban
|
|
? (obj) => Object.keys(obj) // eslint-disable-line ban/ban
|
|
: (object) => {
|
|
const keys = [];
|
|
for (const key in object) {
|
|
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
|
keys.push(key);
|
|
}
|
|
}
|
|
return keys;
|
|
};
|
|
util.find = (arr, checker) => {
|
|
for (const item of arr) {
|
|
if (checker(item))
|
|
return item;
|
|
}
|
|
return undefined;
|
|
};
|
|
util.isInteger = typeof Number.isInteger === "function"
|
|
? (val) => Number.isInteger(val) // eslint-disable-line ban/ban
|
|
: (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
function joinValues(array, separator = " | ") {
|
|
return array.map((val) => (typeof val === "string" ? `'${val}'` : val)).join(separator);
|
|
}
|
|
util.joinValues = joinValues;
|
|
util.jsonStringifyReplacer = (_, value) => {
|
|
if (typeof value === "bigint") {
|
|
return value.toString();
|
|
}
|
|
return value;
|
|
};
|
|
})(util || (util = {}));
|
|
export var objectUtil;
|
|
(function (objectUtil) {
|
|
objectUtil.mergeShapes = (first, second) => {
|
|
return {
|
|
...first,
|
|
...second, // second overwrites first
|
|
};
|
|
};
|
|
})(objectUtil || (objectUtil = {}));
|
|
export const ZodParsedType = util.arrayToEnum([
|
|
"string",
|
|
"nan",
|
|
"number",
|
|
"integer",
|
|
"float",
|
|
"boolean",
|
|
"date",
|
|
"bigint",
|
|
"symbol",
|
|
"function",
|
|
"undefined",
|
|
"null",
|
|
"array",
|
|
"object",
|
|
"unknown",
|
|
"promise",
|
|
"void",
|
|
"never",
|
|
"map",
|
|
"set",
|
|
]);
|
|
export const getParsedType = (data) => {
|
|
const t = typeof data;
|
|
switch (t) {
|
|
case "undefined":
|
|
return ZodParsedType.undefined;
|
|
case "string":
|
|
return ZodParsedType.string;
|
|
case "number":
|
|
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
case "boolean":
|
|
return ZodParsedType.boolean;
|
|
case "function":
|
|
return ZodParsedType.function;
|
|
case "bigint":
|
|
return ZodParsedType.bigint;
|
|
case "symbol":
|
|
return ZodParsedType.symbol;
|
|
case "object":
|
|
if (Array.isArray(data)) {
|
|
return ZodParsedType.array;
|
|
}
|
|
if (data === null) {
|
|
return ZodParsedType.null;
|
|
}
|
|
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
|
|
return ZodParsedType.promise;
|
|
}
|
|
if (typeof Map !== "undefined" && data instanceof Map) {
|
|
return ZodParsedType.map;
|
|
}
|
|
if (typeof Set !== "undefined" && data instanceof Set) {
|
|
return ZodParsedType.set;
|
|
}
|
|
if (typeof Date !== "undefined" && data instanceof Date) {
|
|
return ZodParsedType.date;
|
|
}
|
|
return ZodParsedType.object;
|
|
default:
|
|
return ZodParsedType.unknown;
|
|
}
|
|
};
|