# @mazzard/classes

> Combining of class names

Latest version **1.0.0** (published 2019-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mazzard/classes
pnpm add @mazzard/classes
yarn add @mazzard/classes
bun add @mazzard/classes
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-09-15 |
| First published | 2019-09-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Deight |
| Maintainers | deight |
| Keywords | class, className, classNames, class name, html class |

## Links

- npm: https://www.npmjs.com/package/@mazzard/classes
- Homepage: https://github.com/d8corp/mazzard#readme
- npm.io page: https://npm.io/package/@mazzard/classes

## Dependencies (1)

- [core-js](https://npm.io/package/core-js.md) ^3.2.1

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-09-15

## README

#@mazzard/classes
### Install
```bash
npm i @mazzard/classes
```
Next we will use `classes` which means we imported it from `@mazzard/classes`
```javascript
import classes from '@mazzard/classes'
classes() // ''
```

### string
String is conveying as is
```javascript
classes('test') // 'test' 
```
### function
Function is calling
```javascript
classes(() => 'test1') // 'test1'
classes(() => () => 'test1') // 'test1'
classes(() => () => () => 'test1') // 'test1'
```
### iterable
Any iterable elements are sorting out and combining each other
```javascript
classes([]) // ''
classes(['test1', 'test2', 'test3']) // 'test1 test2 test3'
classes(new Set(['test1', 'test2', 'test3'])) // 'test1 test2 test3'
classes(new Map([['test1', ''], ['test2', ''], ['test3', 'test4']])) // 'test1 test2 test3 test4'
```
### object
Any object are filtering by value and combining their's keys
```javascript
classes({}) // ''
classes({
  test1: true,
  test2: false
}) // 'test1'
classes({
  test1: true,
  test2: true
}) // 'test1 test2'
```
### other
other types returns empty string
```javascript
classes(null) // ''
classes(undefined) // ''
classes(Symbol('test')) // ''
classes(1) // ''
classes(1.1) // ''
classes(NaN) // ''
```
### combining
You may combine all of this types as you wish
```javascript
classes(
  'test1',
  () => 'test2',
  () => [
    new Set(['test3']),
    () => ({
      test4: true,
      test5: false
    })
  ]
) // 'test1 test2 test3 test4'
```

---
_Source: https://npm.io/package/@mazzard/classes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
