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

handoff

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

handoff - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

16

handoff.js

@@ -64,3 +64,10 @@ 'use strict';

return Promise.resolve(n.response);
if (n.status === 1 || n.response != null) {
return Promise.resolve(n.response);
}
let err = new Error('Notification was cancelled.');
err.code = 'ECANCELED';
return Promise.reject(err);
}

@@ -76,3 +83,6 @@ };

return Promise.reject(new Error(n.name + ' was published but has no subscribers.'));
let err = new Error(n.name + ' was published but has no subscribers.');
err.code = 'ENOSYS';
return Promise.reject(err);
}

@@ -92,3 +102,2 @@

pending.splice(pending.indexOf(notification), 1);
notification = null;
}

@@ -136,2 +145,3 @@

interests = {};
pending.forEach(cancelNotification);
pending = [];

@@ -138,0 +148,0 @@ }

2

package.json
{
"name": "handoff",
"version": "1.1.0",
"version": "1.1.1",
"description": "PubSub with Promises",

@@ -5,0 +5,0 @@ "main": "handoff.js",

@@ -126,19 +126,18 @@ var handoff = require('../handoff');

it('should be able to cancel notifications', done => {
it('should be able to cancel notifications', function () {
handoff.subscribe('cancel-test-2', function (n) {
n.cancel();
setTimeout(() => {
done();
}, 10);
return 'cancelled';
});
handoff.subscribe('cancel-test-2', function (n) {
done(false);
return 'not cancelled';
});
handoff.publish('cancel-test-2');
return handoff.publish('cancel-test-2').then(response => {
expect(response).to.equal('cancelled');
});
});
});
});
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