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.
This commit is contained in:
149
dev/env/node_modules/ethers/lib.commonjs/wallet/utils.js
generated
vendored
Executable file
149
dev/env/node_modules/ethers/lib.commonjs/wallet/utils.js
generated
vendored
Executable file
@@ -0,0 +1,149 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.spelunk = exports.getPassword = exports.zpad = exports.looseArrayify = void 0;
|
||||
const index_js_1 = require("../utils/index.js");
|
||||
function looseArrayify(hexString) {
|
||||
if (typeof (hexString) === "string" && !hexString.startsWith("0x")) {
|
||||
hexString = "0x" + hexString;
|
||||
}
|
||||
return (0, index_js_1.getBytesCopy)(hexString);
|
||||
}
|
||||
exports.looseArrayify = looseArrayify;
|
||||
function zpad(value, length) {
|
||||
value = String(value);
|
||||
while (value.length < length) {
|
||||
value = '0' + value;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
exports.zpad = zpad;
|
||||
function getPassword(password) {
|
||||
if (typeof (password) === 'string') {
|
||||
return (0, index_js_1.toUtf8Bytes)(password, "NFKC");
|
||||
}
|
||||
return (0, index_js_1.getBytesCopy)(password);
|
||||
}
|
||||
exports.getPassword = getPassword;
|
||||
function spelunk(object, _path) {
|
||||
const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);
|
||||
(0, index_js_1.assertArgument)(match != null, "invalid path", "path", _path);
|
||||
const path = match[1];
|
||||
const type = match[3];
|
||||
const reqd = (match[4] === "!");
|
||||
let cur = object;
|
||||
for (const comp of path.toLowerCase().split('.')) {
|
||||
// Search for a child object with a case-insensitive matching key
|
||||
if (Array.isArray(cur)) {
|
||||
if (!comp.match(/^[0-9]+$/)) {
|
||||
break;
|
||||
}
|
||||
cur = cur[parseInt(comp)];
|
||||
}
|
||||
else if (typeof (cur) === "object") {
|
||||
let found = null;
|
||||
for (const key in cur) {
|
||||
if (key.toLowerCase() === comp) {
|
||||
found = cur[key];
|
||||
break;
|
||||
}
|
||||
}
|
||||
cur = found;
|
||||
}
|
||||
else {
|
||||
cur = null;
|
||||
}
|
||||
if (cur == null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
(0, index_js_1.assertArgument)(!reqd || cur != null, "missing required value", "path", path);
|
||||
if (type && cur != null) {
|
||||
if (type === "int") {
|
||||
if (typeof (cur) === "string" && cur.match(/^-?[0-9]+$/)) {
|
||||
return parseInt(cur);
|
||||
}
|
||||
else if (Number.isSafeInteger(cur)) {
|
||||
return cur;
|
||||
}
|
||||
}
|
||||
if (type === "number") {
|
||||
if (typeof (cur) === "string" && cur.match(/^-?[0-9.]*$/)) {
|
||||
return parseFloat(cur);
|
||||
}
|
||||
}
|
||||
if (type === "data") {
|
||||
if (typeof (cur) === "string") {
|
||||
return looseArrayify(cur);
|
||||
}
|
||||
}
|
||||
if (type === "array" && Array.isArray(cur)) {
|
||||
return cur;
|
||||
}
|
||||
if (type === typeof (cur)) {
|
||||
return cur;
|
||||
}
|
||||
(0, index_js_1.assertArgument)(false, `wrong type found for ${type} `, "path", path);
|
||||
}
|
||||
return cur;
|
||||
}
|
||||
exports.spelunk = spelunk;
|
||||
/*
|
||||
export function follow(object: any, path: string): null | string {
|
||||
let currentChild = object;
|
||||
|
||||
for (const comp of path.toLowerCase().split('/')) {
|
||||
|
||||
// Search for a child object with a case-insensitive matching key
|
||||
let matchingChild = null;
|
||||
for (const key in currentChild) {
|
||||
if (key.toLowerCase() === comp) {
|
||||
matchingChild = currentChild[key];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (matchingChild === null) { return null; }
|
||||
|
||||
currentChild = matchingChild;
|
||||
}
|
||||
|
||||
return currentChild;
|
||||
}
|
||||
|
||||
// "path/to/something:type!"
|
||||
export function followRequired(data: any, path: string): string {
|
||||
const value = follow(data, path);
|
||||
if (value != null) { return value; }
|
||||
return logger.throwArgumentError("invalid value", `data:${ path }`,
|
||||
JSON.stringify(data));
|
||||
}
|
||||
*/
|
||||
// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)
|
||||
/*
|
||||
export function uuidV4(randomBytes: BytesLike): string {
|
||||
const bytes = getBytes(randomBytes, "randomBytes");
|
||||
|
||||
// Section: 4.1.3:
|
||||
// - time_hi_and_version[12:16] = 0b0100
|
||||
bytes[6] = (bytes[6] & 0x0f) | 0x40;
|
||||
|
||||
// Section 4.4
|
||||
// - clock_seq_hi_and_reserved[6] = 0b0
|
||||
// - clock_seq_hi_and_reserved[7] = 0b1
|
||||
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
||||
|
||||
const value = hexlify(bytes);
|
||||
|
||||
return [
|
||||
value.substring(2, 10),
|
||||
value.substring(10, 14),
|
||||
value.substring(14, 18),
|
||||
value.substring(18, 22),
|
||||
value.substring(22, 34),
|
||||
].join("-");
|
||||
}
|
||||
*/
|
||||
//# sourceMappingURL=utils.js.map
|
||||
Reference in New Issue
Block a user