@erebos/api-bzz-browser
Advanced tools
Comparing version 0.11.0 to 0.12.0
@@ -38,3 +38,4 @@ "use strict"; | ||
cfg = (0, _objectWithoutPropertiesLoose2.default)(config, ["url"]); | ||
return _BaseBzz.call(this, window.fetch.bind(window), (0, _extends2.default)({}, cfg, { | ||
var fetch = typeof window !== 'undefined' ? window.fetch.bind(window) : self.fetch.bind(self); | ||
return _BaseBzz.call(this, fetch, (0, _extends2.default)({}, cfg, { | ||
url: new URL(url).href | ||
@@ -51,4 +52,3 @@ })) || this; | ||
_proto.uploadBody = function uploadBody(body, options, raw) { | ||
var _this = this; | ||
var data; | ||
return _regenerator.default.async(function uploadBody$(_context) { | ||
@@ -70,3 +70,4 @@ while (1) { | ||
case 3: | ||
return _context.abrupt("return", new Promise(function (resolve) { | ||
_context.next = 5; | ||
return _regenerator.default.awrap(new Promise(function (resolve) { | ||
var buffers = []; | ||
@@ -77,10 +78,15 @@ body.on('data', function (d) { | ||
body.on('end', function () { | ||
// @ts-ignore | ||
resolve(Buffer.concat(buffers)); | ||
}); | ||
}).then(function (data) { | ||
return _BaseBzz.prototype.uploadBody.call(_this, data, options, raw); | ||
})); | ||
case 4: | ||
case 5: | ||
data = _context.sent; | ||
_context.next = 8; | ||
return _regenerator.default.awrap(_BaseBzz.prototype.uploadBody.call(this, data, options, raw)); | ||
case 8: | ||
return _context.abrupt("return", _context.sent); | ||
case 9: | ||
case "end": | ||
@@ -87,0 +93,0 @@ return _context.stop(); |
@@ -19,3 +19,4 @@ import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
return _BaseBzz.call(this, window.fetch.bind(window), _extends({}, cfg, { | ||
var fetch = typeof window !== 'undefined' ? window.fetch.bind(window) : self.fetch.bind(self); | ||
return _BaseBzz.call(this, fetch, _extends({}, cfg, { | ||
url: new URL(url).href | ||
@@ -32,4 +33,3 @@ })) || this; | ||
_proto.uploadBody = function uploadBody(body, options, raw) { | ||
var _this = this; | ||
var data; | ||
return _regeneratorRuntime.async(function uploadBody$(_context) { | ||
@@ -51,3 +51,4 @@ while (1) { | ||
case 3: | ||
return _context.abrupt("return", new Promise(function (resolve) { | ||
_context.next = 5; | ||
return _regeneratorRuntime.awrap(new Promise(function (resolve) { | ||
var buffers = []; | ||
@@ -58,10 +59,15 @@ body.on('data', function (d) { | ||
body.on('end', function () { | ||
// @ts-ignore | ||
resolve(Buffer.concat(buffers)); | ||
}); | ||
}).then(function (data) { | ||
return _BaseBzz.prototype.uploadBody.call(_this, data, options, raw); | ||
})); | ||
case 4: | ||
case 5: | ||
data = _context.sent; | ||
_context.next = 8; | ||
return _regeneratorRuntime.awrap(_BaseBzz.prototype.uploadBody.call(this, data, options, raw)); | ||
case 8: | ||
return _context.abrupt("return", _context.sent); | ||
case 9: | ||
case "end": | ||
@@ -68,0 +74,0 @@ return _context.stop(); |
{ | ||
"name": "@erebos/api-bzz-browser", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "Bzz API for browser", | ||
@@ -27,4 +27,4 @@ "repository": "git@github.com:MainframeHQ/erebos.git", | ||
"dependencies": { | ||
"@babel/runtime": "^7.6.2", | ||
"@erebos/api-bzz-base": "^0.11.0", | ||
"@babel/runtime": "^7.7.6", | ||
"@erebos/api-bzz-base": "^0.12.0", | ||
"readable-stream": "^3.4.0" | ||
@@ -31,0 +31,0 @@ }, |
/// <reference types="node" /> | ||
import { BaseBzz, BzzConfig, DirectoryData, UploadOptions } from '@erebos/api-bzz-base'; | ||
import { hexValue } from '@erebos/hex'; | ||
import { Readable } from 'readable-stream'; | ||
@@ -9,4 +8,4 @@ export * from '@erebos/api-bzz-base'; | ||
protected normalizeStream(stream: ReadableStream): Readable; | ||
protected uploadBody(body: Buffer | FormData | Readable, options: UploadOptions, raw?: boolean): Promise<hexValue>; | ||
uploadDirectory(directory: DirectoryData, options?: UploadOptions): Promise<hexValue>; | ||
protected uploadBody(body: Buffer | FormData | Readable, options: UploadOptions, raw?: boolean): Promise<string>; | ||
uploadDirectory(directory: DirectoryData, options?: UploadOptions): Promise<string>; | ||
} |
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
Network access
Supply chain riskThis module accesses the network.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
15528
383
2
+ Added@erebos/api-bzz-base@0.12.0(transitive)
+ Added@erebos/hex@0.12.0(transitive)
- Removed@erebos/api-bzz-base@0.11.0(transitive)
Updated@babel/runtime@^7.7.6
Updated@erebos/api-bzz-base@^0.12.0