diff options
author | Elizabeth (Lizzy) Hunt <elizabeth.hunt@simponic.xyz> | 2023-12-02 11:56:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-02 11:56:04 -0700 |
commit | e84a341243a20268a2daacc4bcb7aadde8e1f8fd (patch) | |
tree | ac4894288ef6b3fe98411f44062af6c0fb7ed431 | |
parent | 684c10937a811a51320a9c3a653b8a183e07d959 (diff) | |
download | aoc-e84a341243a20268a2daacc4bcb7aadde8e1f8fd.tar.gz aoc-e84a341243a20268a2daacc4bcb7aadde8e1f8fd.zip |
filter bad strings from file
-rw-r--r-- | template/part_1.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/template/part_1.ts b/template/part_1.ts index ab01f78..75e5755 100644 --- a/template/part_1.ts +++ b/template/part_1.ts @@ -13,7 +13,7 @@ const isrun = process.argv.length > 1 && process.argv[1] === import.meta.path; if (isrun) { const file = Bun.file("./problem.txt"); const text = await file.text(); - const lines = text.split("\n"); + const lines = text.split("\n").filter((x) => x && x.length); console.log("=== COMPUTATION ===\n"); |