fetch-blob
Advanced tools
Comparing version 3.1.5 to 3.2.0
10
from.js
@@ -68,5 +68,2 @@ import { statSync, createReadStream, promises as fs } from 'node:fs' | ||
this.lastModified = options.lastModified | ||
this.originalSize = options.originalSize === undefined | ||
? options.size | ||
: options.originalSize | ||
} | ||
@@ -82,3 +79,2 @@ | ||
lastModified: this.lastModified, | ||
originalSize: this.originalSize, | ||
size: end - start, | ||
@@ -90,8 +86,6 @@ start: this.#start + start | ||
async * stream () { | ||
const { mtimeMs, size } = await stat(this.#path) | ||
if (mtimeMs > this.lastModified || this.originalSize !== size) { | ||
const { mtimeMs } = await stat(this.#path) | ||
if (mtimeMs > this.lastModified) { | ||
throw new DOMException('The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.', 'NotReadableError') | ||
} | ||
yield * createReadStream(this.#path, { | ||
@@ -98,0 +92,0 @@ start: this.#start, |
@@ -86,8 +86,4 @@ /*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */ | ||
const size = ArrayBuffer.isView(part) ? part.byteLength : part.size | ||
// Avoid pushing empty parts into the array to better GC them | ||
if (size) { | ||
this.#size += size | ||
this.#parts.push(part) | ||
} | ||
this.#size += ArrayBuffer.isView(part) ? part.byteLength : part.size | ||
this.#parts.push(part) | ||
} | ||
@@ -94,0 +90,0 @@ |
{ | ||
"name": "fetch-blob", | ||
"version": "3.1.5", | ||
"version": "3.2.0", | ||
"description": "Blob & File implementation in Node.js, originally from node-fetch.", | ||
@@ -5,0 +5,0 @@ "main": "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
21755
421