Skip to content

Commit 5089f4e

Browse files
committed
Parse fixed
1 parent ce0f061 commit 5089f4e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/App.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ import GenerateVideo from "./commands/GenerateVideo";
77
import { IEvent } from "./IEvent";
88
import GenerateHtml from "./commands/GenerateHtml";
99

10-
const asNumber = (n) => typeof n === "number" ? n : parseInt(n, 10);
10+
const asNumber = (n) => {
11+
if (n === void 0 || n === null || n === "null") {
12+
return void 0;
13+
}
14+
n = typeof n === "number" ? n : parseInt(n, 10);
15+
return isNaN(n) ? void 0: n;
16+
}
1117

1218
const asBoolean = (n) => typeof n === "boolean" ? n : (typeof n === "string" ? /true|yes/i.test(n) : false);
1319

0 commit comments

Comments
 (0)