MCPcopy Create free account
hub / github.com/DTStack/molecule / classNames

Function classNames

src/common/className.ts:15–38  ·  view source on GitHub ↗
(...args)

Source from the content-addressed store, hash-verified

13}
14
15export function classNames(...args) {
16 if (isEmpty(args)) return;
17 const classList: string[] = [];
18 for (const arg of args) {
19 if (!arg) continue;
20 const argType = typeof arg;
21 if (argType === 'string' || argType === 'number') {
22 classList.push(`${arg}`);
23 continue;
24 }
25 if (argType === 'object') {
26 if (arg.toString !== Object.prototype.toString) {
27 classList.push(arg.toString());
28 continue;
29 }
30 for (const key in arg) {
31 if (Object.hasOwnProperty.call(arg, key) && arg[key]) {
32 classList.push(key);
33 }
34 }
35 }
36 }
37 return classList.join(' ');
38}
39/**
40 * Element names may consist of Latin letters, digits, dashes and underscores.
41 * CSS class is formed as block name plus two underscores plus element name: .block__elem

Callers 15

workbench.tsxFile · 0.90
WorkbenchViewFunction · 0.90
NotificationPaneFunction · 0.90
ActivityBarItemFunction · 0.90
renderTitleFunction · 0.90
EditorTreeFunction · 0.90
FolderTreeFunction · 0.90
AuxiliaryBarTabFunction · 0.90
EditorActionFunction · 0.90
StatusItemFunction · 0.90
TooltipFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected