From 1a27602a3377070d6a3e32141a2cfbc9d6572853 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 11 Apr 2023 14:41:13 -0700 Subject: [PATCH] fix: ignore all whitespace lines A line with only whitespace produces `'':true` --- lib/ini.js | 2 +- test/fixtures/foo.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ini.js b/lib/ini.js index d05682b..f0fafee 100644 --- a/lib/ini.js +++ b/lib/ini.js @@ -72,7 +72,7 @@ const decode = str => { const lines = str.split(/[\r\n]+/g) for (const line of lines) { - if (!line || line.match(/^\s*[;#]/)) { + if (!line || line.match(/^\s*[;#]/) || line.match(/^\s*$/)) { continue } const match = line.match(re) diff --git a/test/fixtures/foo.ini b/test/fixtures/foo.ini index 22b72b6..4aee69c 100644 --- a/test/fixtures/foo.ini +++ b/test/fixtures/foo.ini @@ -10,7 +10,7 @@ o = p ; Test single quotes s = 'something' - + ; Test mixing quotes s1 = "something'