cls-merge
v1.0.1
Published
class merging npm package
Downloads
4
Readme
Cls-Merge
A utility for constructing className
strings conditionally.
Install
$ npm install cls-merge
Usage
import clsMerge from "cls-merge";
clsMerge("hoge", true && "fuga", "piyo");
// result: "hoge fuga piyo"
clsMerge(["hoge", "fuga", "piyo"]);
// result: "hoge fuga piyo"
clsMerge("hoge", ["fuga", ["piyo"]], "foo", "bar", true ? null : "baz");
// result: "hoge fuga piyo foo bar"