0.1.0 • Published 8 years ago
classname-lodash v0.1.0
classnames-lodash
classnames, rewritten using lodash.
classnamesis still being maintained. This is not a replacement forclassnames.
classnames is a fantastic library. With no dependencies, it efficiently produces a classlist from a slew of parameter types and combinations. This is a personal exercise in producing, testing, profiling, and documenting an open-source software package.
Installation
npm install classnames-lodashUsage
import classnames from 'classnames-lodash'
classnames('foo', undefined, 'bar', null) // => 'foo bar'Todo
- Create Yarn package
- Create Bower package
- Create script to expose
classnames()to the global scope - Support object parameter type with class names as keys, like this:
classnames({ foo: true, bar: false }) // => 'foo' - Implement, test, and profile
classnames.bind() - Create alternative that does not sort
- Create alternative that does not dedupe
- Create alternative that does not sort or dedupe
Development
If you're looking to work on this project, please use the following npm scripts to run benchmarks and tests.
| Command | Effect |
|---|---|
lint | Lints all source code in the project and displays warnings and errors to the console. |
fix | Lints all source code and fixes fixable errors in place. |
test | Runs all tests for this project. |
test-watch | Runs all tests for this project, then watches for file changes, repeat. |
benchmark | Runs benchmarks for this project and displays results on the console. |
0.1.0
8 years ago