Huge News!Announcing our $40M Series B led by Abstract Ventures.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.3.0 to 0.4.0

19

lib/Junction.js

@@ -118,2 +118,21 @@ "use strict";

/**
* Resets all keys to the given value. If no value is given, all keys will have the value undefined.
*
* @param {*=} value
* @returns {Junction}
*/
Junction.prototype.reset = function (value) {
var obj = this._signals,
key;
for (key in obj) {
if (obj.hasOwnProperty(key)) {
this.setter(key, value);
}
}
return this;
};
/**
* Returns the signal instance to the given key.

@@ -120,0 +139,0 @@ *

2

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

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

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

describe(".reset()", function () {
beforeEach(function () {
junction.set("greeting", "Ahoy!");
junction.set("age", 34);
});
it("should set all keys to the given value", function () {
junction.reset();
expect(junction.get()).to.eql({
greeting: undefined,
age: undefined
});
});
it("should call the internal setter function", function () {
junction.setter = sinon.spy();
junction.reset();
expect(junction.setter).to.have.been.called;
});
});
describe(".reset(value)", function () {
beforeEach(function () {
junction.set("greeting", "Ahoy!");
junction.set("age", 34);
});
it("should set all keys to the given value", function () {
junction.reset(true);
expect(junction.get()).to.eql({
greeting: true,
age: true
});
});
});
describe(".signal(key)", function () {

@@ -187,0 +231,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