From d4f95090ee57e6a478fcdce5a6f88a29eb003bc7 Mon Sep 17 00:00:00 2001 From: Alice Carroll Date: Mon, 30 Sep 2024 15:34:24 +0300 Subject: [PATCH] feat(lax): parse the window index to a number --- lax | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lax b/lax index 0bc9ab1d..540c0219 100755 --- a/lax +++ b/lax @@ -36,9 +36,13 @@ function parse_args(argv) { if (browser == undefined) { browser = safari; } + let index = Number(args[0]); + if (Number.isNaN(index)) { + throw `Invalid window index: ${args[0]}`; + } return { browser, - index: args[0], + index, }; }