Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 1.0.2 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"
}
}
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