File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,10 @@ var Lib = require('../../lib');
1515var BADNUM = require ( '../../constants/numerical' ) . BADNUM ;
1616
1717module . exports = function autoType ( array , calendar , opts ) {
18+ if ( Lib . isArrayOrTypedArray ( array ) && ! array . length ) return '-' ;
1819 if ( ! opts . noMultiCategory && multiCategory ( array ) ) return 'multicategory' ;
20+
21+ if ( Lib . isArrayOrTypedArray ( array [ 0 ] ) ) return '-' ;
1922 if ( moreDates ( array , calendar ) ) return 'date' ;
2023
2124 var convertNumeric = opts . autotypenumbers !== 'strict' ; // compare against strict, just in case autotypenumbers was not provided in opts
@@ -49,7 +52,6 @@ function linearOK(a, convertNumeric) {
4952// as with categories, consider DISTINCT values only.
5053function moreDates ( a , calendar ) {
5154 var len = a . length ;
52- if ( ! len ) return false ;
5355
5456 var inc = getIncrement ( len ) ;
5557 var dats = 0 ;
@@ -79,7 +81,6 @@ function getIncrement(len) {
7981// require twice as many DISTINCT categories as distinct numbers
8082function category ( a , convertNumeric ) {
8183 var len = a . length ;
82- if ( ! len ) return false ;
8384
8485 var inc = getIncrement ( len ) ;
8586 var nums = 0 ;
You can’t perform that action at this time.
0 commit comments