Comparing version 1.2.1 to 1.2.2
@@ -27,3 +27,2 @@ 'use strict'; | ||
// process line by line | ||
// find next line ending | ||
@@ -42,5 +41,7 @@ let pos = 0; | ||
groupstart--; | ||
groupend--; | ||
pos--; | ||
if (data.value.length > 1 && data.value[data.value.length - 2] === 0x0D) { | ||
groupstart--; | ||
groupend--; | ||
pos--; | ||
@@ -58,2 +59,3 @@ if (groupstart < 0 && !this.line) { | ||
groupstart--; | ||
groupend--; | ||
pos--; | ||
@@ -68,8 +70,9 @@ data.value = data.value.slice(0, data.value.length - 1); | ||
// find next <LF> or in case of very long lines, split at 1024 bytes | ||
if (chunk[i] === 0x0A || (i - pos > 1024 && chunk[i] !== 0x0D)) { | ||
// line end | ||
if (chunk[i] === 0x0A) { // line end | ||
let start = pos; | ||
pos = ++i; | ||
return this.processLine(chunk.slice(start, i), false, data => { | ||
if (!data) { | ||
@@ -83,3 +86,2 @@ return iterateData(); | ||
} else { | ||
if (group.type === 'body' && groupend >= groupstart && group.node.parentNode) { | ||
@@ -89,3 +91,3 @@ // do not include the last line ending for body | ||
groupend--; | ||
if (groupend > groupstart && chunk[groupend - 1] === 0x0D) { | ||
if (groupend >= groupstart && chunk[groupend - 1] === 0x0D) { | ||
groupend--; | ||
@@ -98,3 +100,2 @@ } | ||
// we have a previous data/body chunk to output | ||
if (groupstart !== groupend) { | ||
@@ -137,3 +138,3 @@ group.value = chunk.slice(groupstart, groupend); | ||
pos--; | ||
if (pos > groupstart && chunk[pos - 1] === 0x0D) { | ||
if (pos >= groupstart && chunk[pos - 1] === 0x0D) { | ||
pos--; | ||
@@ -140,0 +141,0 @@ } |
{ | ||
"name": "mailsplit", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Split email messages into an object stream", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
1
30680
9
616