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

@erebos/api-bzz-browser

Package Overview
Dependencies
Maintainers
6
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@erebos/api-bzz-browser - npm Package Compare versions

Comparing version 0.11.0 to 0.12.0

22

cjs/index.js

@@ -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>;
}
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