Comparing version 1.1.6 to 1.1.7
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
var isArray = Array.isArray; | ||
var reduceArray = function (args) { | ||
var len = args.length; | ||
function cnb() { | ||
var len = arguments.length; | ||
if (!len) | ||
return ""; | ||
var str = "", item, type, i, n; | ||
var str = "", item, i, n; | ||
for (i = 0; i < len; i++) { | ||
if (!(item = args[i])) | ||
if (!(item = arguments[i])) | ||
continue; | ||
type = typeof item; | ||
if (type === "string") { | ||
if (typeof item === "string") { | ||
str && (str += " "), (str += item); | ||
continue; | ||
} | ||
if (type !== "object") | ||
if (typeof item !== "object") | ||
continue; | ||
if (isArray(item)) { | ||
if (item.length && (item = reduceArray(item))) { | ||
if (item.push && isArray(item)) { | ||
if ((item = cnb.apply(this, item))) { | ||
str && (str += " "), (str += item); | ||
} | ||
continue; | ||
} | ||
else { | ||
for (n in item) { | ||
if (hasOwnProperty.call(item, n) && item[n] && n) { | ||
str && (str += " "), (str += n); | ||
} | ||
for (n in item) { | ||
if (hasOwnProperty.call(item, n) && item[n] && n) { | ||
str && (str += " "), (str += n); | ||
} | ||
@@ -32,7 +30,4 @@ } | ||
return str; | ||
}; | ||
function cnb() { | ||
return reduceArray(arguments); | ||
} | ||
export default cnb; |
@@ -1,2 +0,2 @@ | ||
"use strict";var r=Object.prototype.hasOwnProperty,e=Array.isArray,t=function(n){var i=n.length;if(!i)return"";var o,f,s,a,l="";for(s=0;s<i;s++)if(o=n[s])if("string"!==(f=typeof o)){if("object"===f)if(e(o))o.length&&(o=t(o))&&(l&&(l+=" "),l+=o);else for(a in o)r.call(o,a)&&o[a]&&a&&(l&&(l+=" "),l+=a)}else l&&(l+=" "),l+=o;return l};module.exports=function(){return t(arguments)}; | ||
"use strict";var r=Object.prototype.hasOwnProperty,e=Array.isArray;module.exports=function t(){var i=arguments.length;if(!i)return"";var o,f,s,p="";for(f=0;f<i;f++)if(o=arguments[f])if("string"!=typeof o){if("object"==typeof o)if(o.push&&e(o))(o=t.apply(this,o))&&(p&&(p+=" "),p+=o);else for(s in o)r.call(o,s)&&o[s]&&s&&(p&&(p+=" "),p+=s)}else p&&(p+=" "),p+=o;return p}; | ||
//# sourceMappingURL=cnbuilder.js.map |
const hasOwnProperty = Object.prototype.hasOwnProperty; | ||
const isArray = Array.isArray; | ||
const reduceArray = (args) => { | ||
const len = args.length; | ||
function cnb() { | ||
const len = arguments.length; | ||
if (!len) | ||
return ""; | ||
let str = "", item, type, i, n; | ||
let str = "", item, i, n; | ||
for (i = 0; i < len; i++) { | ||
if (!(item = args[i])) | ||
if (!(item = arguments[i])) | ||
continue; | ||
type = typeof item; | ||
if (type === "string") { | ||
if (typeof item === "string") { | ||
str && (str += " "), (str += item); | ||
continue; | ||
} | ||
if (type !== "object") | ||
if (typeof item !== "object") | ||
continue; | ||
if (isArray(item)) { | ||
if (item.length && (item = reduceArray(item))) { | ||
if (item.push && isArray(item)) { | ||
if ((item = cnb.apply(this, item))) { | ||
str && (str += " "), (str += item); | ||
} | ||
continue; | ||
} | ||
else { | ||
for (n in item) { | ||
if (hasOwnProperty.call(item, n) && item[n] && n) { | ||
str && (str += " "), (str += n); | ||
} | ||
for (n in item) { | ||
if (hasOwnProperty.call(item, n) && item[n] && n) { | ||
str && (str += " "), (str += n); | ||
} | ||
@@ -32,7 +30,4 @@ } | ||
return str; | ||
}; | ||
function cnb() { | ||
return reduceArray(arguments); | ||
} | ||
export default cnb; |
export declare type ClassValue = string | null | boolean | undefined | ClassListDictionary | ClassListArray; | ||
export interface ClassListDictionary { | ||
[cn: string]: boolean | undefined | any; | ||
[cn: string]: boolean | undefined | null; | ||
} | ||
@@ -5,0 +5,0 @@ export interface ClassListArray extends Array<ClassValue> { |
{ | ||
"name": "cnbuilder", | ||
"version": "1.1.6", | ||
"version": "1.1.7", | ||
"main": "dist/cnbuilder.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/cnbuilder.esm.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
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
14382
71