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

one-spaces

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

one-spaces - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

README.md

51

dist/index.js
/**
* @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

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