Skip to content

molnarmark/arraytypes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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

const ArrayTypes = require('get-array-types')

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

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

TODO

  • Implement isOfSingleType()

License

  • MIT

Happy Javascripting! 〰️

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published