Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

array-typeof-values

1.0.3 • Public • Published

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

Install

npm i array-typeof-values

DownloadsWeekly Downloads

3

Version

1.0.3

License

MIT

Unpacked Size

4.68 kB

Total Files

5

Last publish

Collaborators

  • avatar