New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

alamid-junction

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alamid-junction - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

20

lib/Junction.js

@@ -135,2 +135,22 @@ "use strict";

/**
* Removes all keys from the value store and sets all signals on undefined.
*
* @returns {Junction}
*/
Junction.prototype.reset = function () {
var signals = this._signals,
key;
this._values = {};
for (key in signals) {
if (signals.hasOwnProperty(key)) {
signals[key](undefined);
}
}
return this;
};
/**
* Removes the given key from the internal value store and sets the signal on undefined.

@@ -137,0 +157,0 @@ *

2

package.json
{
"name": "alamid-junction",
"version": "0.6.0",
"version": "0.7.0",
"description": "Provides convenient methods for setting and retrieving multiple signals",

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

@@ -185,2 +185,29 @@ "use strict";

describe(".reset()", function () {
beforeEach(function () {
junction.set("greeting", "Ahoy!");
junction.set("age", 34);
});
it("should remove all keys from the junction", function () {
junction.reset();
expect(junction.get()).to.eql({});
});
it("should set the key's signal to undefined", function () {
var greeting = junction.signal("greeting"),
age = junction.signal("age");
expect(greeting()).to.equal(34);
junction.reset();
expect(greeting()).to.equal(undefined);
});
it("should be chainable", function () {
expect(junction.reset()).to.equal(junction);
});
});
describe(".remove(key)", function () {

@@ -202,7 +229,7 @@

it("should set the key's signal to undefined", function () {
var signal = junction.signal("greeting");
var greeting = junction.signal("greeting");
expect(signal()).to.equal("Ahoy!");
expect(greeting()).to.equal("Ahoy!");
junction.remove("greeting");
expect(signal()).to.equal(undefined);
expect(greeting()).to.equal(undefined);
});

@@ -209,0 +236,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