@dr/bem-helper
Advanced tools
Comparing version 1.1.6 to 1.2.0
@@ -45,3 +45,3 @@ "use strict"; | ||
if (value !== false && value !== null && typeof value !== "undefined") { | ||
if (value !== false && value !== "" && value !== null && typeof value !== "undefined") { | ||
result.push("--" + modifier + (value !== true ? "-" + value : "")); | ||
@@ -48,0 +48,0 @@ } |
{ | ||
"name": "@dr/bem-helper", | ||
"version": "1.1.6", | ||
"version": "1.2.0", | ||
"description": "Helper to create BEM-style classnames", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"build": "babel src -d lib --presets=es2015", | ||
"prepublish": "npm run build" | ||
"test": "jest", | ||
"build": "babel src -d lib", | ||
"prepublish": "npm test && npm run build" | ||
}, | ||
@@ -27,4 +28,7 @@ "repository": { | ||
"babel-cli": "^6.18.0", | ||
"babel-preset-es2015": "^6.18.0" | ||
"babel-jest": "^17.0.2", | ||
"babel-polyfill": "^6.16.0", | ||
"babel-preset-es2015": "^6.18.0", | ||
"jest": "^17.0.2" | ||
} | ||
} |
@@ -17,3 +17,3 @@ # bem-helper | ||
var className = bem("dr-module", "list"); | ||
// className === "dr-module__list" | ||
// className === "list dr-module__list" | ||
@@ -26,3 +26,3 @@ var className = bem("dr-module", { loaded: true }); | ||
var className = bem("dr-module", "list", { expanded: true }); | ||
// className === "dr-module__list dr-module__list--expanded" | ||
// className === "list dr-module__list list--expanded dr-module__list--expanded" | ||
@@ -39,3 +39,3 @@ | ||
var className = bem("dr-module", "list", { expanded: true, rated: 3 }); | ||
// className === "dr-module__list dr-module__list--expanded dr-module__list--rated-3" | ||
// className === "list dr-module__list list--expanded dr-module__list--expanded list--rated-3 dr-module__list--rated-3" | ||
@@ -56,3 +56,3 @@ | ||
var className = boundBem("list", { expanded: true }); | ||
// className === "dr-module__list dr-module__list--expanded" | ||
// className === "list dr-module__list list--expanded dr-module__list--expanded" | ||
@@ -59,0 +59,0 @@ var boundSingle = bem.single.bind(null, block); |
@@ -37,3 +37,3 @@ function bem (...args) { | ||
function modifierReducer (result, [modifier, value]) { | ||
if (value !== false && value !== null && typeof value !== "undefined") { | ||
if (value !== false && value !== "" && value !== null && typeof value !== "undefined") { | ||
result.push(`--${modifier}${(value !== true) ? `-${value}` : "" }`); | ||
@@ -40,0 +40,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
11140
8
186
5