Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

array-typeof-values

DABH17MIT1.0.5TypeScript support: included

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

array, typeof, type, values

readme

array-typeof-values

Build Status version dependencies devDependencies

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