From 4de8c362911d5a1d60ac0f6b993bd08a4913caab Mon Sep 17 00:00:00 2001 From: Tau Date: Tue, 9 Apr 2019 10:19:09 -0400 Subject: [PATCH] deal with insane JavaScript bullshit --- src/idz/world/_singleton.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/idz/world/_singleton.ts b/src/idz/world/_singleton.ts index b1724c5..89b93e5 100644 --- a/src/idz/world/_singleton.ts +++ b/src/idz/world/_singleton.ts @@ -66,8 +66,8 @@ export class SingletonTextRepo } const text = await readFile(this._path, { encoding: "utf8" }); - const lines = text.split("\n"); - const codes = lines.map(parseInt); + const lines = text.split("\n").filter(x => x !== ""); + const codes = lines.map(x => parseInt(x)); // .map(parseInt) yields NaNs?? return codes as T; }