Skip to content

Commit

Permalink
Merge pull request #5 from nodecraft/fix/add-char
Browse files Browse the repository at this point in the history
  • Loading branch information
Cherry authored Nov 27, 2024
2 parents 10d5762 + b3efe16 commit 7b0ee5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ini.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ const unsafe = (val) => {
if(val.charAt(i - 1) === ' ' && val.charAt(i + 1) === ' '){
break;
}
escapedVal += char;
}else if(char === '\\'){
isEscaping = true;
}else{
Expand Down
2 changes: 1 addition & 1 deletion test/foo.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ test('ignores invalid line (=)', function(t){

test("unsafe escape values", function(t){
t.equal(ini.unsafe(''), '');
t.equal(ini.unsafe('x;y'), 'xy');
t.equal(ini.unsafe('x;y'), 'x;y');
t.equal(ini.unsafe('x # y'), 'x');
t.equal(ini.unsafe('x "\\'), 'x "\\');
t.end();
Expand Down

0 comments on commit 7b0ee5d

Please sign in to comment.