MCPcopy
hub / github.com/perkeep/perkeep / classNames

Function classNames

clients/web/embed/react/classnames.js:13–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11 var hasOwn = {}.hasOwnProperty;
12
13 function classNames () {
14 var classes = [];
15
16 for (var i = 0; i < arguments.length; i++) {
17 var arg = arguments[i];
18 if (!arg) continue;
19
20 var argType = typeof arg;
21
22 if (argType === 'string' || argType === 'number') {
23 classes.push(arg);
24 } else if (Array.isArray(arg)) {
25 classes.push(classNames.apply(null, arg));
26 } else if (argType === 'object') {
27 for (var key in arg) {
28 if (hasOwn.call(arg, key) && arg[key]) {
29 classes.push(key);
30 }
31 }
32 }
33 }
34
35 return classes.join(' ');
36 }
37
38 if (typeof module !== 'undefined' && module.exports) {
39 module.exports = classNames;

Callers 10

sidebar.jsFile · 0.85
image_detail.jsFile · 0.85
index.jsFile · 0.85
header.jsFile · 0.85
blob_item_react.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected