import { partializeClasses } from "https://deno.land/x/lunchbox@v0.3.15/src/utils.ts";
When adding class to an element, say: <div class={x} />
and x
's value ends up being an empty
string (''
), the element will render <div class />
and end up with tons of empty class
attributes. This function simplifies the code that replaces parts that end up having an empty string
and makes them have undefined
value.