File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ function parseTable(inputString) {
141141 // each column
142142 data . forEach ( ( row ) => {
143143 row . forEach ( ( value , colIndex ) => {
144- if ( value === "" ) {
144+ if ( value === null || value === undefined || value === "" ) {
145145 // Ignore empty values
146146 return ;
147147 }
@@ -164,7 +164,7 @@ function parseTable(inputString) {
164164 columnTypes . forEach ( ( type , colIndex ) => {
165165 if ( type === "numeric" ) {
166166 const values = data . map ( ( row ) => row [ colIndex ] ) . filter ( value => value !== "" ) ;
167- const allIntegers = values . every ( ( value ) => utils . isInt ( value ) ) ;
167+ const allIntegers = values . every ( ( value ) => value && utils . isInt ( value ) ) ;
168168 if ( allIntegers ) {
169169 columnTypes [ colIndex ] = "integer" ;
170170 }
@@ -175,7 +175,7 @@ function parseTable(inputString) {
175175 columnTypes . forEach ( ( type , colIndex ) => {
176176 if ( type === "string" ) {
177177 const values = data . map ( ( row ) => row [ colIndex ] ) . filter ( value => value !== "" ) ;
178- const allBool = values . every ( ( value ) => utils . isBool ( value ) ) ;
178+ const allBool = values . every ( ( value ) => value && utils . isBool ( value ) ) ;
179179 if ( allBool ) {
180180 columnTypes [ colIndex ] = "boolean" ;
181181 }
You can’t perform that action at this time.
0 commit comments