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

@dr/bem-helper

Package Overview
Dependencies
Maintainers
43
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dr/bem-helper - npm Package Compare versions

Comparing version 1.1.6 to 1.2.0

__tests__/index.test.js

2

lib/index.js

@@ -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 @@ }

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