Skip to content

Commit

Permalink
Fix bug with detecting escaped quote
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed Feb 25, 2019
1 parent 9f48ff7 commit d6cfe05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -180,7 +180,7 @@ function stream() {
for (let i = 0; i < chunk.length; i++) {
if (isString) {
if (chunk[i] === '"') {
if ((i > 1 && chunk[i - 1] !== '\\') || buff[buff.length] !== '\\') {
if ((i === 0 && buff[len - 1] !== '\\') || (i > 0 && chunk[i - 1] !== '\\')) {
isString = false
check(i)
}
Expand Down

0 comments on commit d6cfe05

Please sign in to comment.