one-spaces
Advanced tools
Comparing version 1.0.0 to 1.0.1
/** | ||
* @author TroyTae | ||
* @version 1.0.0 | ||
* @version 1.0.1 | ||
* @name one-spaces | ||
@@ -8,17 +8,9 @@ */ | ||
function isString(argument) { | ||
return typeof argument === 'string'; | ||
function joinClassName(className1, className2) { | ||
if (className1) { | ||
className1 += ' '; | ||
} | ||
return className1 + className2; | ||
} | ||
function OneSpaces() { | ||
this.className = ''; | ||
} | ||
OneSpaces.prototype.addClass = function(className) { | ||
if (this.className) { | ||
this.className += ' '; | ||
} | ||
this.className += className; | ||
}; | ||
function index () { | ||
@@ -29,20 +21,19 @@ var | ||
index = arguments.length, | ||
instance = new OneSpaces() | ||
className = '' | ||
; | ||
while (index--) { | ||
if ((argument = arguments[index])) { | ||
if (isString(argument)) { | ||
instance.addClass(argument); | ||
} else if (typeof argument === 'object') { | ||
if (Array.isArray(argument) && (key = argument.length)) { | ||
while (key--) { | ||
if (isString(argument[key])) { | ||
instance.addClass(argument[key]); | ||
} | ||
if (argument = arguments[index]) { | ||
if (typeof argument == 'string') { | ||
className = joinClassName(className, argument); | ||
} else if (Array.isArray(argument)) { | ||
key = argument.length; | ||
while (key--) { | ||
if (argument[key]) { | ||
className = joinClassName(className, argument[key]); | ||
} | ||
} else { | ||
for (key in argument) { | ||
if (argument[key]) { | ||
instance.addClass(key); | ||
} | ||
} | ||
} else { | ||
for (key in argument) { | ||
if (argument[key]) { | ||
className = joinClassName(className, key); | ||
} | ||
@@ -53,5 +44,5 @@ } | ||
} | ||
return instance.className; | ||
return className; | ||
} | ||
module.exports = index; |
@@ -1,1 +0,1 @@ | ||
var OneSpaces=function(){"use strict";function s(s){return"string"==typeof s}function e(){this.className=""}return e.prototype.addClass=function(s){this.className&&(this.className+=" "),this.className+=s},function(){var a,t,i=arguments.length,n=new e;while(i--)if(t=arguments[i])if(s(t))n.addClass(t);else if("object"==typeof t)if(Array.isArray(t)&&(a=t.length))while(a--)s(t[a])&&n.addClass(t[a]);else for(a in t)t[a]&&n.addClass(a);return n.className}}(); | ||
var OneSpaces=function(){function e(e,n){return e&&(e+=" "),e+n}return function(){var n,r,i=arguments.length,t="";while(i--)if(r=arguments[i])if("string"==typeof r)t=e(t,r);else if(Array.isArray(r)){n=r.length;while(n--)r[n]&&(t=e(t,r[n]))}else for(n in r)r[n]&&(t=e(t,n));return t}}(); |
{ | ||
"name": "one-spaces", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A tiny module for making className 😎", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
9882
6
1
50
42