Files
aitbc/dev/env/node_modules/enquirer/lib/placeholder.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

64 lines
1.8 KiB
JavaScript
Executable File

'use strict';
const utils = require('./utils');
/**
* Render a placeholder value with cursor and styling based on the
* position of the cursor.
*
* @param {Object} `prompt` Prompt instance.
* @param {String} `input` Input string.
* @param {String} `initial` The initial user-provided value.
* @param {Number} `pos` Current cursor position.
* @param {Boolean} `showCursor` Render a simulated cursor using the inverse primary style.
* @return {String} Returns the styled placeholder string.
* @api public
*/
module.exports = (prompt, options = {}) => {
prompt.cursorHide();
let { input = '', initial = '', pos, showCursor = true, color } = options;
let style = color || prompt.styles.placeholder;
let inverse = utils.inverse(prompt.styles.primary);
let blinker = str => inverse(prompt.styles.black(str));
let output = input;
let char = ' ';
let reverse = blinker(char);
if (prompt.blink && prompt.blink.off === true) {
blinker = str => str;
reverse = '';
}
if (showCursor && pos === 0 && initial === '' && input === '') {
return blinker(char);
}
if (showCursor && pos === 0 && (input === initial || input === '')) {
return blinker(initial[0]) + style(initial.slice(1));
}
initial = utils.isPrimitive(initial) ? `${initial}` : '';
input = utils.isPrimitive(input) ? `${input}` : '';
let placeholder = initial && initial.startsWith(input) && initial !== input;
let cursor = placeholder ? blinker(initial[input.length]) : reverse;
if (pos !== input.length && showCursor === true) {
output = input.slice(0, pos) + blinker(input[pos]) + input.slice(pos + 1);
cursor = '';
}
if (showCursor === false) {
cursor = '';
}
if (placeholder) {
let raw = prompt.styles.unstyle(output + cursor);
return output + cursor + style(initial.slice(raw.length));
}
return output + cursor;
};