@spfunctions/cli 1.7.19 → 1.7.22
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/dist/101.index.js +1 -0
- package/dist/12.index.js +1 -0
- package/dist/160.index.js +1 -0
- package/dist/174.index.js +1 -0
- package/dist/278.index.js +6 -0
- package/dist/582.index.js +1 -0
- package/dist/641.index.js +324 -0
- package/dist/669.index.js +1 -0
- package/dist/722.index.js +1 -0
- package/dist/788.index.js +1 -0
- package/dist/816.index.js +12 -0
- package/dist/830.index.js +1 -0
- package/dist/921.index.js +1 -0
- package/dist/index.js +1 -833
- package/package.json +5 -2
- package/dist/cache.d.ts +0 -6
- package/dist/cache.js +0 -31
- package/dist/cache.test.d.ts +0 -1
- package/dist/cache.test.js +0 -73
- package/dist/client.d.ts +0 -56
- package/dist/client.js +0 -205
- package/dist/client.test.d.ts +0 -1
- package/dist/client.test.js +0 -89
- package/dist/commands/agent.d.ts +0 -20
- package/dist/commands/agent.js +0 -4119
- package/dist/commands/announcements.d.ts +0 -3
- package/dist/commands/announcements.js +0 -28
- package/dist/commands/augment.d.ts +0 -12
- package/dist/commands/augment.js +0 -56
- package/dist/commands/balance.d.ts +0 -3
- package/dist/commands/balance.js +0 -17
- package/dist/commands/book.d.ts +0 -17
- package/dist/commands/book.js +0 -220
- package/dist/commands/cancel.d.ts +0 -5
- package/dist/commands/cancel.js +0 -41
- package/dist/commands/context.d.ts +0 -6
- package/dist/commands/context.js +0 -208
- package/dist/commands/create.d.ts +0 -7
- package/dist/commands/create.js +0 -42
- package/dist/commands/dashboard.d.ts +0 -14
- package/dist/commands/dashboard.js +0 -215
- package/dist/commands/delta.d.ts +0 -16
- package/dist/commands/delta.js +0 -115
- package/dist/commands/edges.d.ts +0 -26
- package/dist/commands/edges.js +0 -246
- package/dist/commands/evaluate.d.ts +0 -4
- package/dist/commands/evaluate.js +0 -30
- package/dist/commands/explore.d.ts +0 -14
- package/dist/commands/explore.js +0 -116
- package/dist/commands/feed.d.ts +0 -13
- package/dist/commands/feed.js +0 -73
- package/dist/commands/fills.d.ts +0 -4
- package/dist/commands/fills.js +0 -29
- package/dist/commands/forecast.d.ts +0 -4
- package/dist/commands/forecast.js +0 -53
- package/dist/commands/get.d.ts +0 -5
- package/dist/commands/get.js +0 -98
- package/dist/commands/heartbeat.d.ts +0 -20
- package/dist/commands/heartbeat.js +0 -73
- package/dist/commands/history.d.ts +0 -3
- package/dist/commands/history.js +0 -38
- package/dist/commands/liquidity.d.ts +0 -14
- package/dist/commands/liquidity.js +0 -378
- package/dist/commands/list.d.ts +0 -5
- package/dist/commands/list.js +0 -38
- package/dist/commands/login.d.ts +0 -10
- package/dist/commands/login.js +0 -98
- package/dist/commands/markets.d.ts +0 -10
- package/dist/commands/markets.js +0 -39
- package/dist/commands/milestones.d.ts +0 -8
- package/dist/commands/milestones.js +0 -56
- package/dist/commands/orders.d.ts +0 -4
- package/dist/commands/orders.js +0 -28
- package/dist/commands/performance.d.ts +0 -11
- package/dist/commands/performance.js +0 -250
- package/dist/commands/positions.d.ts +0 -19
- package/dist/commands/positions.js +0 -294
- package/dist/commands/prompt.d.ts +0 -13
- package/dist/commands/prompt.js +0 -35
- package/dist/commands/publish.d.ts +0 -15
- package/dist/commands/publish.js +0 -39
- package/dist/commands/query.d.ts +0 -15
- package/dist/commands/query.js +0 -132
- package/dist/commands/rfq.d.ts +0 -5
- package/dist/commands/rfq.js +0 -35
- package/dist/commands/scan.d.ts +0 -11
- package/dist/commands/scan.js +0 -230
- package/dist/commands/schedule.d.ts +0 -3
- package/dist/commands/schedule.js +0 -38
- package/dist/commands/settlements.d.ts +0 -6
- package/dist/commands/settlements.js +0 -50
- package/dist/commands/setup.d.ts +0 -24
- package/dist/commands/setup.js +0 -700
- package/dist/commands/signal.d.ts +0 -6
- package/dist/commands/signal.js +0 -32
- package/dist/commands/strategies.d.ts +0 -11
- package/dist/commands/strategies.js +0 -130
- package/dist/commands/telegram.d.ts +0 -15
- package/dist/commands/telegram.js +0 -125
- package/dist/commands/trade.d.ts +0 -12
- package/dist/commands/trade.js +0 -112
- package/dist/commands/watch.d.ts +0 -19
- package/dist/commands/watch.js +0 -157
- package/dist/commands/whatif.d.ts +0 -17
- package/dist/commands/whatif.js +0 -209
- package/dist/commands/x.d.ts +0 -28
- package/dist/commands/x.js +0 -167
- package/dist/config.d.ts +0 -55
- package/dist/config.js +0 -139
- package/dist/config.test.d.ts +0 -1
- package/dist/config.test.js +0 -138
- package/dist/index.d.ts +0 -20
- package/dist/kalshi.d.ts +0 -144
- package/dist/kalshi.js +0 -498
- package/dist/polymarket.d.ts +0 -237
- package/dist/polymarket.js +0 -353
- package/dist/polymarket.test.d.ts +0 -1
- package/dist/polymarket.test.js +0 -424
- package/dist/share.d.ts +0 -4
- package/dist/share.js +0 -27
- package/dist/skills/loader.d.ts +0 -19
- package/dist/skills/loader.js +0 -86
- package/dist/telegram/agent-bridge.d.ts +0 -15
- package/dist/telegram/agent-bridge.js +0 -573
- package/dist/telegram/bot.d.ts +0 -10
- package/dist/telegram/bot.js +0 -297
- package/dist/telegram/commands.d.ts +0 -11
- package/dist/telegram/commands.js +0 -120
- package/dist/telegram/format.d.ts +0 -11
- package/dist/telegram/format.js +0 -51
- package/dist/telegram/format.test.d.ts +0 -1
- package/dist/telegram/format.test.js +0 -73
- package/dist/telegram/poller.d.ts +0 -6
- package/dist/telegram/poller.js +0 -32
- package/dist/topics.d.ts +0 -17
- package/dist/topics.js +0 -102
- package/dist/topics.test.d.ts +0 -1
- package/dist/topics.test.js +0 -131
- package/dist/tui/border.d.ts +0 -33
- package/dist/tui/border.js +0 -87
- package/dist/tui/chart.d.ts +0 -19
- package/dist/tui/chart.js +0 -117
- package/dist/tui/dashboard.d.ts +0 -9
- package/dist/tui/dashboard.js +0 -814
- package/dist/tui/layout.d.ts +0 -16
- package/dist/tui/layout.js +0 -41
- package/dist/tui/screen.d.ts +0 -33
- package/dist/tui/screen.js +0 -102
- package/dist/tui/state.d.ts +0 -40
- package/dist/tui/state.js +0 -36
- package/dist/tui/widgets/commandbar.d.ts +0 -8
- package/dist/tui/widgets/commandbar.js +0 -82
- package/dist/tui/widgets/detail.d.ts +0 -9
- package/dist/tui/widgets/detail.js +0 -151
- package/dist/tui/widgets/edges.d.ts +0 -4
- package/dist/tui/widgets/edges.js +0 -34
- package/dist/tui/widgets/liquidity.d.ts +0 -9
- package/dist/tui/widgets/liquidity.js +0 -142
- package/dist/tui/widgets/orders.d.ts +0 -4
- package/dist/tui/widgets/orders.js +0 -37
- package/dist/tui/widgets/portfolio.d.ts +0 -4
- package/dist/tui/widgets/portfolio.js +0 -59
- package/dist/tui/widgets/signals.d.ts +0 -4
- package/dist/tui/widgets/signals.js +0 -31
- package/dist/tui/widgets/statusbar.d.ts +0 -8
- package/dist/tui/widgets/statusbar.js +0 -72
- package/dist/tui/widgets/thesis.d.ts +0 -4
- package/dist/tui/widgets/thesis.js +0 -66
- package/dist/tui/widgets/trade.d.ts +0 -9
- package/dist/tui/widgets/trade.js +0 -117
- package/dist/tui/widgets/upcoming.d.ts +0 -4
- package/dist/tui/widgets/upcoming.js +0 -41
- package/dist/tui/widgets/whatif.d.ts +0 -7
- package/dist/tui/widgets/whatif.js +0 -113
- package/dist/types/output.d.ts +0 -412
- package/dist/types/output.js +0 -9
- package/dist/utils.d.ts +0 -52
- package/dist/utils.js +0 -146
- package/dist/utils.test.d.ts +0 -1
- package/dist/utils.test.js +0 -111
package/dist/utils.js
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* CLI formatting utilities
|
|
4
|
-
*
|
|
5
|
-
* ANSI escape codes only — no chalk dependency.
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.c = void 0;
|
|
9
|
-
exports.vol = vol;
|
|
10
|
-
exports.cents = cents;
|
|
11
|
-
exports.pct = pct;
|
|
12
|
-
exports.delta = delta;
|
|
13
|
-
exports.shortDate = shortDate;
|
|
14
|
-
exports.pad = pad;
|
|
15
|
-
exports.rpad = rpad;
|
|
16
|
-
exports.hr = hr;
|
|
17
|
-
exports.die = die;
|
|
18
|
-
exports.errorWithHint = errorWithHint;
|
|
19
|
-
exports.emptyState = emptyState;
|
|
20
|
-
exports.header = header;
|
|
21
|
-
exports.trunc = trunc;
|
|
22
|
-
exports.shortId = shortId;
|
|
23
|
-
// ===== ANSI Colors =====
|
|
24
|
-
exports.c = {
|
|
25
|
-
reset: '\x1b[0m',
|
|
26
|
-
bold: '\x1b[1m',
|
|
27
|
-
dim: '\x1b[2m',
|
|
28
|
-
red: '\x1b[31m',
|
|
29
|
-
green: '\x1b[32m',
|
|
30
|
-
yellow: '\x1b[33m',
|
|
31
|
-
blue: '\x1b[34m',
|
|
32
|
-
magenta: '\x1b[35m',
|
|
33
|
-
cyan: '\x1b[36m',
|
|
34
|
-
white: '\x1b[37m',
|
|
35
|
-
gray: '\x1b[90m',
|
|
36
|
-
};
|
|
37
|
-
// ===== Formatting helpers =====
|
|
38
|
-
/** Format a number as volume string: 1234567 → "1.2M", 12345 → "12K" */
|
|
39
|
-
function vol(n) {
|
|
40
|
-
if (n === null || n === undefined)
|
|
41
|
-
return '-';
|
|
42
|
-
const v = typeof n === 'string' ? parseFloat(n) : n;
|
|
43
|
-
if (isNaN(v))
|
|
44
|
-
return '-';
|
|
45
|
-
if (v >= 1_000_000)
|
|
46
|
-
return `${(v / 1_000_000).toFixed(1)}M`;
|
|
47
|
-
if (v >= 1_000)
|
|
48
|
-
return `${(v / 1_000).toFixed(0)}K`;
|
|
49
|
-
return v.toString();
|
|
50
|
-
}
|
|
51
|
-
/** Format a dollar amount as cents: 0.55 → "55¢" */
|
|
52
|
-
function cents(n) {
|
|
53
|
-
if (n === null || n === undefined)
|
|
54
|
-
return '-';
|
|
55
|
-
const v = typeof n === 'string' ? parseFloat(n) : n;
|
|
56
|
-
if (isNaN(v))
|
|
57
|
-
return '-';
|
|
58
|
-
return `${Math.round(v * 100)}¢`;
|
|
59
|
-
}
|
|
60
|
-
/** Format a probability as percentage: 0.82 → "82%" */
|
|
61
|
-
function pct(n) {
|
|
62
|
-
if (n === null || n === undefined)
|
|
63
|
-
return '-';
|
|
64
|
-
const v = typeof n === 'string' ? parseFloat(n) : n;
|
|
65
|
-
if (isNaN(v))
|
|
66
|
-
return '-';
|
|
67
|
-
return `${Math.round(v * 100)}%`;
|
|
68
|
-
}
|
|
69
|
-
/** Format a confidence delta with arrow: +0.10 → "↑ +10%", -0.05 → "↓ -5%" */
|
|
70
|
-
function delta(n) {
|
|
71
|
-
const arrow = n > 0 ? '↑' : n < 0 ? '↓' : '→';
|
|
72
|
-
const sign = n > 0 ? '+' : '';
|
|
73
|
-
return `${arrow} ${sign}${Math.round(n * 100)}%`;
|
|
74
|
-
}
|
|
75
|
-
/** Format ISO date string to short form: "2026-03-12T11:13:00Z" → "Mar 12 11:13" */
|
|
76
|
-
function shortDate(iso) {
|
|
77
|
-
if (!iso)
|
|
78
|
-
return '-';
|
|
79
|
-
try {
|
|
80
|
-
const d = new Date(iso);
|
|
81
|
-
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
82
|
-
const month = months[d.getMonth()];
|
|
83
|
-
const day = d.getDate();
|
|
84
|
-
const hours = d.getHours().toString().padStart(2, '0');
|
|
85
|
-
const mins = d.getMinutes().toString().padStart(2, '0');
|
|
86
|
-
return `${month} ${day} ${hours}:${mins}`;
|
|
87
|
-
}
|
|
88
|
-
catch {
|
|
89
|
-
return iso.slice(0, 16);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
/** Pad/truncate a string to exact width */
|
|
93
|
-
function pad(s, width) {
|
|
94
|
-
if (s.length >= width)
|
|
95
|
-
return s.slice(0, width);
|
|
96
|
-
return s + ' '.repeat(width - s.length);
|
|
97
|
-
}
|
|
98
|
-
/** Right-align a string to exact width */
|
|
99
|
-
function rpad(s, width) {
|
|
100
|
-
if (s.length >= width)
|
|
101
|
-
return s.slice(0, width);
|
|
102
|
-
return ' '.repeat(width - s.length) + s;
|
|
103
|
-
}
|
|
104
|
-
/** Print a horizontal rule */
|
|
105
|
-
function hr(width = 80) {
|
|
106
|
-
console.log(exports.c.dim + '─'.repeat(width) + exports.c.reset);
|
|
107
|
-
}
|
|
108
|
-
/** Print an error and exit */
|
|
109
|
-
function die(msg) {
|
|
110
|
-
console.error(`${exports.c.red}Error:${exports.c.reset} ${msg}`);
|
|
111
|
-
process.exit(1);
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Print an error with an actionable suggestion.
|
|
115
|
-
* Use instead of bare console.error for user-facing errors.
|
|
116
|
-
*/
|
|
117
|
-
function errorWithHint(message, hint) {
|
|
118
|
-
console.error(`\n ${exports.c.red}Error:${exports.c.reset} ${message}`);
|
|
119
|
-
if (hint)
|
|
120
|
-
console.error(` ${exports.c.dim}${hint}${exports.c.reset}`);
|
|
121
|
-
console.error();
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Print an empty state message with a next-action CTA.
|
|
125
|
-
* Use when a command returns zero results.
|
|
126
|
-
*/
|
|
127
|
-
function emptyState(thing, nextAction) {
|
|
128
|
-
console.log(`\n ${exports.c.dim}No ${thing} found.${exports.c.reset}`);
|
|
129
|
-
if (nextAction)
|
|
130
|
-
console.log(` ${exports.c.dim}${nextAction}${exports.c.reset}`);
|
|
131
|
-
console.log();
|
|
132
|
-
}
|
|
133
|
-
/** Print a section header */
|
|
134
|
-
function header(title) {
|
|
135
|
-
console.log(`\n${exports.c.bold}${exports.c.cyan}${title}${exports.c.reset}`);
|
|
136
|
-
}
|
|
137
|
-
/** Truncate a string with ellipsis */
|
|
138
|
-
function trunc(s, maxLen) {
|
|
139
|
-
if (s.length <= maxLen)
|
|
140
|
-
return s;
|
|
141
|
-
return s.slice(0, maxLen - 1) + '…';
|
|
142
|
-
}
|
|
143
|
-
/** Short ID: first 8 chars of a UUID */
|
|
144
|
-
function shortId(id) {
|
|
145
|
-
return id.slice(0, 8);
|
|
146
|
-
}
|
package/dist/utils.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/utils.test.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const vitest_1 = require("vitest");
|
|
4
|
-
const utils_js_1 = require("./utils.js");
|
|
5
|
-
(0, vitest_1.describe)('vol', () => {
|
|
6
|
-
(0, vitest_1.it)('formats millions', () => {
|
|
7
|
-
(0, vitest_1.expect)((0, utils_js_1.vol)(1_234_567)).toBe('1.2M');
|
|
8
|
-
(0, vitest_1.expect)((0, utils_js_1.vol)(5_000_000)).toBe('5.0M');
|
|
9
|
-
});
|
|
10
|
-
(0, vitest_1.it)('formats thousands', () => {
|
|
11
|
-
(0, vitest_1.expect)((0, utils_js_1.vol)(12_345)).toBe('12K');
|
|
12
|
-
(0, vitest_1.expect)((0, utils_js_1.vol)(1_000)).toBe('1K');
|
|
13
|
-
});
|
|
14
|
-
(0, vitest_1.it)('formats small numbers as-is', () => {
|
|
15
|
-
(0, vitest_1.expect)((0, utils_js_1.vol)(500)).toBe('500');
|
|
16
|
-
(0, vitest_1.expect)((0, utils_js_1.vol)(0)).toBe('0');
|
|
17
|
-
});
|
|
18
|
-
(0, vitest_1.it)('handles null/undefined/NaN', () => {
|
|
19
|
-
(0, vitest_1.expect)((0, utils_js_1.vol)(null)).toBe('-');
|
|
20
|
-
(0, vitest_1.expect)((0, utils_js_1.vol)(undefined)).toBe('-');
|
|
21
|
-
(0, vitest_1.expect)((0, utils_js_1.vol)('abc')).toBe('-');
|
|
22
|
-
});
|
|
23
|
-
(0, vitest_1.it)('parses string numbers', () => {
|
|
24
|
-
(0, vitest_1.expect)((0, utils_js_1.vol)('1500000')).toBe('1.5M');
|
|
25
|
-
(0, vitest_1.expect)((0, utils_js_1.vol)('5000')).toBe('5K');
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
(0, vitest_1.describe)('cents', () => {
|
|
29
|
-
(0, vitest_1.it)('converts decimal to cents', () => {
|
|
30
|
-
(0, vitest_1.expect)((0, utils_js_1.cents)(0.55)).toBe('55¢');
|
|
31
|
-
(0, vitest_1.expect)((0, utils_js_1.cents)(1.0)).toBe('100¢');
|
|
32
|
-
(0, vitest_1.expect)((0, utils_js_1.cents)(0)).toBe('0¢');
|
|
33
|
-
});
|
|
34
|
-
(0, vitest_1.it)('handles null/undefined', () => {
|
|
35
|
-
(0, vitest_1.expect)((0, utils_js_1.cents)(null)).toBe('-');
|
|
36
|
-
(0, vitest_1.expect)((0, utils_js_1.cents)(undefined)).toBe('-');
|
|
37
|
-
});
|
|
38
|
-
(0, vitest_1.it)('parses strings', () => {
|
|
39
|
-
(0, vitest_1.expect)((0, utils_js_1.cents)('0.42')).toBe('42¢');
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
(0, vitest_1.describe)('pct', () => {
|
|
43
|
-
(0, vitest_1.it)('converts decimal to percentage', () => {
|
|
44
|
-
(0, vitest_1.expect)((0, utils_js_1.pct)(0.82)).toBe('82%');
|
|
45
|
-
(0, vitest_1.expect)((0, utils_js_1.pct)(1.0)).toBe('100%');
|
|
46
|
-
(0, vitest_1.expect)((0, utils_js_1.pct)(0)).toBe('0%');
|
|
47
|
-
});
|
|
48
|
-
(0, vitest_1.it)('handles null/undefined', () => {
|
|
49
|
-
(0, vitest_1.expect)((0, utils_js_1.pct)(null)).toBe('-');
|
|
50
|
-
(0, vitest_1.expect)((0, utils_js_1.pct)(undefined)).toBe('-');
|
|
51
|
-
});
|
|
52
|
-
(0, vitest_1.it)('rounds to nearest integer', () => {
|
|
53
|
-
(0, vitest_1.expect)((0, utils_js_1.pct)(0.827)).toBe('83%');
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
(0, vitest_1.describe)('delta', () => {
|
|
57
|
-
(0, vitest_1.it)('shows up arrow for positive', () => {
|
|
58
|
-
(0, vitest_1.expect)((0, utils_js_1.delta)(0.10)).toBe('↑ +10%');
|
|
59
|
-
});
|
|
60
|
-
(0, vitest_1.it)('shows down arrow for negative', () => {
|
|
61
|
-
(0, vitest_1.expect)((0, utils_js_1.delta)(-0.05)).toBe('↓ -5%');
|
|
62
|
-
});
|
|
63
|
-
(0, vitest_1.it)('shows right arrow for zero', () => {
|
|
64
|
-
(0, vitest_1.expect)((0, utils_js_1.delta)(0)).toBe('→ 0%');
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
(0, vitest_1.describe)('shortDate', () => {
|
|
68
|
-
(0, vitest_1.it)('formats ISO date', () => {
|
|
69
|
-
const result = (0, utils_js_1.shortDate)('2026-03-12T11:13:00Z');
|
|
70
|
-
(0, vitest_1.expect)(result).toMatch(/Mar 12/);
|
|
71
|
-
});
|
|
72
|
-
(0, vitest_1.it)('handles null/undefined', () => {
|
|
73
|
-
(0, vitest_1.expect)((0, utils_js_1.shortDate)(null)).toBe('-');
|
|
74
|
-
(0, vitest_1.expect)((0, utils_js_1.shortDate)(undefined)).toBe('-');
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
(0, vitest_1.describe)('pad', () => {
|
|
78
|
-
(0, vitest_1.it)('pads short strings', () => {
|
|
79
|
-
(0, vitest_1.expect)((0, utils_js_1.pad)('hi', 5)).toBe('hi ');
|
|
80
|
-
});
|
|
81
|
-
(0, vitest_1.it)('truncates long strings', () => {
|
|
82
|
-
(0, vitest_1.expect)((0, utils_js_1.pad)('hello world', 5)).toBe('hello');
|
|
83
|
-
});
|
|
84
|
-
(0, vitest_1.it)('returns exact-width strings unchanged', () => {
|
|
85
|
-
(0, vitest_1.expect)((0, utils_js_1.pad)('abc', 3)).toBe('abc');
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
(0, vitest_1.describe)('rpad', () => {
|
|
89
|
-
(0, vitest_1.it)('right-aligns short strings', () => {
|
|
90
|
-
(0, vitest_1.expect)((0, utils_js_1.rpad)('hi', 5)).toBe(' hi');
|
|
91
|
-
});
|
|
92
|
-
(0, vitest_1.it)('truncates long strings', () => {
|
|
93
|
-
(0, vitest_1.expect)((0, utils_js_1.rpad)('hello world', 5)).toBe('hello');
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
(0, vitest_1.describe)('trunc', () => {
|
|
97
|
-
(0, vitest_1.it)('truncates with ellipsis', () => {
|
|
98
|
-
(0, vitest_1.expect)((0, utils_js_1.trunc)('hello world', 8)).toBe('hello w…');
|
|
99
|
-
});
|
|
100
|
-
(0, vitest_1.it)('returns short strings unchanged', () => {
|
|
101
|
-
(0, vitest_1.expect)((0, utils_js_1.trunc)('hello', 10)).toBe('hello');
|
|
102
|
-
});
|
|
103
|
-
(0, vitest_1.it)('returns exact-length strings unchanged', () => {
|
|
104
|
-
(0, vitest_1.expect)((0, utils_js_1.trunc)('hello', 5)).toBe('hello');
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
(0, vitest_1.describe)('shortId', () => {
|
|
108
|
-
(0, vitest_1.it)('returns first 8 chars', () => {
|
|
109
|
-
(0, vitest_1.expect)((0, utils_js_1.shortId)('f582bf76-3113-4208-b0c1-abc')).toBe('f582bf76');
|
|
110
|
-
});
|
|
111
|
-
});
|