MCPcopy Create free account
hub / github.com/docker/getting-started / classNames

Function classNames

app/src/static/js/react-bootstrap.js:135–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

133 var hasOwn = {}.hasOwnProperty;
134
135 function classNames() {
136 var classes = [];
137
138 for (var i = 0; i < arguments.length; i++) {
139 var arg = arguments[i];
140 if (!arg) continue;
141 var argType = typeof arg;
142
143 if (argType === 'string' || argType === 'number') {
144 classes.push(arg);
145 } else if (Array.isArray(arg) && arg.length) {
146 var inner = classNames.apply(null, arg);
147
148 if (inner) {
149 classes.push(inner);
150 }
151 } else if (argType === 'object') {
152 for (var key in arg) {
153 if (hasOwn.call(arg, key) && arg[key]) {
154 classes.push(key);
155 }
156 }
157 }
158 }
159
160 return classes.join(' ');
161 }
162
163 if ( true && module.exports) {
164 classNames.default = classNames;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…