Skip to content

Commit

Permalink
Only use trimmedLine in relation to empty or comment line. Regular li…
Browse files Browse the repository at this point in the history
…nes should stay honest
  • Loading branch information
motdotla committed Jan 16, 2022
1 parent 02c581d commit a364bbf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ function parse (src, options) {

// convert Buffers before splitting into lines and processing
src.toString().split(NEWLINES_MATCH).forEach(function (line, idx) {
line = line.trim()
const trimmedLine = line.trim()

// ignore empty and commented lines
if (line === '' || line[0] === '#') {
if (trimmedLine === '' || trimmedLine[0] === '#') {
return
}

// matching "KEY' and 'VAL' in 'KEY=VAL'
const keyValueArr = line.match(RE_INI_KEY_VAL)
// matched?
Expand Down

0 comments on commit a364bbf

Please sign in to comment.