MCPcopy
hub / github.com/tastejs/todomvc / classNames

Function classNames

examples/typescript-react/js/bundle.js:388–414  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

386 var hasOwn = {}.hasOwnProperty;
387
388 function classNames () {
389 var classes = [];
390
391 for (var i = 0; i < arguments.length; i++) {
392 var arg = arguments[i];
393 if (!arg) continue;
394
395 var argType = typeof arg;
396
397 if (argType === 'string' || argType === 'number') {
398 classes.push(arg);
399 } else if (Array.isArray(arg) && arg.length) {
400 var inner = classNames.apply(null, arg);
401 if (inner) {
402 classes.push(inner);
403 }
404 } else if (argType === 'object') {
405 for (var key in arg) {
406 if (hasOwn.call(arg, key) && arg[key]) {
407 classes.push(key);
408 }
409 }
410 }
411 }
412
413 return classes.join(' ');
414 }
415
416 if (typeof module !== 'undefined' && module.exports) {
417 classNames.default = classNames;

Callers 5

todoItem.jsFile · 0.85
footer.jsFile · 0.85
renderMethod · 0.85
renderMethod · 0.85
bundle.jsFile · 0.85

Calls 1

isArrayMethod · 0.65

Tested by

no test coverage detected