Evaluates multiple conditions and aggregates matching class names.
- Source:
Methods
(static) resolveClassName(input) → {string}
- Source:
Example
import { resolveClassName } from '@untemps/utils/dom/resolveClassName'
const input = [
[true, 'foo', 'bar'],
[false, 'foo', 'bar'],
'gag',
]
resolveClassName(input) // 'foo bar gag'
Parameters:
Name | Type | Description |
---|---|---|
input |
array.<array> | Array of conditions to evaluate. A condition is an array with 3 items : [condition to evaluate, class name if condition is true, class name if condition is false]. You may pass a classname as string instead of a condition. |
Returns:
The aggregated class names.
- Type
- string