Skip to content

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

License

Notifications You must be signed in to change notification settings

DABH/array-typeof-values

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Nov 26, 2022
2f12f07 · Nov 26, 2022

History

17 Commits
Feb 19, 2018
Feb 19, 2018
Aug 15, 2019
Feb 19, 2018
Feb 19, 2018
Feb 19, 2018
Aug 1, 2021
Nov 26, 2022
Nov 26, 2022
Feb 19, 2018

Repository files navigation

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