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.
54 lines
1.6 KiB
JavaScript
Executable File
54 lines
1.6 KiB
JavaScript
Executable File
/**
|
|
* Property helper functions.
|
|
*
|
|
* @_subsection api/utils:Properties [about-properties]
|
|
*/
|
|
function checkType(value, type, name) {
|
|
const types = type.split("|").map(t => t.trim());
|
|
for (let i = 0; i < types.length; i++) {
|
|
switch (type) {
|
|
case "any":
|
|
return;
|
|
case "bigint":
|
|
case "boolean":
|
|
case "number":
|
|
case "string":
|
|
if (typeof (value) === type) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
const error = new Error(`invalid value for type ${type}`);
|
|
error.code = "INVALID_ARGUMENT";
|
|
error.argument = `value.${name}`;
|
|
error.value = value;
|
|
throw error;
|
|
}
|
|
/**
|
|
* Resolves to a new object that is a copy of %%value%%, but with all
|
|
* values resolved.
|
|
*/
|
|
export async function resolveProperties(value) {
|
|
const keys = Object.keys(value);
|
|
const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));
|
|
return results.reduce((accum, v, index) => {
|
|
accum[keys[index]] = v;
|
|
return accum;
|
|
}, {});
|
|
}
|
|
/**
|
|
* Assigns the %%values%% to %%target%% as read-only values.
|
|
*
|
|
* It %%types%% is specified, the values are checked.
|
|
*/
|
|
export function defineProperties(target, values, types) {
|
|
for (let key in values) {
|
|
let value = values[key];
|
|
const type = (types ? types[key] : null);
|
|
if (type) {
|
|
checkType(value, type, key);
|
|
}
|
|
Object.defineProperty(target, key, { enumerable: true, value, writable: false });
|
|
}
|
|
}
|
|
//# sourceMappingURL=properties.js.map
|