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 11.0.4 to 11.1.0-lazy-loading-45042aca602e44a8e4eefdf0fb57ab188530a48e

12

build/progress.js

@@ -20,6 +20,2 @@ "use strict";

const tslib_1 = require("tslib");
const webStreams = require("@balena/node-web-streams");
const progress = require("progress-stream");
const zlib = require("zlib");
const stream = require("stream");
const utils = require("./utils");

@@ -45,2 +41,3 @@ /**

const getProgressStream = function (total, onState) {
const progress = require('progress-stream');
const progressStream = progress({

@@ -100,3 +97,3 @@ time: 500,

const response = yield requestAsync(options);
let responseStream;
const stream = require('stream');
const output = new stream.PassThrough();

@@ -107,3 +104,5 @@ // @ts-expect-error

const total = responseLength.uncompressed || responseLength.compressed;
let responseStream;
if (response.body.getReader) {
const webStreams = require('@balena/node-web-streams');
// Convert browser (WHATWG) streams to Node streams

@@ -118,3 +117,4 @@ responseStream = webStreams.toNodeReadable(response.body);

if (!isBrowser && utils.isResponseCompressed(response)) {
const gunzip = zlib.createGunzip();
const { createGunzip } = require('zlib');
const gunzip = createGunzip();
// Uncompress after or before piping through progress

@@ -121,0 +121,0 @@ // depending on the response length available to us

@@ -24,6 +24,4 @@ "use strict";

const urlLib = require("url");
const fetchReadableStream = require("fetch-readablestream");
const errors = require("balena-errors");
const utils = require("./utils");
const progress = require("./progress");
/**

@@ -39,3 +37,5 @@ * @param {object} options

const requestAsync = utils.getRequestAsync();
const requestBrowserStream = utils.getRequestAsync(fetchReadableStream);
const requestStream = isBrowser
? utils.getRequestAsync(require('fetch-readablestream'))
: requestAsync;
const debugRequest = !debug

@@ -232,3 +232,3 @@ ? function () {

exports.stream = function (options) {
const requestStream = isBrowser ? requestBrowserStream : requestAsync;
const progress = require('./progress');
return prepareOptions(options)

@@ -235,0 +235,0 @@ .then(interceptRequestOptions, interceptRequestError)

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

# v11.1.0
## (2020-07-16)
* Add lazy loading for most modules [Pagan Gazzard]
# v11.0.4

@@ -9,0 +14,0 @@ ## (2020-07-14)

@@ -17,7 +17,2 @@ /*

import * as webStreams from '@balena/node-web-streams';
import * as progress from 'progress-stream';
import * as zlib from 'zlib';
import * as stream from 'stream';
import * as utils from './utils';

@@ -45,2 +40,3 @@

const getProgressStream = function (total, onState) {
const progress = require('progress-stream');
const progressStream = progress({

@@ -112,3 +108,3 @@ time: 500,

let responseStream;
const stream = require('stream');
const output = new stream.PassThrough();

@@ -121,3 +117,5 @@ // @ts-expect-error

let responseStream;
if (response.body.getReader) {
const webStreams = require('@balena/node-web-streams');
// Convert browser (WHATWG) streams to Node streams

@@ -135,3 +133,4 @@ responseStream = webStreams.toNodeReadable(response.body);

if (!isBrowser && utils.isResponseCompressed(response)) {
const gunzip = zlib.createGunzip();
const { createGunzip } = require('zlib');
const gunzip = createGunzip();

@@ -138,0 +137,0 @@ // Uncompress after or before piping through progress

@@ -22,6 +22,4 @@ /*

import * as urlLib from 'url';
import * as fetchReadableStream from 'fetch-readablestream';
import * as errors from 'balena-errors';
import * as utils from './utils';
import * as progress from './progress';

@@ -44,3 +42,5 @@ /**

const requestAsync = utils.getRequestAsync();
const requestBrowserStream = utils.getRequestAsync(fetchReadableStream);
const requestStream = isBrowser
? utils.getRequestAsync(require('fetch-readablestream'))
: requestAsync;

@@ -266,4 +266,3 @@ const debugRequest = !debug

exports.stream = function (options) {
const requestStream = isBrowser ? requestBrowserStream : requestAsync;
const progress = require('./progress');
return prepareOptions(options)

@@ -270,0 +269,0 @@ .then(interceptRequestOptions, interceptRequestError)

{
"name": "balena-request",
"version": "11.0.4",
"version": "11.1.0-lazy-loading-45042aca602e44a8e4eefdf0fb57ab188530a48e",
"description": "Balena HTTP client",

@@ -5,0 +5,0 @@ "main": "build/request.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