@raona/sp
Version:
Raona utilities to work with Sharepoint using pnp/sp
29 lines (28 loc) • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
// import { TypedHash } from "../entities";
var Style;
(function (Style) {
// export function classNames(classes: string[]): string;
// export function classNames(...classes: string[]): string;
// export function classNames(classes: TypedHash<boolean>): string;
function classNames() {
var classes = [];
for (var _i = 0; _i < arguments.length; _i++) {
classes[_i] = arguments[_i];
}
return classes.reduce(function (a, b) {
if (typeof b === 'string') {
a.push(b);
}
else if (Array.isArray(b)) {
a = a.concat(b);
}
else {
a = a.concat(Object.keys(b).filter(function (k) { return k !== 'undefined' && b[k]; }));
}
return a;
}, []).join(' ');
}
Style.classNames = classNames;
})(Style = exports.Style || (exports.Style = {}));