one-spaces
Advanced tools
Comparing version 0.7.1 to 0.7.2
/** | ||
* @author TroyTae | ||
* @version 0.7.1 | ||
* @version 0.7.2 | ||
* @name one-spaces | ||
*/ | ||
'use strict';var OBJECT_TYPE_LITERAL = 'object'; | ||
function OneSpaces() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var k; | ||
var argument; | ||
var className = ''; | ||
var i = arguments.length; | ||
while (i--) { | ||
argument = arguments[i]; | ||
if (typeof argument === OBJECT_TYPE_LITERAL) { | ||
if (Array.isArray(argument)) { | ||
k = argument.length; | ||
while (k--) { | ||
className += " " + OneSpaces(argument[k]); | ||
} | ||
'use strict'; | ||
function isString(str) { | ||
return typeof str === 'string'; | ||
} | ||
function spaceAfterClassName(className) { | ||
return className + ' '; | ||
} | ||
function index () { | ||
var | ||
i = arguments.length, | ||
key, | ||
item, | ||
argument, | ||
className = '' | ||
; | ||
while (i--) { | ||
if (argument = arguments[i]) { | ||
if (typeof argument === 'object') { | ||
if (Array.isArray(argument)) { | ||
key = argument.length; | ||
while (key--) { | ||
if ((item = argument[key]) && isString(item)) { | ||
className += spaceAfterClassName(item); | ||
} | ||
else { | ||
for (k in argument) { | ||
if (argument[k]) { | ||
className += " " + k; | ||
} | ||
} | ||
} | ||
} else { | ||
for (key in argument) { | ||
if (argument[key]) { | ||
className += spaceAfterClassName(key); | ||
} | ||
} | ||
} | ||
else { | ||
className += " " + argument; | ||
} | ||
} else if (isString(argument)) { | ||
className += spaceAfterClassName(argument); | ||
} | ||
} | ||
return className; | ||
}module.exports=OneSpaces; | ||
} | ||
return className; | ||
} | ||
module.exports = index; |
@@ -1,1 +0,1 @@ | ||
var OneSpaces=function(){"use strict";var r="object";return function e(){for(var n,t,f=[],o=0;o<arguments.length;o++)f[o]=arguments[o];for(var a="",i=arguments.length;i--;)if(typeof(t=arguments[i])===r)if(Array.isArray(t))for(n=t.length;n--;)a+=" "+e(t[n]);else for(n in t)t[n]&&(a+=" "+n);else a+=" "+t;return a}}(); | ||
var OneSpaces=function(){"use strict";function e(e){return"string"==typeof e}function n(e){return e+" "}return function(){var r,t,i,f=arguments.length,u="";while(f--)if(i=arguments[f])if("object"==typeof i)if(Array.isArray(i)){r=i.length;while(r--)(t=i[r])&&e(t)&&(u+=n(t))}else for(r in i)i[r]&&(u+=n(r));else e(i)&&(u+=n(i));return u}}(); |
{ | ||
"name": "one-spaces", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "A tiny module for making className 😎", | ||
@@ -21,5 +21,3 @@ "main": "dist/index.js", | ||
"rollup": "^1.27.0", | ||
"rollup-plugin-terser": "^5.1.2", | ||
"typescript": "^3.7.2", | ||
"rollup-plugin-typescript2": "^0.25.2" | ||
"rollup-plugin-terser": "^5.1.2" | ||
}, | ||
@@ -26,0 +24,0 @@ "scripts": { |
const pkg = require('./package.json'); | ||
const {terser} = require('rollup-plugin-terser'); | ||
const typescript = require('rollup-plugin-typescript2'); | ||
const createConfig = (isNode) => { | ||
return { | ||
input: 'src/index.ts', | ||
input: 'src/index.js', | ||
output: { | ||
banner: `/**\n * @author ${pkg.author.name}\n * @version ${pkg.version}\n * @name ${pkg.name}\n */`, | ||
compact: isNode, | ||
compact: !isNode, | ||
format: isNode ? 'cjs' : 'iife', | ||
@@ -16,4 +15,5 @@ file: isNode ? pkg.main : `dist/${pkg.name}.js`, | ||
plugins: [ | ||
typescript({ clean: true }), | ||
isNode ? null : terser() | ||
isNode ? null : terser({ | ||
compress: { loops: false } | ||
}) | ||
].filter(Boolean) | ||
@@ -20,0 +20,0 @@ }; |
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
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
2
7184
8