Have never agreed with removeClass functions that silently removed duplicate classes (hiding a previous mistake that needs to be tracked down), but that's what the - classList.remove - renditions do.
As we can't change he behavior of the host method, we should match its unwanted (and silent) duplicate class removal in the legacy rendition. Just do a global replace.
Also recommend scaffolding to prevent adding duplicate classes (currently covers up that mistake in all renditions).
For convenience, recommend a replaceClass function as well. Just one rendition as it will have no DOM dependencies (only other library functions).
Have never agreed with removeClass functions that silently removed duplicate classes (hiding a previous mistake that needs to be tracked down), but that's what the - classList.remove - renditions do.
As we can't change he behavior of the host method, we should match its unwanted (and silent) duplicate class removal in the legacy rendition. Just do a global replace.
Also recommend scaffolding to prevent adding duplicate classes (currently covers up that mistake in all renditions).
For convenience, recommend a replaceClass function as well. Just one rendition as it will have no DOM dependencies (only other library functions).