Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@smithy/fetch-http-handler

Package Overview
Dependencies
Maintainers
2
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smithy/fetch-http-handler - npm Package Compare versions

Comparing version 2.5.0 to 3.0.0

17

dist-cjs/index.js

@@ -179,16 +179,21 @@ var __defProp = Object.defineProperty;

async function collectStream(stream) {
let res = new Uint8Array(0);
const chunks = [];
const reader = stream.getReader();
let isDone = false;
let length = 0;
while (!isDone) {
const { done, value } = await reader.read();
if (value) {
const prior = res;
res = new Uint8Array(prior.length + value.length);
res.set(prior);
res.set(value, prior.length);
chunks.push(value);
length += value.length;
}
isDone = done;
}
return res;
const collected = new Uint8Array(length);
let offset = 0;
for (const chunk of chunks) {
collected.set(chunk, offset);
offset += chunk.length;
}
return collected;
}

@@ -195,0 +200,0 @@ __name(collectStream, "collectStream");

@@ -14,16 +14,21 @@ import { fromBase64 } from "@smithy/util-base64";

async function collectStream(stream) {
let res = new Uint8Array(0);
const chunks = [];
const reader = stream.getReader();
let isDone = false;
let length = 0;
while (!isDone) {
const { done, value } = await reader.read();
if (value) {
const prior = res;
res = new Uint8Array(prior.length + value.length);
res.set(prior);
res.set(value, prior.length);
chunks.push(value);
length += value.length;
}
isDone = done;
}
return res;
const collected = new Uint8Array(length);
let offset = 0;
for (const chunk of chunks) {
collected.set(chunk, offset);
offset += chunk.length;
}
return collected;
}

@@ -30,0 +35,0 @@ function readToBase64(blob) {

{
"name": "@smithy/fetch-http-handler",
"version": "2.5.0",
"version": "3.0.0",
"description": "Provides a way to make requests",

@@ -16,3 +16,3 @@ "scripts": {

"extract:docs": "api-extractor run --local",
"test": "yarn g:jest --coverage --forceExit && karma start karma.conf.js"
"test": "yarn g:jest --coverage --forceExit && yarn g:karma start karma.conf.js"
},

@@ -28,31 +28,14 @@ "author": {

"dependencies": {
"@smithy/protocol-http": "^3.3.0",
"@smithy/querystring-builder": "^2.2.0",
"@smithy/types": "^2.12.0",
"@smithy/util-base64": "^2.3.0",
"@smithy/protocol-http": "^4.0.0",
"@smithy/querystring-builder": "^3.0.0",
"@smithy/types": "^3.0.0",
"@smithy/util-base64": "^3.0.0",
"tslib": "^2.6.2"
},
"devDependencies": {
"@smithy/abort-controller": "^2.2.0",
"@tsconfig/recommended": "1.0.1",
"@types/chai-as-promised": "^7.1.2",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"@smithy/abort-controller": "^3.0.0",
"concurrently": "7.0.0",
"downlevel-dts": "0.10.1",
"karma": "6.4.0",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "3.1.1",
"karma-coverage": "2.2.1",
"karma-env-preprocessor": "0.1.1",
"karma-firefox-launcher": "2.1.3",
"karma-jasmine": "5.1.0",
"karma-mocha": "2.0.1",
"karma-sourcemap-loader": "0.3.8",
"karma-typescript": "5.5.3",
"karma-webpack": "5.0.0",
"rimraf": "3.0.2",
"typedoc": "0.23.23",
"webpack": "5.76.0",
"webpack-cli": "4.10.0"
"typedoc": "0.23.23"
},

@@ -59,0 +42,0 @@ "typesVersions": {

@@ -5,1 +5,8 @@ # @smithy/fetch-http-handler

[![NPM downloads](https://img.shields.io/npm/dm/@smithy/fetch-http-handler.svg)](https://www.npmjs.com/package/@smithy/fetch-http-handler)
This is the default `requestHandler` used for browser applications.
Since Node.js introduced experimental Web Streams API in v16.5.0 and made it stable in v21.0.0,
you can consider using `fetch-http-handler` in Node.js, although it's not recommended.
For the Node.js default `requestHandler` implementation, see instead
[`@smithy/node-http-handler`](https://www.npmjs.com/package/@smithy/node-http-handler).
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