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

classnames

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

classnames - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

13

index.js
function classNames() {
var args = arguments, classes = [];
var args = arguments;
var classes = [];
for (var i = 0; i < args.length; i++) {

@@ -12,5 +14,8 @@ var arg = args[i];

} else if ('object' === typeof arg) {
classes = classes.concat(Object.keys(arg).filter(function(cls) {
return arg[cls];
}));
for (var key in arg) {
if (!arg.hasOwnProperty(key) || !arg[key]) {
continue;
}
classes.push(key);
}
}

@@ -17,0 +22,0 @@ }

{
"name": "classnames",
"version": "1.1.0",
"version": "1.1.1",
"description": "A simple utility for conditionally joining classNames together",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -16,4 +16,4 @@ var assert = require("assert");

it('joins arrays of class names and ignore falsy values', function() {
assert.equal(classNames('a', 0, null, undefined, 'b'), 'a b');
it('joins arrays of class names and ignore non-string values', function() {
assert.equal(classNames('a', 0, null, undefined, true, 1, 'b'), 'a b');
});

@@ -20,0 +20,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