classnames
Advanced tools
Comparing version 2.2.3 to 2.2.4
@@ -29,7 +29,5 @@ /*! | ||
if (hasOwn.call(object, k)) { | ||
if (object[k]) { | ||
resultSet[k] = true; | ||
} else { | ||
delete resultSet[k]; | ||
} | ||
// set value to false instead of deleting it to avoid changing object structure | ||
// https://www.smashingmagazine.com/2012/11/writing-fast-memory-efficient-javascript/#de-referencing-misconceptions | ||
resultSet[k] = !!object[k]; | ||
} | ||
@@ -72,9 +70,19 @@ } | ||
function _classNames () { | ||
var classSet = {}; | ||
_parseArray(classSet, arguments); | ||
// don't leak arguments | ||
// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments | ||
var len = arguments.length; | ||
var args = Array(len); | ||
for (var i = 0; i < len; i++) { | ||
args[i] = arguments[i]; | ||
} | ||
// don't inherit from Object so we can skip hasOwnProperty check later | ||
// http://stackoverflow.com/questions/15518328/creating-js-object-with-object-createnull#answer-21079232 | ||
var classSet = Object.create(null); | ||
_parseArray(classSet, args); | ||
var list = []; | ||
for (var k in classSet) { | ||
if (hasOwn.call(classSet, k) && classSet[k]) { | ||
if (classSet[k]) { | ||
list.push(k) | ||
@@ -81,0 +89,0 @@ } |
# Changelog | ||
## v2.2.4 / 2016-04-25 | ||
* Improved performance of `dedupe` variant by about 2x, thanks [Bartosz Gościński](https://github.com/bgoscinski) | ||
## v2.2.3 / 2016-01-05 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "classnames", | ||
"version": "2.2.3", | ||
"version": "2.2.4", | ||
"description": "A simple utility for conditionally joining classNames together", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
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
203
10409
8
1
0