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

@dxos/broadcast

Package Overview
Dependencies
Maintainers
12
Versions
735
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dxos/broadcast - npm Package Compare versions

Comparing version 2.33.8 to 2.33.9-dev.62131029

14

dist/src/broadcast.js

@@ -10,4 +10,4 @@ "use strict";

exports.Broadcast = void 0;
const assert_1 = __importDefault(require("assert"));
const debug_1 = __importDefault(require("debug"));
const node_assert_1 = __importDefault(require("node:assert"));
const tiny_lru_1 = __importDefault(require("tiny-lru"));

@@ -31,5 +31,5 @@ const async_1 = require("@dxos/async");

this.subscribeError = new async_1.Event();
(0, assert_1.default)(middleware);
(0, assert_1.default)(middleware.send);
(0, assert_1.default)(middleware.subscribe);
(0, node_assert_1.default)(middleware);
(0, node_assert_1.default)(middleware.send);
(0, node_assert_1.default)(middleware.subscribe);
const { id = (0, crypto_1.randomBytes)(32), maxAge = 10 * 1000, maxSize = 1000 } = options;

@@ -49,4 +49,4 @@ this._id = id;

const { seqno = (0, crypto_1.randomBytes)(32) } = options;
(0, assert_1.default)(Buffer.isBuffer(data));
(0, assert_1.default)(Buffer.isBuffer(seqno));
(0, node_assert_1.default)(Buffer.isBuffer(data));
(0, node_assert_1.default)(Buffer.isBuffer(seqno));
return this._publish({

@@ -62,3 +62,3 @@ seqno,

updatePeers(peers) {
(0, assert_1.default)(peers.every(peer => Buffer.isBuffer(peer.id)), 'Peer ID is expected to be a buffer.');
(0, node_assert_1.default)(peers.every(peer => Buffer.isBuffer(peer.id)), 'Peer ID is expected to be a buffer.');
this._peers = peers;

@@ -65,0 +65,0 @@ }

@@ -0,7 +1,15 @@

/**
* Defined in:
* {@link file://./../../schema.proto}
*/
export interface Packet {
seqno?: Uint8Array;
origin?: Uint8Array;
seqno: Uint8Array;
origin: Uint8Array;
/**
* Options:
* - proto3_optional = true
*/
from?: Uint8Array;
data?: Uint8Array;
data: Uint8Array;
}
//# sourceMappingURL=broadcast.d.ts.map

@@ -5,4 +5,4 @@ "use strict";

const codec_protobuf_1 = require("@dxos/codec-protobuf");
exports.schemaJson = JSON.parse("{\"nested\":{\"dxos\":{\"nested\":{\"broadcast\":{\"nested\":{\"Packet\":{\"fields\":{\"seqno\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"origin\":{\"type\":\"bytes\",\"id\":2,\"comment\":null},\"from\":{\"type\":\"bytes\",\"id\":3,\"comment\":null},\"data\":{\"type\":\"bytes\",\"id\":4,\"comment\":null}},\"comment\":null}}}}}}}");
exports.schemaJson = JSON.parse("{\"nested\":{\"dxos\":{\"nested\":{\"broadcast\":{\"nested\":{\"Packet\":{\"oneofs\":{\"_from\":{\"oneof\":[\"from\"]}},\"fields\":{\"seqno\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"origin\":{\"type\":\"bytes\",\"id\":2,\"comment\":null},\"from\":{\"type\":\"bytes\",\"id\":3,\"options\":{\"proto3_optional\":true},\"comment\":null},\"data\":{\"type\":\"bytes\",\"id\":4,\"comment\":null}},\"comment\":null}}}}}}}");
exports.schema = codec_protobuf_1.Schema.fromJson(exports.schemaJson);
//# sourceMappingURL=index.js.map
{
"name": "@dxos/broadcast",
"version": "2.33.8",
"version": "2.33.9-dev.62131029",
"description": "Abstract module to send broadcast messages.",

@@ -13,2 +13,5 @@ "repository": {

"types": "dist/src/index.d.ts",
"browser": {
"node:assert": "assert"
},
"files": [

@@ -19,5 +22,6 @@ "srd",

"dependencies": {
"@dxos/async": "2.33.8",
"@dxos/codec-protobuf": "2.33.8",
"@dxos/crypto": "2.33.8",
"@dxos/async": "2.33.9-dev.62131029",
"@dxos/codec-protobuf": "2.33.9-dev.62131029",
"@dxos/crypto": "2.33.9-dev.62131029",
"assert": "^2.0.0",
"debug": "^4.3.3",

@@ -28,6 +32,6 @@ "tiny-lru": "^7.0.6"

"@dxos/eslint-plugin": "~1.0.34",
"@dxos/network-generator": "2.33.8",
"@dxos/network-generator": "2.33.9-dev.62131029",
"@dxos/protocols-toolchain": "2.33.8",
"@types/debug": "^4.1.7",
"@types/jest": "^26.0.7",
"@types/jest": "^28.1.6",
"@types/node": "^16.11.27",

@@ -34,0 +38,0 @@ "eslint": "^7.12.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

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