beve
beve copied to clipboard
TypeError: Cannot convert undefined or null to object
JSON and most languages do not support undefined values, and this is how the write_beve function on beve js throws an error for the undefined value passed to it. This is a potential bug for the js. Something needs to be done about this.
Suggestion,
- remove Object values with undefined values (like browsers do in rest api requests)
- We can convert Array elements with undefined value to null
I was able to solve the problem by adding a new "if" branch under write_value.
else if (value === null) {
let header = 0;
header |= 0b00000000;
writer.append_uint8(header);
}