Socket
Socket
Sign inDemoInstall

fetch-blob

Package Overview
Dependencies
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-blob - npm Package Compare versions

Comparing version 3.1.1 to 3.1.2

5

CHANGELOG.md
Changelog
=========
## v3.1.2
- Improved typing
- Fixed a bug where position in iterator did not increase
## v3.1.0

@@ -5,0 +10,0 @@ - started to use real whatwg streams

16

file.d.ts

@@ -1,14 +0,2 @@

export default class File extends Blob {
/**
* @param {*[]} fileBits
* @param {string} fileName
* @param {{lastModified?: number, type?: string}} options
*/ constructor(fileBits: any[], fileName: string, options?: {
lastModified?: number;
type?: string;
}, ...args: any[]);
get name(): string;
get lastModified(): number;
#private;
}
import Blob from "./index.js";
/** @type {typeof globalThis.File} */ export const File: typeof globalThis.File;
export default File;
import Blob from './index.js';
export default class File extends Blob {
const _File = class File extends Blob {
#lastModified = 0;

@@ -11,3 +11,3 @@ #name = '';

* @param {{lastModified?: number, type?: string}} options
*/ // @ts-ignore
*/// @ts-ignore
constructor(fileBits, fileName, options = {}) {

@@ -37,2 +37,4 @@ if (arguments.length < 2) {

export { File };
/** @type {typeof globalThis.File} */// @ts-ignore
export const File = _File;
export default File;
import {statSync, createReadStream, promises as fs} from 'fs';
import {basename} from 'path';
import {MessageChannel} from 'worker_threads';
import File from './file.js';
import Blob from './index.js';
import {MessageChannel} from 'worker_threads';

@@ -40,2 +41,3 @@ const {stat} = fs;

// @ts-ignore
const fromBlob = (stat, path, type = '') => new Blob([new BlobDataItem({

@@ -48,2 +50,3 @@ path,

// @ts-ignore
const fromFile = (stat, path, type = '') => new File([new BlobDataItem({

@@ -50,0 +53,0 @@ path,

@@ -1,53 +0,4 @@

export default class Blob {
static [Symbol.hasInstance](object: any): boolean;
/**
* The Blob() constructor returns a new Blob object. The content
* of the blob consists of the concatenation of the values given
* in the parameter array.
*
* @param {*} blobParts
* @param {{ type?: string }} [options]
*/
constructor(blobParts?: any, options?: {
type?: string;
});
/**
* The Blob interface's size property returns the
* size of the Blob in bytes.
*/
get size(): number;
/**
* The type property of a Blob object returns the MIME type of the file.
*/
get type(): string;
/**
* The text() method in the Blob interface returns a Promise
* that resolves with a string containing the contents of
* the blob, interpreted as UTF-8.
*
* @return {Promise<string>}
*/
text(): Promise<string>;
/**
* The arrayBuffer() method in the Blob interface returns a
* Promise that resolves with the contents of the blob as
* binary data contained in an ArrayBuffer.
*
* @return {Promise<ArrayBuffer>}
*/
arrayBuffer(): Promise<ArrayBuffer>;
stream(): ReadableStream<Uint8Array>;
/**
* The Blob interface's slice() method creates and returns a
* new Blob object which contains data from a subset of the
* blob on which it's called.
*
* @param {number} [start]
* @param {number} [end]
* @param {string} [type]
*/
slice(start?: number, end?: number, type?: string): Blob;
get [Symbol.toStringTag](): string;
#private;
}
/** @type {typeof globalThis.Blob} */
export const Blob: typeof globalThis.Blob;
export default Blob;
/**

@@ -54,0 +5,0 @@ * }

// TODO (jimmywarting): in the feature use conditional loading with top level await (requires 14.x)
// Node has recently added whatwg stream into core, want to use that instead when it becomes available.
// Node has recently added whatwg stream into core

@@ -24,4 +24,4 @@ import './streams.cjs';

const chunk = part.buffer.slice(position, position + size);
position += chunk.byteLength;
yield new Uint8Array(chunk);
position += chunk.byteLength;
}

@@ -46,3 +46,3 @@ } else {

export default class Blob {
const _Blob = class Blob {

@@ -74,3 +74,3 @@ /** @type {Array.<(Blob|Uint8Array)>} */

} else {
part = new TextEncoder().encode(String(element));
part = new TextEncoder().encode(element);
}

@@ -230,3 +230,3 @@

Object.defineProperties(Blob.prototype, {
Object.defineProperties(_Blob.prototype, {
size: {enumerable: true},

@@ -237,2 +237,4 @@ type: {enumerable: true},

export { Blob };
/** @type {typeof globalThis.Blob} */
export const Blob = _Blob;
export default Blob;
{
"name": "fetch-blob",
"version": "3.1.1",
"version": "3.1.2",
"description": "Blob & File implementation in Node.js, originally from node-fetch.",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc