* Apply updates to a class string (space-separated list of classes).
( classStr: string, updates: ClassNameUpdate[] )
| 353 | * Apply updates to a class string (space-separated list of classes). |
| 354 | */ |
| 355 | function updateClassString( |
| 356 | classStr: string, |
| 357 | updates: ClassNameUpdate[] |
| 358 | ): string { |
| 359 | let classes = classStr.split(/\s+/).filter(Boolean); |
| 360 | for (const update of updates) { |
| 361 | classes = applyUpdate(classes, update); |
| 362 | } |
| 363 | return classes.join(" "); |
| 364 | } |
| 365 | |
| 366 | /** |
| 367 | * Check if a cn()/clsx() call has the prefix in a conditional argument. |
no test coverage detected