Archived
1
0
Fork 0
This repository has been archived on 2024-07-25. You can view files and clone it, but cannot push or open issues or pull requests.
paren/ren/attrs.ts

7 lines
298 B
TypeScript

import { Attrs } from "../core/node.ts";
import { isNotSkip, isStr, join, Skipable } from "../core/utils.ts";
export function classNames(vals: string | Skipable<string>[]): Attrs {
const val = isStr(vals) ? vals : join(" ", vals.filter(isNotSkip));
return !val.length ? {} : { class: val };
}