dirty-json got valid JSON that failed with the custom parser. We're returning the valid JSON, but please file a bug report here: https://github.com/RyanMarcus/dirty-json/issues -- the JSON that caused the failure was: null
Passing an empty string throws an exception:
require('dirty-json').parse("")
Uncaught TypeError: Cannot read property 'type' of undefined
It is negotiable though what is supposed to be returned instead of an exception. An empty string or an empty object?
Also, passing undefined (not sure who might want that) gives another exception
require('dirty-json').parse(undefined)
Uncaught TypeError: Cannot read property 'length' of undefined
Not sure if you want to handle undefined at all, I just checked it for no apparent reason while creating this issue. Also, boolean values (I know, this module is supposed to process strings, what am I talking about) have the same behavior as null, the same value returned, but with a warning.
This example
Returns
null
as expected, but whines every time:Passing an empty string throws an exception:
It is negotiable though what is supposed to be returned instead of an exception. An empty string or an empty object?
Also, passing
undefined
(not sure who might want that) gives another exceptionNot sure if you want to handle
undefined
at all, I just checked it for no apparent reason while creating this issue. Also, boolean values (I know, this module is supposed to process strings, what am I talking about) have the same behavior asnull
, the same value returned, but with a warning.