Function
addClass
(className: string, ...rest: string[])
Source from the content-addressed store, hash-verified
| 25 | } |
| 26 | |
| 27 | export function addClass(className: string, ...rest: string[]): string { |
| 28 | const classList = (className || '').split(' ').filter(Boolean); |
| 29 | rest.forEach((item) => { |
| 30 | if (item && classList.indexOf(item) < 0) classList.push(item); |
| 31 | }); |
| 32 | return classList.join(' '); |
| 33 | } |
| 34 | |
| 35 | export function wrapFunction<T extends unknown[], U>( |
| 36 | fn: (...args: T) => U, |
Tested by
no test coverage detected