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

balena-request

Package Overview
Dependencies
Maintainers
1
Versions
177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

balena-request - npm Package Compare versions

Comparing version 12.0.3 to 12.0.4-build-refactor-reduce-bb3ebd421cff85803bc80ead121b83e8ed103499-1

25

build/request.js

@@ -98,24 +98,21 @@ "use strict";

const interceptRequestOrError = (initialPromise) => tslib_1.__awaiter(this, void 0, void 0, function* () {
return exports.interceptors.reduce(function (promise, { request, requestError }) {
let promise = initialPromise;
for (const { request, requestError } of exports.interceptors) {
if (request != null || requestError != null) {
return promise.then(request, requestError);
promise = promise.then(request, requestError);
}
else {
return promise;
}
}, initialPromise);
}
return promise;
});
const interceptResponseOrError = function (initialPromise) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
return exports.interceptors
let promise = initialPromise;
for (const { response, responseError } of exports.interceptors
.slice()
.reverse()
.reduce(function (promise, { response, responseError }) {
.reverse()) {
if (response != null || responseError != null) {
return promise.then(response, responseError);
promise = promise.then(response, responseError);
}
else {
return promise;
}
}, initialPromise);
}
return promise;
});

@@ -122,0 +119,0 @@ };

@@ -7,2 +7,6 @@ # Change Log

## 12.0.4 - 2023-08-23
* Refactor the interceptors to stop using .reduce() [Thodoris Greasidis]
## 12.0.3 - 2023-08-09

@@ -9,0 +13,0 @@

@@ -192,10 +192,11 @@ /*

const interceptRequestOrError = async (initialPromise: Promise<any>) =>
exports.interceptors.reduce(function (promise, { request, requestError }) {
const interceptRequestOrError = async (initialPromise: Promise<any>) => {
let promise = initialPromise;
for (const { request, requestError } of exports.interceptors) {
if (request != null || requestError != null) {
return promise.then(request, requestError);
} else {
return promise;
promise = promise.then(request, requestError);
}
}, initialPromise);
}
return promise;
};

@@ -205,12 +206,11 @@ const interceptResponseOrError = async function (

) {
return exports.interceptors
let promise = initialPromise;
for (const { response, responseError } of exports.interceptors
.slice()
.reverse()
.reduce(function (promise, { response, responseError }) {
if (response != null || responseError != null) {
return promise.then(response, responseError);
} else {
return promise;
}
}, initialPromise);
.reverse()) {
if (response != null || responseError != null) {
promise = promise.then(response, responseError);
}
}
return promise;
};

@@ -217,0 +217,0 @@

{
"name": "balena-request",
"version": "12.0.3",
"version": "12.0.4-build-refactor-reduce-bb3ebd421cff85803bc80ead121b83e8ed103499-1",
"description": "Balena HTTP client",

@@ -83,4 +83,4 @@ "main": "build/request.js",

"versionist": {
"publishedAt": "2023-08-09T12:12:01.537Z"
"publishedAt": "2023-08-23T07:58:50.434Z"
}
}

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