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');
15
15
var BADNUM = require ( '../../constants/numerical' ) . BADNUM ;
16
16
17
17
module . exports = function autoType ( array , calendar , opts ) {
18
+ if ( Lib . isArrayOrTypedArray ( array ) && ! array . length ) return '-' ;
18
19
if ( ! opts . noMultiCategory && multiCategory ( array ) ) return 'multicategory' ;
20
+
21
+ if ( Lib . isArrayOrTypedArray ( array [ 0 ] ) ) return '-' ;
19
22
if ( moreDates ( array , calendar ) ) return 'date' ;
20
23
21
24
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) {
49
52
// as with categories, consider DISTINCT values only.
50
53
function moreDates ( a , calendar ) {
51
54
var len = a . length ;
52
- if ( ! len ) return false ;
53
55
54
56
var inc = getIncrement ( len ) ;
55
57
var dats = 0 ;
@@ -79,7 +81,6 @@ function getIncrement(len) {
79
81
// require twice as many DISTINCT categories as distinct numbers
80
82
function category ( a , convertNumeric ) {
81
83
var len = a . length ;
82
- if ( ! len ) return false ;
83
84
84
85
var inc = getIncrement ( len ) ;
85
86
var nums = 0 ;
You can’t perform that action at this time.
0 commit comments