UNPKG

@progress/sitefinity-nextjs-sdk

Version:

Provides OOB widgets developed using the Next.js framework, which includes an abstraction layer for Sitefinity communication. Additionally, it offers an expanded API, typings, and tools for further development and integration.

27 lines (26 loc) 722 B
/** * @hidden */ export const classNames = (...args) => { const result = {}; const addLeafKeys = (arg) => typeof arg === 'object' ? Object .keys(arg) .forEach(key => { result[key] = arg[key]; }) : result[arg] = true; ; const addKeys = (list) => list .filter((arg) => arg !== true && !!arg) .map((arg) => Array.isArray(arg) ? addKeys(arg) : addLeafKeys(arg)); addKeys(args); return Object .keys(result) .map((key) => (result[key] && key) || null) .filter(el => el !== null) .join(' ') || undefined; }; export function combineClassNames(...classNames) { return classNames.filter(x => !!x).join(' '); }