@cleartrip/ct-design-alert-callout
Advanced tools
Comparing version 3.1.1-SNAPSHOT-container-fix.0 to 3.1.1-SNAPSHOT-container-styles.0
@@ -94,30 +94,41 @@ (function (global, factory) { | ||
function classNames() { | ||
var classes = []; | ||
var classes = ''; | ||
for (var i = 0; i < arguments.length; i++) { | ||
var arg = arguments[i]; | ||
if (!arg) continue; | ||
var argType = typeof arg; | ||
if (argType === 'string' || argType === 'number') { | ||
classes.push(arg); | ||
} else if (Array.isArray(arg)) { | ||
if (arg.length) { | ||
var inner = classNames.apply(null, arg); | ||
if (inner) { | ||
classes.push(inner); | ||
} | ||
} | ||
} else if (argType === 'object') { | ||
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { | ||
classes.push(arg.toString()); | ||
continue; | ||
} | ||
for (var key in arg) { | ||
if (hasOwn.call(arg, key) && arg[key]) { | ||
classes.push(key); | ||
} | ||
} | ||
if (arg) { | ||
classes = appendClass(classes, parseValue(arg)); | ||
} | ||
} | ||
return classes.join(' '); | ||
return classes; | ||
} | ||
function parseValue(arg) { | ||
if (typeof arg === 'string' || typeof arg === 'number') { | ||
return arg; | ||
} | ||
if (typeof arg !== 'object') { | ||
return ''; | ||
} | ||
if (Array.isArray(arg)) { | ||
return classNames.apply(null, arg); | ||
} | ||
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { | ||
return arg.toString(); | ||
} | ||
var classes = ''; | ||
for (var key in arg) { | ||
if (hasOwn.call(arg, key) && arg[key]) { | ||
classes = appendClass(classes, key); | ||
} | ||
} | ||
return classes; | ||
} | ||
function appendClass(value, newClass) { | ||
if (!newClass) { | ||
return value; | ||
} | ||
if (value) { | ||
return value + ' ' + newClass; | ||
} | ||
return value + newClass; | ||
} | ||
if (module.exports) { | ||
@@ -124,0 +135,0 @@ classNames.default = classNames; |
{ | ||
"name": "@cleartrip/ct-design-alert-callout", | ||
"version": "3.1.1-SNAPSHOT-container-fix.0", | ||
"version": "3.1.1-SNAPSHOT-container-styles.0", | ||
"description": "AlertCallout Component", | ||
@@ -18,8 +18,8 @@ "types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@cleartrip/ct-design-container": "3.2.0-SNAPSHOT-container-fix.0", | ||
"@cleartrip/ct-design-theme": "3.1.0", | ||
"@cleartrip/ct-design-types": "3.1.0" | ||
"@cleartrip/ct-design-container": "3.2.0-SNAPSHOT-container-styles.0", | ||
"@cleartrip/ct-design-types": "3.1.0", | ||
"@cleartrip/ct-design-theme": "3.1.0" | ||
}, | ||
"devDependencies": { | ||
"@cleartrip/ct-design-icons": "19.0.1-SNAPSHOT-container-fix.0" | ||
"@cleartrip/ct-design-icons": "19.0.1-SNAPSHOT-container-styles.0" | ||
}, | ||
@@ -26,0 +26,0 @@ "peerDependencies": { |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
71934
314
1