Skip to content

Repository files navigation

array-typeof-values

Distribution and maintenance

DABH — Distributed and maintained by DABH LLC. For maintenance and software consulting inquiries: hello@dabh.llc.

Written by David Hyde (DABH). Available under the MIT license.

CI version

Gets the most specific common type of all the values in an array

TypeScript definitions included!

Installation

npm install array-typeof-values

Usage

var arrayTypeOfValues = require('array-typeof-values');

arrayTypeOfValues(['a', 'b', 'c']); // -> 'string'
arrayTypeOfValues(['a', 2, 'c']); // -> 'object'
arrayTypeOfValues([[1], ['b'], []]); // -> 'array'
arrayTypeOfValues([]); // -> undefined

License

MIT © https://github.com/DABH

About

Gets the most specific common type of all the values in an array

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages