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

ddp.js

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ddp.js - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 2.1.0 (February 23, 2016)
Internal API change: made `Socket.emit` synchronous.
## 2.0.1 (February 14, 2016)

@@ -2,0 +6,0 @@

4

lib/ddp.js

@@ -150,3 +150,5 @@ "use strict";

value: function sub(name, params) {
var id = (0, _utils.uniqueId)();
var id = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2];
id || (id = (0, _utils.uniqueId)());
this.messageQueue.push({

@@ -153,0 +155,0 @@ msg: "sub",

{
"name": "ddp.js",
"version": "2.1.0",
"version": "2.2.0",
"description": "ddp javascript client",

@@ -5,0 +5,0 @@ "main": "lib/ddp.js",

@@ -113,4 +113,4 @@ import EventEmitter from "wolfy87-eventemitter";

sub (name, params) {
const id = uniqueId();
sub (name, params, id = null) {
id || (id = uniqueId());
this.messageQueue.push({

@@ -117,0 +117,0 @@ msg: "sub",

@@ -121,2 +121,18 @@ import chai, {expect} from "chai";

it("generates unique id when not specified", () => {
const ddp = new DDP(options);
var ids = [];
ids.push(ddp.sub("echo", [ 0 ]));
ids.push(ddp.sub("echo", [ 0 ]));
expect(ids[0]).to.be.a("string");
expect(ids[1]).to.be.a("string");
expect(ids[0]).not.to.equal(ids[1]);
});
it("allows manually specifying sub's id", () => {
const ddp = new DDP(options);
const subId = ddp.sub("echo", [ 0 ], "12345");
expect(subId).to.equal("12345");
});
});

@@ -123,0 +139,0 @@

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