Comparing version 1.0.2 to 1.0.3
'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 @@ |
{ | ||
"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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3106
28
2
+ Addedarray-union@^1.0.1
+ Addedarray-union@1.0.2(transitive)
+ Addedarray-uniq@1.0.3(transitive)