|
|
3 년 전 | |
|---|---|---|
| .. | ||
| dist | 3 년 전 | |
| src | 3 년 전 | |
| .DS_Store | 3 년 전 | |
| LICENSE | 3 년 전 | |
| README.md | 3 년 전 | |
| package.json | 3 년 전 | |
A function that merges given class names, no matter their format. Filters out invalid class names as well.
npm install merge-class-names or yarn add merge-class-names.import mergeClassNames from 'merge-class-names'.a, a b['a', 'b'], ['a b', 'c d'].> mergeClassNames('a', 'b', 'c');
< 'a b c'
> mergeClassNames('a b', 'c d', 'e f');
< 'a b c d e f'
> mergeClassNames(['a', 'b'], ['c', 'd']);
< 'a b c d'
> mergeClassNames(['a b', 'c d'], ['e f', 'g h']);
< 'a b c d e f g h'
> mergeClassNames('a', 'b', falsyCondition && 'c');
< 'a b'
> mergeClassNames('a', 'b', 'c', null, ['d', null], () => {}, 'e', undefined);
< 'a b c d e'
The MIT License.
|
Wojciech Maj kontakt@wojtekmaj.pl http://wojtekmaj.pl |