Skip to content

sogabe-tatsuki/cls-merge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"

About

class merging npm package

Resources

Stars

Watchers

Forks

Packages

No packages published