Comparing version 1.4.1 to 1.4.2
'use strict'; | ||
var wildcard = '9007199254740991'; // this will be injected as placeholder while calculating, before returning the classname we will remove those numbers | ||
var is = function is(val, type) { | ||
@@ -25,3 +27,3 @@ var objectType = Object.prototype.toString.call(val); | ||
if (is(val, 'array')) { | ||
return val.length === 0 ? '-1' : val.map(function (a) { | ||
return val.length === 0 ? wildcard : val.map(function (a) { | ||
return block + '--' + a; | ||
@@ -34,5 +36,5 @@ }); | ||
return keys.length === 0 ? '-1' : Object.keys(val).map(function (key) { | ||
return keys.length === 0 ? wildcard : Object.keys(val).map(function (key) { | ||
if (is(val[key], 'boolean')) { | ||
return !!val[key] ? block + '--' + dashify(key) : '-1'; | ||
return !!val[key] ? block + '--' + dashify(key) : wildcard; | ||
} else { | ||
@@ -45,3 +47,3 @@ return block + '--' + dashify(key) + '-' + dashify(val[key]); | ||
if (is(val, 'string')) { | ||
return val.length === 0 ? '-1' : val; | ||
return val.length === 0 ? wildcard : val; | ||
} | ||
@@ -58,4 +60,4 @@ | ||
return (args.filter(removeNotSupportedTypes).map(handleBlocks.bind(null, block)).map(handleModifiers.bind(null, block)).join(' ').replace(/,/g, ' ') || block).replace(/-1/g, '').trim(); | ||
return (args.filter(removeNotSupportedTypes).map(handleBlocks.bind(null, block)).map(handleModifiers.bind(null, block)).join(' ').replace(/,/g, ' ') || block).replace(new RegExp(wildcard, 'g'), '').trim(); | ||
}; | ||
}; |
{ | ||
"name": "b3m", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"main": "build/index.js", | ||
@@ -5,0 +5,0 @@ "repository": { |
5674
45