hedgequantx 2.7.92 → 2.7.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/app.js +13 -10
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -199,9 +199,9 @@ const run = async () => {
|
|
|
199
199
|
|
|
200
200
|
// Find max name length for alignment
|
|
201
201
|
const maxNameLen = Math.max(...numbered.map(n => n.name.length));
|
|
202
|
-
const
|
|
203
|
-
const
|
|
204
|
-
const
|
|
202
|
+
const itemWidth = 4 + 1 + maxNameLen; // [##] + space + name
|
|
203
|
+
const gap = 3; // gap between columns
|
|
204
|
+
const totalContentWidth = (itemWidth * numCols) + (gap * (numCols - 1));
|
|
205
205
|
|
|
206
206
|
// New rectangle (banner is always closed)
|
|
207
207
|
console.log(chalk.cyan('╔' + '═'.repeat(innerWidth) + '╗'));
|
|
@@ -223,19 +223,22 @@ const run = async () => {
|
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
// Build line content
|
|
227
|
+
let content = '';
|
|
227
228
|
for (let i = 0; i < lineParts.length; i++) {
|
|
228
229
|
if (lineParts[i]) {
|
|
229
|
-
|
|
230
|
+
content += chalk.cyan(lineParts[i].num) + ' ' + chalk.white(lineParts[i].name);
|
|
230
231
|
} else {
|
|
231
|
-
|
|
232
|
+
content += ' '.repeat(itemWidth);
|
|
232
233
|
}
|
|
233
|
-
if (i < lineParts.length - 1)
|
|
234
|
+
if (i < lineParts.length - 1) content += ' '.repeat(gap);
|
|
234
235
|
}
|
|
235
236
|
|
|
236
|
-
|
|
237
|
-
const
|
|
238
|
-
|
|
237
|
+
// Center the content
|
|
238
|
+
const contentLen = content.replace(/\x1b\[[0-9;]*m/g, '').length;
|
|
239
|
+
const leftPad = Math.floor((innerWidth - contentLen) / 2);
|
|
240
|
+
const rightPad = innerWidth - contentLen - leftPad;
|
|
241
|
+
console.log(chalk.cyan('║') + ' '.repeat(leftPad) + content + ' '.repeat(rightPad) + chalk.cyan('║'));
|
|
239
242
|
}
|
|
240
243
|
|
|
241
244
|
console.log(chalk.cyan('╠' + '─'.repeat(innerWidth) + '╣'));
|