UNPKG

@aplus-frontend/ui

Version:

29 lines (28 loc) 573 B
import { isNumber as e, isArray as i } from "lodash-unified"; function m(...r) { return r.reduce((t, n) => ({ ...t, ...n }), {}); } function p(r, t = 0) { if (!r) return t; if (typeof r == "number") return r; const n = r.match(/^(-?\d+(?:\.\d+)?)px$/); if (!n) return t; const o = parseFloat(n[1]); return o > 0 ? o : t; } function u(r) { return e(r) ? String(r) : r; } let s = 0; function f(r) { return `_${i(r) ? r.join("_") : String(r)}_${s++}`; } export { f as getShadowName, u as getStringKey, m as mergeProps, p as pxToNumber };