UNPKG

@ozen-ui/kit

Version:

React component library

16 lines (15 loc) 603 B
import { __read } from "tslib"; import { classnames } from '@bem-react/classnames'; import { isPlainObject } from '../../../utils/object'; export var generateDirectionCn = function (cn, direction) { if (isPlainObject(direction)) { return classnames(Object.entries(direction) .reduce(function (acc, _a) { var _b; var _c = __read(_a, 2), key = _c[0], value = _c[1]; return "".concat(acc, " ").concat(cn((_b = {}, _b["direction_".concat(key)] = value, _b))); }, '') .trim()); } return cn({ direction: direction }); };