UNPKG

uinix-ui

Version:

A minimal configurable framework-agnostic UI system to build UI systems. Your system, your rules 🤘.

16 lines (13 loc) • 400 B
import {filter, isTruthy} from 'uinix-fp'; export {mergeClassNames}; /** * Merges an array of class names into a space-separated string. * * Filters out empty class names. * Returns undefined if the result is the empty string. * * @param {string[]} classNames * @returns {string | undefined} */ const mergeClassNames = (classNames) => filter(isTruthy)(classNames).join(' ') || undefined;