first commit

This commit is contained in:
2026-04-11 16:59:16 +02:00
commit db373625f5
646 changed files with 576140 additions and 0 deletions

8
src/main.ts Normal file
View File

@@ -0,0 +1,8 @@
import { startREPL } from "./repl.js"
function main() {
startREPL();
}
main();

21
src/repl.test.ts Normal file
View File

@@ -0,0 +1,21 @@
import { cleanInput } from "./repl.ts";
import { describe, expect, test } from "vitest";
describe.each([
{
input: " hello world ",
expected: ["hello", "world"],
},
{
input: " This is a Test ",
expected: ["this", "is", "a", "test"],
}
])("cleanInput($input)", ({ input, expected }) => {
test(`Expected: ${expected}`, () => {
const actual = cleanInput(input);
expect(actual).toHaveLength(expected.length);
for (const i in expected) {
expect(actual[i]).toBe(expected[i]);
}
});
});

4
src/repl.ts Normal file
View File

@@ -0,0 +1,4 @@
export function cleanInput(input: string): string[] {
const lowercaseString = input.toLowerCase();
return lowercaseString.trim().split(" ");
}