Comparing version 1.9.0 to 1.9.1
@@ -58,3 +58,3 @@ "use strict"; | ||
while (this._recordsRead !== this.recordCount) { | ||
yield* await this.readRecords(1000); | ||
yield* await this.readRecords(100); | ||
} | ||
@@ -363,2 +363,3 @@ } | ||
value = ''; | ||
let mergedBuffer = Buffer.from([]); | ||
// Read the memo data from the memo file. We use a while loop here to read one block-sized | ||
@@ -383,5 +384,7 @@ // chunk at a time, since memo values can be larger than the block size. | ||
let eos = memoBuf.indexOf('\x1A'); | ||
value += iconv.decode(memoBuf.slice(0, eos === -1 ? memoBlockSize : eos), encoding); | ||
if (eos !== -1) | ||
mergedBuffer = Buffer.concat([mergedBuffer, memoBuf.slice(0, eos === -1 ? memoBlockSize : eos)]); | ||
if (eos !== -1) { | ||
value = iconv.decode(mergedBuffer, encoding); | ||
break; // break out of the loop once we've found the terminator. | ||
} | ||
} | ||
@@ -401,6 +404,8 @@ // Handle first/next block of dBase IV memo data. | ||
let take = Math.min(len, memoBlockSize - skip); | ||
value += iconv.decode(memoBuf.slice(skip, skip + take), encoding); | ||
mergedBuffer = Buffer.concat([mergedBuffer, memoBuf.slice(skip, skip + take)]); | ||
len -= take; | ||
if (len === 0) | ||
if (len === 0) { | ||
value = iconv.decode(mergedBuffer, encoding); | ||
break; | ||
} | ||
} | ||
@@ -419,3 +424,3 @@ // Handle first/next block of FoxPro9 memo data. | ||
let skip = 0; | ||
if (value === '') { | ||
if (!mergedBuffer.length) { | ||
const memoType = memoBuf.readInt32BE(0); | ||
@@ -429,6 +434,8 @@ if (memoType != 1) | ||
let take = Math.min(len, memoBlockSize - skip); | ||
value += iconv.decode(memoBuf.slice(skip, skip + take), encoding); | ||
mergedBuffer = Buffer.concat([mergedBuffer, memoBuf.slice(skip, skip + take)]); | ||
len -= take; | ||
if (len === 0) | ||
if (len === 0) { | ||
value = iconv.decode(mergedBuffer, encoding); | ||
break; | ||
} | ||
} | ||
@@ -435,0 +442,0 @@ else { |
{ | ||
"name": "dbffile", | ||
"version": "1.9.0", | ||
"version": "1.9.1", | ||
"description": "Read and write .dbf (dBase III & Visual FoxPro) files in Node.js", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
186310
943