balena-request
Advanced tools
Comparing version 10.0.8 to 10.0.9-lodash-to-native-56e6a5ecdb8ed317ba8bdce5731be194acae581e
@@ -18,6 +18,4 @@ // Generated by CoffeeScript 1.12.7 | ||
*/ | ||
var getProgressStream, noop, progress, stream, utils, webStreams, zlib; | ||
var getProgressStream, progress, stream, utils, webStreams, zlib; | ||
noop = require('lodash/noop'); | ||
webStreams = require('@balena/node-web-streams'); | ||
@@ -57,5 +55,2 @@ | ||
var progressStream; | ||
if (onState == null) { | ||
onState = noop; | ||
} | ||
progressStream = progress({ | ||
@@ -67,5 +62,5 @@ time: 500, | ||
if (state.length === 0) { | ||
return onState(void 0); | ||
return typeof onState === "function" ? onState(void 0) : void 0; | ||
} | ||
return onState({ | ||
return typeof onState === "function" ? onState({ | ||
total: state.length, | ||
@@ -75,3 +70,3 @@ received: state.transferred, | ||
percentage: state.percentage | ||
}); | ||
}) : void 0; | ||
}); | ||
@@ -78,0 +73,0 @@ return progressStream; |
@@ -22,3 +22,3 @@ // Generated by CoffeeScript 1.12.7 | ||
*/ | ||
var Promise, assign, defaults, errors, fetchReadableStream, getRequest, isEmpty, noop, progress, rindle, urlLib, utils; | ||
var Promise, errors, fetchReadableStream, getRequest, progress, rindle, urlLib, utils; | ||
@@ -29,10 +29,2 @@ Promise = require('bluebird'); | ||
assign = require('lodash/assign'); | ||
noop = require('lodash/noop'); | ||
defaults = require('lodash/defaults'); | ||
isEmpty = require('lodash/isEmpty'); | ||
rindle = require('rindle'); | ||
@@ -53,3 +45,3 @@ | ||
requestBrowserStream = utils.getRequestAsync(fetchReadableStream); | ||
debugRequest = !debug ? noop : utils.debugRequest; | ||
debugRequest = !debug ? function() {} : utils.debugRequest; | ||
exports = {}; | ||
@@ -61,3 +53,3 @@ prepareOptions = function(options) { | ||
} | ||
defaults(options, { | ||
options = Object.assign({ | ||
method: 'GET', | ||
@@ -70,3 +62,3 @@ json: true, | ||
retries: retries | ||
}); | ||
}, options); | ||
baseUrl = options.baseUrl; | ||
@@ -98,3 +90,3 @@ if (options.uri) { | ||
} | ||
if (!isEmpty(options.apiKey)) { | ||
if (typeof options.apiKey === 'string' && options.apiKey.length > 0) { | ||
options.url += urlLib.parse(options.url).query != null ? '&' : '?'; | ||
@@ -197,3 +189,3 @@ options.url += "apikey=" + options.apiKey; | ||
var responseError; | ||
response = assign({}, response, { | ||
response = Object.assign({}, response, { | ||
body: body | ||
@@ -200,0 +192,0 @@ }); |
@@ -18,3 +18,3 @@ // Generated by CoffeeScript 1.12.7 | ||
*/ | ||
var HeadersPonyfill, IS_BROWSER, Promise, UNSUPPORTED_REQUEST_PARAMS, assign, errors, handleAbortIfNotSupported, includes, normalFetch, processRequestOptions, qs, ref, requestAsync, urlLib; | ||
var HeadersPonyfill, IS_BROWSER, Promise, UNSUPPORTED_REQUEST_PARAMS, errors, handleAbortIfNotSupported, normalFetch, processRequestOptions, qs, ref, requestAsync, urlLib; | ||
@@ -31,6 +31,2 @@ Promise = require('bluebird'); | ||
assign = require('lodash/assign'); | ||
includes = require('lodash/includes'); | ||
errors = require('balena-errors'); | ||
@@ -222,3 +218,3 @@ | ||
exports.debugRequest = function(options, response) { | ||
return console.error(assign({ | ||
return console.error(Object.assign({ | ||
statusCode: response.statusCode, | ||
@@ -301,3 +297,3 @@ duration: response.duration | ||
contentType = response.headers.get('Content-Type'); | ||
if (responseFormat === 'blob' || ((responseFormat == null) && includes(contentType, 'binary/octet-stream'))) { | ||
if (responseFormat === 'blob' || ((responseFormat == null) && (contentType != null ? contentType.includes('binary/octet-stream') : void 0))) { | ||
if (typeof response.blob === 'function') { | ||
@@ -311,3 +307,3 @@ return response.blob(); | ||
} | ||
if (responseFormat === 'json' || ((responseFormat == null) && includes(contentType, 'application/json'))) { | ||
if (responseFormat === 'json' || ((responseFormat == null) && (contentType != null ? contentType.includes('application/json') : void 0))) { | ||
return response.json(); | ||
@@ -314,0 +310,0 @@ } |
@@ -7,2 +7,11 @@ # Change Log | ||
# v10.0.9 | ||
## (2020-04-20) | ||
* Use native check in favour of isEmpty [Pagan Gazzard] | ||
* Use Object.assign to emulate lodash/defaults [Pagan Gazzard] | ||
* Switch to native includes [Pagan Gazzard] | ||
* Remove lodash noop usage [Pagan Gazzard] | ||
* Switch to native Object.assign [Pagan Gazzard] | ||
## 10.0.8 - 2020-03-02 | ||
@@ -9,0 +18,0 @@ |
{ | ||
"name": "balena-request", | ||
"version": "10.0.8", | ||
"version": "10.0.9-lodash-to-native-56e6a5ecdb8ed317ba8bdce5731be194acae581e", | ||
"description": "Balena HTTP client", | ||
@@ -59,3 +59,2 @@ "main": "build/request.js", | ||
"fetch-readablestream": "^0.2.0", | ||
"lodash": "^4.17.15", | ||
"progress-stream": "^2.0.0", | ||
@@ -62,0 +61,0 @@ "qs": "^6.9.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9
139701
949
1
- Removedlodash@^4.17.15
- Removedlodash@4.17.21(transitive)