repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

refactor(ascii-boxes): replace Deno with Node.js, convert tests to bun:test

3edb79fa1260a1595e24e4b8334c9552a70432ac

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (2)

skills/ascii-boxes/index.test.ts

Modified
1 -import {
2 - assertEquals,
3 - assertStringIncludes,
4 -} from "https://deno.land/std@0.208.0/assert/mod.ts";
1 +import { describe, expect, test } from "bun:test";
5 2 import { createTable, drawBox, drawNested } from "./index.ts";
7 -Deno.test("drawBox - simple box with content", () => {
8 - const result = drawBox("Hello", { width: 10 });
9 - const lines = result.split("\n");
11 - // Should have top border, content line, bottom border
12 - assertEquals(lines.length, 3);
14 - // Top border starts with ┌ and ends with ┐
15 - assertStringIncludes(lines[0], "┌");
16 - assertStringIncludes(lines[0], "┐");
18 - // Content line has vertical borders
19 - assertStringIncludes(lines[1], "│");
21 - // Bottom border starts with └ and ends with ┘
22 - assertStringIncludes(lines[2], "└");
23 - assertStringIncludes(lines[2], "┘");
24 -});
26 -Deno.test("drawBox - content alignment left", () => {
27 - const result = drawBox("Test", { width: 20, alignment: "left" });
28 - const lines = result.split("\n");
29 - const contentLine = lines[1];
31 - // "Test" should appear after left border and padding
32 - const testIndex = contentLine.indexOf("Test");
33 - const pipeIndex = contentLine.indexOf("│");
35 - assertEquals(contentLine[pipeIndex], "│");
36 - // Test should be after first │ and padding (1 space)
37 - assertEquals(testIndex, pipeIndex + 2);
38 -});
40 -Deno.test("drawBox - content alignment center", () => {
41 - const result = drawBox("Hi", { width: 20, alignment: "center" });
42 - const lines = result.split("\n");
43 - const contentLine = lines[1];
45 - const hiIndex = contentLine.indexOf("Hi");
46 - // In 20-char width, "Hi" centered starts at position ~9 (with borders and padding)
47 - // Box structure: │ + 1 space + [content] + remaining spaces + 1 space + │
48 - // Total inner width = 20, content = "Hi" (2 chars), so 18 spaces total
49 - // Left: 8, right: 10 (or close to that for center)
50 - assertEquals(contentLine[0], "│");
51 -});
53 -Deno.test("drawBox - content alignment right", () => {
54 - const result = drawBox("X", { width: 10, alignment: "right" });
55 - const lines = result.split("\n");
56 - const contentLine = lines[1];
58 - // Right-aligned content should be near the right border
59 - const xIndex = contentLine.indexOf("X");
60 - const rightPipeIndex = contentLine.lastIndexOf("│");
62 - // X should be before the final │ with at least 1 space gap
63 - assertEquals(contentLine[rightPipeIndex], "│");
64 -});
66 -Deno.test("drawBox - double border style", () => {
67 - const result = drawBox("Test", { style: "double" });
69 - assertStringIncludes(result, "╔");
70 - assertStringIncludes(result, "╗");
71 - assertStringIncludes(result, "╚");
72 - assertStringIncludes(result, "╝");
73 - assertStringIncludes(result, "║");
74 - assertStringIncludes(result, "═");
76 - // Should NOT have single-line chars
77 - assertEquals(result.indexOf("┌"), -1);
78 - assertEquals(result.indexOf("│"), -1);
79 -});
81 -Deno.test("drawBox - bold border style", () => {
82 - const result = drawBox("Test", { style: "bold" });
84 - assertStringIncludes(result, "┏");
85 - assertStringIncludes(result, "┓");
86 - assertStringIncludes(result, "┗");
87 - assertStringIncludes(result, "┛");
88 - assertStringIncludes(result, "┃");
89 - assertStringIncludes(result, "━");
90 -});
92 -Deno.test("drawBox - padding", () => {
93 - const result = drawBox("X", {
94 - width: 10,
95 - paddingTop: 2,
96 - paddingBottom: 2,
97 - paddingLeft: 2,
98 - paddingRight: 2,
4 +describe("drawBox", () => {
5 + test("simple box with content", () => {
6 + const result = drawBox("Hello", { width: 10 });
7 + const lines = result.split("\n");
8 + expect(lines.length).toBe(3);
9 + expect(lines[0]).toInclude("┌");
10 + expect(lines[0]).toInclude("┐");
11 + expect(lines[1]).toInclude("│");
12 + expect(lines[2]).toInclude("└");
13 + expect(lines[2]).toInclude("┘");
100 - const lines = result.split("\n");
102 - // Should have: top + 2 empty + 1 content + 2 empty + bottom = 7 lines
103 - assertEquals(lines.length, 7);
105 - // Top and bottom are borders
106 - assertStringIncludes(lines[0], "┌");
107 - assertStringIncludes(lines[6], "┘");
109 - // Lines 1-2 should be empty (just borders and spaces)
110 - assertStringIncludes(lines[1], "│");
111 - assertStringIncludes(lines[2], "│");
113 - // Line 3 is content
114 - assertStringIncludes(lines[3], "X");
116 - // Lines 4-5 are empty
117 - assertStringIncludes(lines[4], "│");
118 -});
120 -Deno.test("drawBox - multi-line content", () => {
121 - const result = drawBox(["Line 1", "Line 2", "Line 3"], { width: 20 });
122 - const lines = result.split("\n");
124 - // Should have: top + 3 content + bottom = 5 lines
125 - assertEquals(lines.length, 5);
127 - // Check that "Line 1" appears
128 - assertStringIncludes(result, "Line 1");
129 - assertStringIncludes(result, "Line 2");
130 - assertStringIncludes(result, "Line 3");
131 -});
133 -Deno.test("drawBox - wrap long text", () => {
134 - const result = drawBox("This is a very long sentence that needs wrapping", {
135 - width: 20,
16 + test("content alignment left", () => {
17 + const result = drawBox("Test", { width: 20, alignment: "left" });
18 + const lines = result.split("\n");
19 + const contentLine = lines[1];
20 + const testIndex = contentLine.indexOf("Test");
21 + const pipeIndex = contentLine.indexOf("│");
22 + expect(contentLine[pipeIndex]).toBe("│");
23 + expect(testIndex).toBe(pipeIndex + 2);
137 - const lines = result.split("\n");
139 - // Should have more than 3 lines because text wraps
140 - assertTrue(lines.length > 3);
141 -});
142 -Deno.test("createTable - simple table", () => {
143 - const result = createTable(
144 - ["Name", "Age"],
145 - [
146 - ["Alice", "30"],
147 - ["Bob", "25"],
148 - ],
149 - );
151 - assertStringIncludes(result, "Name");
152 - assertStringIncludes(result, "Age");
153 - assertStringIncludes(result, "Alice");
154 - assertStringIncludes(result, "Bob");
155 - assertStringIncludes(result, "┌");
156 - assertStringIncludes(result, "┐");
157 - assertStringIncludes(result, "└");
158 - assertStringIncludes(result, "┘");
159 -});
161 -Deno.test("createTable - separator line uses tee", () => {
162 - const result = createTable(["H1", "H2"], [["a", "b"]]);
164 - // Separator between header and data should have ├ and ┤ (tee chars)
165 - const lines = result.split("\n");
166 - // Line 2 should be the separator
167 - assertStringIncludes(lines[2], "├");
168 - assertStringIncludes(lines[2], "┤");
169 - assertStringIncludes(lines[2], "┼");
170 -});
172 -Deno.test("createTable - double style", () => {
173 - const result = createTable(["H"], [["d"]], { style: "double" });
175 - assertStringIncludes(result, "╔");
176 - assertStringIncludes(result, "╗");
177 - assertStringIncludes(result, "╠"); // Separator uses double tee
178 - assertStringIncludes(result, "╣");
179 - assertStringIncludes(result, "║");
180 - assertStringIncludes(result, "═");
181 -});
183 -Deno.test("createTable - padding", () => {
184 - const result = createTable(["Name"], [["Alice"]], { padding: 3 });
186 - // Should have 3 spaces between border and content
187 - assertStringIncludes(result, "│ Name");
188 - assertStringIncludes(result, "│ Alice");
189 -});
191 -Deno.test("drawNested - nested boxes", () => {
192 - const result = drawNested("Outer", "Inner");
194 - assertStringIncludes(result, "Outer");
195 - assertStringIncludes(result, "Inner");
196 - // Should have two sets of borders
197 - const topBorders = (result.match(/┌/g) || []).length;
198 - assertEquals(topBorders, 2);
199 -});
201 -Deno.test("drawNested - with gap", () => {
202 - const result = drawNested("O", "I", { gap: 2 });
204 - assertStringIncludes(result, "O");
205 - assertStringIncludes(result, "I");
207 - const lines = result.split("\n");
208 - // With gap=2, there should be empty lines between Outer and Inner box
209 - // Find the line with "I"
210 - const innerLine = lines.findIndex((l) => l.includes("I"));
211 - const outerLine = lines.findIndex((l) => l.includes("O"));
213 - // They should be separated by at least 2 lines
214 - assertTrue(Math.abs(innerLine - outerLine) > 2);
215 -});
217 -// ────────────────────── Additional Tests ──────────────────────
219 -// Test: Box with multi-line content array
220 -Deno.test("drawBox - array content", () => {
221 - const lines = ["Line 1", "Line 2", "Line 3"];
222 - const result = drawBox(lines, { width: 20 });
223 - assertStringIncludes(result, "Line 1");
224 - assertStringIncludes(result, "Line 2");
225 - assertStringIncludes(result, "Line 3");
226 - const outLines = result.split("\n");
227 - assertEquals(outLines.length, 5); // top + 3 content + bottom
228 -});
230 -Deno.test("drawBox - alignment right with padding", () => {
231 - const result = drawBox("X", {
232 - width: 10,
233 - alignment: "right",
234 - paddingLeft: 2,
235 - paddingRight: 2,
26 + test("content alignment center", () => {
27 + const result = drawBox("Hi", { width: 20, alignment: "center" });
28 + const lines = result.split("\n");
29 + expect(lines[1][0]).toBe("│");
237 - const lines = result.split("\n");
238 - const contentLine = lines[1];
239 - const xIdx = contentLine.indexOf("X");
240 - const rightPipe = contentLine.lastIndexOf("│");
241 - const leftPipe = contentLine.indexOf("│");
242 - assertTrue(xIdx < rightPipe);
243 - assertTrue(xIdx > leftPipe);
244 -});
246 -Deno.test("drawBox - single character wide", () => {
247 - // With default padding (1 left, 1 right), width=1 → inner content area = 3 wide
248 - // width is "content" width, padding is extra
249 - const result = drawBox("X", { width: 1 });
250 - assertStringIncludes(result, "┌───┐"); // 3 dashes: 1 inner + 2 padding
251 - assertStringIncludes(result, "│ X │");
252 - assertStringIncludes(result, "└───┘");
253 -});
255 -Deno.test("drawBox - zero padding", () => {
256 - const result = drawBox("AB", {
257 - width: 4,
258 - paddingTop: 0,
259 - paddingBottom: 0,
260 - paddingLeft: 0,
261 - paddingRight: 0,
32 + test("content alignment right", () => {
33 + const result = drawBox("X", { width: 10, alignment: "right" });
34 + const lines = result.split("\n");
35 + const contentLine = lines[1];
36 + const rightPipeIndex = contentLine.lastIndexOf("│");
37 + expect(contentLine[rightPipeIndex]).toBe("│");
263 - const lines = result.split("\n");
264 - assertEquals(lines.length, 3);
265 - // With width=4 and zero padding, inner area is 4 chars wide
266 - // "AB" aligned left becomes "AB " (4 chars total)
267 - assertStringIncludes(lines[0], "┌────┐"); // 4 dashes
268 - assertStringIncludes(lines[1], "│AB │");
269 - assertStringIncludes(lines[2], "└────┘");
270 -});
272 -Deno.test("drawBox - long text forces wrap", () => {
273 - // width=10 means content area is 10 chars wide (excluding padding)
274 - // With default paddingLeft=1, paddingRight=1, total inner width = 12
275 - const result = drawBox("This is a very long line of text", { width: 10 });
276 - const lines = result.split("\n");
277 - assertTrue(lines.length > 3);
278 - // Each content line between pipes should be ≤ 12 chars (1+10+1)
279 - const contentLines = lines.slice(1, -1);
280 - for (const cl of contentLines) {
281 - const firstPipe = cl.indexOf("│");
282 - const lastPipe = cl.lastIndexOf("│");
283 - const betweenPipes = cl.slice(firstPipe + 1, lastPipe);
284 - assertTrue(betweenPipes.length <= 12);
285 - }
286 -});
288 -Deno.test("createTable - empty rows", () => {
289 - const result = createTable(["A", "B"], [], { style: "single" });
290 - assertStringIncludes(result, "A");
291 - assertStringIncludes(result, "B");
292 - assertTrue(result.includes("├") && result.includes("┤"));
293 -});
295 -Deno.test("createTable - single column", () => {
296 - const result = createTable(["Name"], [["Alice"], ["Bob"]]);
297 - assertStringIncludes(result, "Name");
298 - assertStringIncludes(result, "Alice");
299 - assertStringIncludes(result, "Bob");
300 -});
302 -Deno.test("drawNested - zero width content", () => {
303 - const result = drawNested("", "", { gap: 0 });
304 - assertStringIncludes(result, "┌");
305 - assertStringIncludes(result, "└");
306 -});
308 -Deno.test("drawNested - different styles", () => {
309 - const result = drawNested("O", "I", {
310 - styleOuter: "double",
311 - styleInner: "bold",
312 - gap: 0,
40 + test("double border style", () => {
41 + const result = drawBox("Test", { style: "double" });
42 + expect(result).toInclude("╔");
43 + expect(result).toInclude("╗");
44 + expect(result).toInclude("╚");
45 + expect(result).toInclude("╝");
46 + expect(result).toInclude("║");
47 + expect(result).toInclude("═");
48 + expect(result).not.toInclude("┌");
49 + expect(result).not.toInclude("│");
314 - assertTrue(result.includes("╔") || result.includes("╗"));
315 - assertTrue(result.includes("┏") || result.includes("┓"));
316 -});
318 -Deno.test("drawNested - gap creates space", () => {
319 - const r1 = drawNested("O", "I", { gap: 0 });
320 - const r2 = drawNested("O", "I", { gap: 2 });
321 - assertTrue(r2.split("\n").length >= r1.split("\n").length + 2);
322 -});
324 -Deno.test("border styles are consistent", () => {
325 - const single = drawBox("T", { style: "single" });
326 - const double = drawBox("T", { style: "double" });
327 - const bold = drawBox("T", { style: "bold" });
328 - assertTrue(
329 - single.includes("┌") && single.includes("─") && single.includes("│"),
330 - );
331 - assertTrue(
332 - double.includes("╔") && double.includes("═") && double.includes("║"),
333 - );
334 - assertTrue(bold.includes("┏") && bold.includes("━") && bold.includes("┃"));
335 - assertEquals(single.includes("╔"), false);
336 - assertEquals(double.includes("┌"), false);
337 -});
339 -// ────────────────────── PI Extensions Demo Tests ──────────────────────
341 -// Test: Simulating memory/status panel like pi extensions use
342 -Deno.test("demo - system status panel", () => {
343 - const box = drawBox(" System Status ", {
344 - style: "bold",
345 - width: 30,
346 - alignment: "center",
347 - paddingTop: 1,
348 - paddingBottom: 1,
52 + test("bold border style", () => {
53 + const result = drawBox("Test", { style: "bold" });
54 + expect(result).toInclude("┏");
55 + expect(result).toInclude("┓");
56 + expect(result).toInclude("┗");
57 + expect(result).toInclude("┛");
58 + expect(result).toInclude("┃");
59 + expect(result).toInclude("━");
60 + });
62 + test("padding", () => {
63 + const result = drawBox("X", {
64 + width: 10,
65 + paddingTop: 2,
66 + paddingBottom: 2,
67 + paddingLeft: 2,
68 + paddingRight: 2,
69 + });
70 + const lines = result.split("\n");
71 + expect(lines.length).toBe(7);
72 + expect(lines[0]).toInclude("┌");
73 + expect(lines[6]).toInclude("┘");
74 + expect(lines[1]).toInclude("│");
75 + expect(lines[2]).toInclude("│");
76 + expect(lines[3]).toInclude("X");
77 + expect(lines[4]).toInclude("│");
78 + });
80 + test("multi-line content", () => {
81 + const result = drawBox(["Line 1", "Line 2", "Line 3"], { width: 20 });
82 + const lines = result.split("\n");
83 + expect(lines.length).toBe(5);
84 + expect(result).toInclude("Line 1");
85 + expect(result).toInclude("Line 2");
86 + expect(result).toInclude("Line 3");
87 + });
89 + test("wrap long text", () => {
90 + const result = drawBox("This is a very long sentence that needs wrapping", {
91 + width: 20,
92 + });
93 + const lines = result.split("\n");
94 + expect(lines.length).toBeGreaterThan(3);
95 + });
97 + test("array content", () => {
98 + const lines = ["Line 1", "Line 2", "Line 3"];
99 + const result = drawBox(lines, { width: 20 });
100 + expect(result).toInclude("Line 1");
101 + expect(result).toInclude("Line 2");
102 + expect(result).toInclude("Line 3");
103 + expect(result.split("\n").length).toBe(5);
104 + });
106 + test("alignment right with padding", () => {
107 + const result = drawBox("X", {
108 + width: 10,
109 + alignment: "right",
110 + paddingLeft: 2,
111 + paddingRight: 2,
112 + });
113 + const lines = result.split("\n");
114 + const contentLine = lines[1];
115 + const xIdx = contentLine.indexOf("X");
116 + const rightPipe = contentLine.lastIndexOf("│");
117 + const leftPipe = contentLine.indexOf("│");
118 + expect(xIdx).toBeLessThan(rightPipe);
119 + expect(xIdx).toBeGreaterThan(leftPipe);
120 + });
122 + test("single character wide", () => {
123 + const result = drawBox("X", { width: 1 });
124 + expect(result).toInclude("┌───┐");
125 + expect(result).toInclude("│ X │");
126 + expect(result).toInclude("└───┘");
127 + });
129 + test("zero padding", () => {
130 + const result = drawBox("AB", {
131 + width: 4,
132 + paddingTop: 0,
133 + paddingBottom: 0,
134 + paddingLeft: 0,
135 + paddingRight: 0,
136 + });
137 + const lines = result.split("\n");
138 + expect(lines.length).toBe(3);
139 + expect(lines[0]).toInclude("┌────┐");
140 + expect(lines[1]).toInclude("│AB │");
141 + expect(lines[2]).toInclude("└────┘");
142 + });
144 + test("long text forces wrap", () => {
145 + const result = drawBox("This is a very long line of text", { width: 10 });
146 + const lines = result.split("\n");
147 + expect(lines.length).toBeGreaterThan(3);
148 + const contentLines = lines.slice(1, -1);
149 + for (const cl of contentLines) {
150 + const firstPipe = cl.indexOf("│");
151 + const lastPipe = cl.lastIndexOf("│");
152 + const betweenPipes = cl.slice(firstPipe + 1, lastPipe);
153 + expect(betweenPipes.length).toBeLessThanOrEqual(12);
350 - const table = createTable(
351 - ["Module", "Status"],
352 - [
353 - ["Agent Core", "✅"],
354 - ["Memory", "45%"],
355 - ["Cache", "OK"],
356 - ],
357 - { padding: 2 },
358 - );
359 - // Both should render without errors
360 - assertTrue(box.length > 0);
361 - assertTrue(table.length > 0);
362 - // Box should use bold chars
363 - assertTrue(box.includes("┏"));
364 - assertTrue(box.includes("┛"));
367 -function assertTrue(cond: boolean, msg?: string) {
368 - if (!cond) throw new Error(msg || "Assertion failed");
158 +describe("createTable", () => {
159 + test("simple table", () => {
160 + const result = createTable(
161 + ["Name", "Age"],
163 + ["Alice", "30"],
164 + ["Bob", "25"],
165 + ],
166 + );
167 + expect(result).toInclude("Name");
168 + expect(result).toInclude("Age");
169 + expect(result).toInclude("Alice");
170 + expect(result).toInclude("Bob");
171 + expect(result).toInclude("┌");
172 + expect(result).toInclude("┐");
173 + expect(result).toInclude("└");
174 + expect(result).toInclude("┘");
175 + });
177 + test("separator line uses tee", () => {
178 + const result = createTable(["H1", "H2"], [["a", "b"]]);
179 + const lines = result.split("\n");
180 + expect(lines[2]).toInclude("├");
181 + expect(lines[2]).toInclude("┤");
182 + expect(lines[2]).toInclude("┼");
183 + });
185 + test("double style", () => {
186 + const result = createTable(["H"], [["d"]], { style: "double" });
187 + expect(result).toInclude("╔");
188 + expect(result).toInclude("╗");
189 + expect(result).toInclude("╠");
190 + expect(result).toInclude("╣");
191 + expect(result).toInclude("║");
192 + expect(result).toInclude("═");
193 + });
195 + test("padding", () => {
196 + const result = createTable(["Name"], [["Alice"]], { padding: 3 });
197 + expect(result).toInclude("│ Name");
198 + expect(result).toInclude("│ Alice");
199 + });
201 + test("empty rows", () => {
202 + const result = createTable(["A", "B"], [], { style: "single" });
203 + expect(result).toInclude("A");
204 + expect(result).toInclude("B");
205 + expect(result).toInclude("├");
206 + expect(result).toInclude("┤");
207 + });
209 + test("single column", () => {
210 + const result = createTable(["Name"], [["Alice"], ["Bob"]]);
211 + expect(result).toInclude("Name");
212 + expect(result).toInclude("Alice");
213 + expect(result).toInclude("Bob");
214 + });
215 +});
217 +describe("drawNested", () => {
218 + test("nested boxes", () => {
219 + const result = drawNested("Outer", "Inner");
220 + expect(result).toInclude("Outer");
221 + expect(result).toInclude("Inner");
222 + expect((result.match(/┌/g) || []).length).toBe(2);
223 + });
225 + test("with gap", () => {
226 + const result = drawNested("O", "I", { gap: 2 });
227 + expect(result).toInclude("O");
228 + expect(result).toInclude("I");
229 + const innerLine = result.split("\n").findIndex((l) => l.includes("I"));
230 + const outerLine = result.split("\n").findIndex((l) => l.includes("O"));
231 + expect(Math.abs(innerLine - outerLine)).toBeGreaterThan(2);
232 + });
234 + test("zero width content", () => {
235 + const result = drawNested("", "", { gap: 0 });
236 + expect(result).toInclude("┌");
237 + expect(result).toInclude("└");
238 + });
240 + test("different styles", () => {
241 + const result = drawNested("O", "I", {
242 + styleOuter: "double",
243 + styleInner: "bold",
244 + gap: 0,
245 + });
246 + expect(result.includes("╔") || result.includes("╗")).toBe(true);
247 + expect(result.includes("┏") || result.includes("┓")).toBe(true);
248 + });
250 + test("gap creates space", () => {
251 + const r1 = drawNested("O", "I", { gap: 0 });
252 + const r2 = drawNested("O", "I", { gap: 2 });
253 + expect(r2.split("\n").length).toBeGreaterThanOrEqual(
254 + r1.split("\n").length + 2,
255 + );
256 + });
257 +});
259 +describe("border styles", () => {
260 + test("are consistent", () => {
261 + const single = drawBox("T", { style: "single" });
262 + const double = drawBox("T", { style: "double" });
263 + const bold = drawBox("T", { style: "bold" });
264 + expect(single.includes("┌") && single.includes("─") && single.includes("│")).toBe(true);
265 + expect(double.includes("╔") && double.includes("═") && double.includes("║")).toBe(true);
266 + expect(bold.includes("┏") && bold.includes("━") && bold.includes("┃")).toBe(true);
267 + expect(single).not.toInclude("╔");
268 + expect(double).not.toInclude("┌");
269 + });
270 +});
272 +describe("demo - system status panel", () => {
273 + test("renders without errors", () => {
274 + const box = drawBox(" System Status ", {
275 + style: "bold",
276 + width: 30,
277 + alignment: "center",
278 + paddingTop: 1,
279 + paddingBottom: 1,
280 + });
281 + const table = createTable(
282 + ["Module", "Status"],
284 + ["Agent Core", "✅"],
285 + ["Memory", "45%"],
286 + ["Cache", "OK"],
287 + ],
288 + { padding: 2 },
289 + );
290 + expect(box.length).toBeGreaterThan(0);
291 + expect(table.length).toBeGreaterThan(0);
292 + expect(box).toInclude("┏");
293 + expect(box).toInclude("┛");
294 + });
295 +});

skills/ascii-boxes/index.ts

Modified
1 -#!/usr/bin/env -S deno run -A
2 1 /** ASCII Box Drawing - Minimal, dependency-free implementation */
4 3 const SPACES = " ".repeat(128);
261 260 // ── CLI ─────────────────────────
263 262 if (import.meta.main) {
264 - const args = Deno.args;
263 + const args = process.argv.slice(2);
265 264 const cmd = args[0];
350 349 } catch (e) {
351 350 console.error("Error:", e instanceof Error ? e.message : e);
352 - Deno.exit(1);
351 + process.exit(1);