0.1.1
classnames utility for deno
Repository
Current version released
5 years ago
Versions
classnames
A simple implement of classname on deno. This lib is only support by deno, if you want to use it in Node.js/Browser, please see this.
Usage
classNames("foo", "bar"); // => 'foo bar'
classNames("foo", { bar: true }); // => 'foo bar'
classNames({ "foo-bar": true }); // => 'foo-bar'
classNames({ "foo-bar": false }); // => ''
classNames({ foo: true }, { bar: true }); // => 'foo bar'
classNames({ foo: true, bar: true }); // => 'foo bar'
// lots of arguments of various types
classNames("foo", { bar: true, duck: false }, "baz", { quux: true }); // => 'foo bar baz quux'
// other falsy values are just ignored
classNames(null, false, "bar", undefined, 0, 1, { baz: null }, ""); // => 'bar 1'The usage of this function is similar with classnames, different is we use
Setto remove the repetition so that there is nodedupeversion. And nobindfunction support yet.
License
MIT