You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

add-class

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

add-class - npm Package Compare versions

Comparing version

to
1.0.3

7

index.js
'use strict';
var objType = require('obj-type');
var arrayUnion = require('array-union');

@@ -10,3 +11,7 @@ function add(el, str) {

el.className += ' ' + str;
var cn = el.className.split(' ').filter(function (x) {
return x !== '';
});
el.className = arrayUnion(cn, str.trim()).join(' ');
}

@@ -13,0 +18,0 @@

3

package.json
{
"name": "add-class",
"version": "1.0.2",
"version": "1.0.3",
"description": "Add a given class to elements.",

@@ -28,4 +28,5 @@ "license": "MIT",

"dependencies": {
"array-union": "^1.0.1",
"obj-type": "^1.0.0"
}
}