class-prefixer
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -17,3 +17,8 @@ var classNames = require('classnames'); | ||
mainClass = mainClass || ''; | ||
stateClass = stateClass || ''; | ||
if (typeof stateClass === 'boolean') { | ||
defaultPrefix = stateClass; | ||
stateClass = ''; | ||
} else { | ||
stateClass = stateClass || ''; | ||
} | ||
mainClass = typeof mainClass !== 'string' ? classNames(mainClass) : mainClass.trim(); | ||
@@ -20,0 +25,0 @@ stateClass = typeof stateClass !== 'string' ? classNames(stateClass) : stateClass.split(' ').filter(emptyFilter).join(' ').trim(); |
{ | ||
"name": "class-prefixer", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "clsssName prefixer", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -27,3 +27,6 @@ # className | ||
cls('a') // pre-next-a | ||
// add default prefix | ||
cls('a', true).should.eql('pre pre-a'); | ||
cls('a', 'b', true).should.eql('pre pre-a b'); | ||
``` | ||
@@ -30,0 +33,0 @@ |
@@ -35,6 +35,7 @@ require('should'); | ||
var cls = className('pre'); | ||
cls('a', '', true).should.eql('pre pre-a'); | ||
cls('', '', true).should.eql('pre'); | ||
cls('', 'a', true).should.eql('pre a'); | ||
cls('a', true).should.eql('pre pre-a'); | ||
cls('a', 'b', true).should.eql('pre pre-a b'); | ||
cls('', 'b', true).should.eql('pre b'); | ||
cls('', true).should.eql('pre'); | ||
}); | ||
}); |
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
4954
78
89