( value: string | AnimationClassBindingFn | AnimationClassValue, )
| 274 | * Gets the list of classes from a passed in value |
| 275 | */ |
| 276 | export function getClassListFromValue( |
| 277 | value: string | AnimationClassBindingFn | AnimationClassValue, |
| 278 | ): string[] | null { |
| 279 | let classes: AnimationClassValue = typeof value === 'function' ? value() : value; |
| 280 | while (typeof classes === 'function') { |
| 281 | classes = classes(); |
| 282 | } |
| 283 | let classList: string[] | null = Array.isArray(classes) ? classes : null; |
| 284 | if (typeof classes === 'string') { |
| 285 | classList = classes |
| 286 | .trim() |
| 287 | .split(/\s+/) |
| 288 | .filter((k) => k); |
| 289 | } |
| 290 | return classList; |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * Removes a list of CSS classes from an element using the provided renderer. |
no test coverage detected