json_to_sheet cell objects

Fixes , 
This commit is contained in:
Matt Andrews 2018-07-03 13:04:15 +01:00
parent 9866dfc010
commit b6fd433a42

@ -196,6 +196,9 @@ function sheet_add_json(_ws/*:?Worksheet*/, js/*:Array<any>*/, opts)/*:Worksheet
var v = JS[k];
var t = 'z';
var z = "";
if(v && typeof v === 'object' && !(v instanceof Date)){
ws[encode_cell({c:_C + C,r:_R + R + offset})] = v;
} else {
if(typeof v == 'number') t = 'n';
else if(typeof v == 'boolean') t = 'b';
else if(typeof v == 'string') t = 's';
@ -206,6 +209,7 @@ function sheet_add_json(_ws/*:?Worksheet*/, js/*:Array<any>*/, opts)/*:Worksheet
}
ws[encode_cell({c:_C + C,r:_R + R + offset})] = cell = ({t:t, v:v}/*:any*/);
if(z) cell.z = z;
}
});
});
range.e.c = Math.max(range.e.c, _C + hdr.length - 1);