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

ampersand-dom

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-dom - npm Package Compare versions

Comparing version 1.2.6 to 1.2.7

12

ampersand-dom.js

@@ -10,3 +10,7 @@ /*$AMPERSAND_VERSION*/

if (!cls) return;
if (el.classList) {
if (Array.isArray(cls)) {
cls.forEach(function(c) {
dom.addClass(el, c);
});
} else if (el.classList) {
el.classList.add(cls);

@@ -24,3 +28,7 @@ } else {

removeClass: function (el, cls) {
if (el.classList) {
if (Array.isArray(cls)) {
cls.forEach(function(c) {
dom.removeClass(el, c);
});
} else if (el.classList) {
cls = getString(cls);

@@ -27,0 +35,0 @@ if (cls) el.classList.remove(cls);

2

package.json
{
"name": "ampersand-dom",
"description": "Super light-weight DOM manipulation lib.",
"version": "1.2.6",
"version": "1.2.7",
"author": "'Henrik Joreteg' <henrik@andyet.net>",

@@ -6,0 +6,0 @@ "bugs": {

@@ -89,2 +89,12 @@ var suite = require('tape-suite');

dom.addClass(fixture, ['foo2', 'bar2'])
t.equal(normalizeString(fixture.getAttribute('class')), 'foo bar foo2 bar2');
t.ok(dom.hasClass(fixture, 'foo2'));
t.ok(dom.hasClass(fixture, 'bar2'));
dom.removeClass(fixture, ['foo2', 'bar2'])
t.equal(normalizeString(fixture.getAttribute('class')), 'foo bar');
t.ok(!dom.hasClass(fixture, 'foo2'));
t.ok(!dom.hasClass(fixture, 'bar2'));
dom.switchClass(fixture, 'bar', 'baz');

@@ -91,0 +101,0 @@ t.equal(normalizeString(fixture.getAttribute('class')), 'foo baz');

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