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

dual-listbox

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dual-listbox - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

2

package.json
{
"name": "dual-listbox",
"version": "1.0.5",
"version": "1.0.6",
"description": "Dual listbox for multi-select elements",

@@ -5,0 +5,0 @@ "main": "dist/dual-listbox.js",

@@ -22,7 +22,11 @@ const MAIN_BLOCK = 'dual-listbox';

this.setDefaults();
this.select = document.querySelector(selector);
this.selected = [];
this.available = [];
if (this.isDomElement(selector)) {
this.select = selector;
} else {
this.select = document.querySelector(selector);
}
this._initOptions(options);

@@ -443,2 +447,13 @@ this._initReusableElements();

}
/**
* @Private
* Returns true if argument is a DOM element
*/
isDomElement(o) {
return (
typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2
o && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string"
);
}
}

@@ -445,0 +460,0 @@

@@ -292,2 +292,11 @@ import DualListbox, { DualListbox as DualListbox2 } from '../src/dual-listbox.js';

});
it('should be able to create object from DOM element', () => {
let domParent = document.createElement("div");
domParent.innerHTML = FIXTURE_FILLED_SELECT;
let dlb = new DualListbox(domParent.getElementsByTagName('select')[0]);
expect(dlb.available.length).toBe(10);
expect(dlb.selected.length).toBe(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