Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/molnarmark/arraytypes

🏘 Get a beautiful string representation of types inside of an Array.
https://github.com/molnarmark/arraytypes

Last synced: about 1 month ago
JSON representation

🏘 Get a beautiful string representation of types inside of an Array.

Awesome Lists containing this project

README

        

# Array Types

> Get a beautiful string representation of types inside of an Array.
### Inspiration
To be completely fair, none. I needed a tiny, zero dependency package for a project that would do this, so I decided to create one.

### Usage
```javascript
const ArrayTypes = require('get-array-types')

console.log(ArrayTypes([1, 2, 3, 'Hello', 'World']).toString())
//=> Array

console.log(ArrayTypes([1, 'Hello', 2, 'World']).elementTypes())
//=> ['number', 'string']
```

### TODO
- Implement isOfSingleType()

### License
- MIT

Happy Javascripting! 〰️