You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When parsing an array of object with: var xls = json2xls(json)
I stumbled onto this error :
if (n in object) {
^
TypeError: Cannot use 'in' operator to search for 'count' in null
at getByString (C:\Users\capti\dev\essec_scraper\node_modules\�[4mjson2xls�[24m\lib\json2xls.js:33:15)
at C:\Users\capti\dev\essec_scraper\node_modules\�[4mjson2xls�[24m\lib\json2xls.js:70:25
at Array.map (<anonymous>)
at C:\Users\capti\dev\essec_scraper\node_modules\�[4mjson2xls�[24m\lib\json2xls.js:69:23
at Array.map (<anonymous>)
at Function.transform.prepareJson (C:\Users\capti\dev\essec_scraper\node_modules\�[4mjson2xls�[24m\lib\json2xls.js:68:24)
at transform (C:\Users\capti\dev\essec_scraper\node_modules\�[4mjson2xls�[24m\lib\json2xls.js:4:26)
at file:///C:/Users/capti/dev/essec_scraper/convertData.js:7:11
�[90m at ModuleJob.run (internal/modules/esm/module_job.js:152:23)�[39m
�[90m at async Loader.import (internal/modules/esm/loader.js:166:24)�[39m
It appears function getByString(object, path) does not check for null for "object".
Therefore,
transform.prepareJson = function(json,config) {
....
res.rows = jsonArr.map(function(row) {
return fields.map(function(key) {
var value = getByString(row,key);
Will fail.
As a simple fix, I added
if(object == null){
return ""
}
to function getByString(object, path).
So that the rest of the array can be prepared..
The text was updated successfully, but these errors were encountered:
Hi,
When parsing an array of object with:
var xls = json2xls(json)
I stumbled onto this error :
It appears function getByString(object, path) does not check for null for "object".
Therefore,
Will fail.
As a simple fix, I added
to function getByString(object, path).
So that the rest of the array can be prepared..
The text was updated successfully, but these errors were encountered: