UNPKG

native-variants

Version:

A library for handling variants in React Native components with theme support.

21 lines 539 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.cn = cn; function flattenStyle(style) { if (!style) return []; if (Array.isArray(style)) { return style.flat ? style.flat().filter(Boolean) : style.filter(Boolean); } // @ts-ignore return [style]; } function cn(...styles) { return styles .flatMap(flattenStyle) .filter((s) => !!s) .reduce((acc, style) => ({ ...acc, ...style }), {}); } //# sourceMappingURL=cn.js.map