Socket
Socket
Sign inDemoInstall

builder-util-runtime

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

builder-util-runtime - npm Package Compare versions

Comparing version 8.2.5 to 8.3.0

143

out/httpExecutor.js

@@ -15,12 +15,2 @@ "use strict";

function _bluebirdLst() {
const data = require("bluebird-lst");
_bluebirdLst = function () {
return data;
};
return data;
}
function _crypto() {

@@ -38,12 +28,4 @@ const data = require("crypto");

function _fsExtraP() {
const data = require("fs-extra-p");
var _fs = require("fs");
_fsExtraP = function () {
return data;
};
return data;
}
function _stream() {

@@ -228,71 +210,66 @@ const data = require("stream");

downloadToBuffer(url, options) {
var _this = this;
async downloadToBuffer(url, options) {
return await options.cancellationToken.createPromise((resolve, reject, onCancel) => {
let result = null;
const requestOptions = {
headers: options.headers || undefined,
// because PrivateGitHubProvider requires HttpExecutor.prepareRedirectUrlOptions logic, so, we need to redirect manually
redirect: "manual"
};
configureRequestUrl(url, requestOptions);
configureRequestOptions(requestOptions);
this.doDownload(requestOptions, {
destination: null,
options,
onCancel,
callback: error => {
if (error == null) {
resolve(result);
} else {
reject(error);
}
},
responseHandler: (response, callback) => {
const contentLength = safeGetHeader(response, "content-length");
let position = -1;
return (0, _bluebirdLst().coroutine)(function* () {
return yield options.cancellationToken.createPromise((resolve, reject, onCancel) => {
let result = null;
const requestOptions = {
headers: options.headers || undefined,
// because PrivateGitHubProvider requires HttpExecutor.prepareRedirectUrlOptions logic, so, we need to redirect manually
redirect: "manual"
};
configureRequestUrl(url, requestOptions);
configureRequestOptions(requestOptions);
if (contentLength != null) {
const size = parseInt(contentLength, 10);
_this.doDownload(requestOptions, {
destination: null,
options,
onCancel,
callback: error => {
if (error == null) {
resolve(result);
} else {
reject(error);
if (size > 0) {
if (size > 5242880) {
callback(new Error("Maximum allowed size is 5 MB"));
return;
}
result = Buffer.alloc(size);
position = 0;
}
},
responseHandler: (response, callback) => {
const contentLength = safeGetHeader(response, "content-length");
let position = -1;
}
if (contentLength != null) {
const size = parseInt(contentLength, 10);
response.on("data", chunk => {
if (position !== -1) {
chunk.copy(result, position);
position += chunk.length;
} else if (result == null) {
result = chunk;
} else {
if (result.length > 5242880) {
callback(new Error("Maximum allowed size is 5 MB"));
return;
}
if (size > 0) {
if (size > 5242880) {
callback(new Error("Maximum allowed size is 5 MB"));
return;
}
result = Buffer.alloc(size);
position = 0;
}
result = Buffer.concat([result, chunk]);
}
response.on("data", chunk => {
if (position !== -1) {
chunk.copy(result, position);
position += chunk.length;
} else if (result == null) {
result = chunk;
} else {
if (result.length > 5242880) {
callback(new Error("Maximum allowed size is 5 MB"));
return;
}
result = Buffer.concat([result, chunk]);
}
});
response.on("end", () => {
if (result != null && position !== -1 && position !== result.length) {
callback(new Error(`Received data length ${position} is not equal to expected ${result.length}`));
} else {
callback(null);
}
});
}
}, 0);
});
})();
});
response.on("end", () => {
if (result != null && position !== -1 && position !== result.length) {
callback(new Error(`Received data length ${position} is not equal to expected ${result.length}`));
} else {
callback(null);
}
});
}
}, 0);
});
}

@@ -483,3 +460,3 @@

const fileOut = (0, _fsExtraP().createWriteStream)(options.destination);
const fileOut = (0, _fs.createWriteStream)(options.destination);
streams.push(fileOut);

@@ -486,0 +463,0 @@ let lastStream = response;

{
"name": "builder-util-runtime",
"version": "8.2.5",
"version": "8.3.0",
"main": "out/index.js",

@@ -14,8 +14,6 @@ "author": "Vladimir Krivosheev",

"engines": {
"node": ">=6.0.0"
"node": ">=8.0.0"
},
"dependencies": {
"debug": "^4.1.1",
"fs-extra-p": "^8.0.2",
"bluebird-lst": "^1.0.9",
"sax": "^1.2.4"

@@ -22,0 +20,0 @@ },

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