Attempts to parse the string buffer as json.
This is similar to JSON.parse, but instead of throwing an error, it returns null.
The string buffer that may be json.
The parsed value of the buffer when parsed as JSON. If buffer is null, undefined, or does not represent valid JSON, then null is returned.
Attempts to parse the string buffer as json.
This is similar to JSON.parse, but instead of throwing an error, it returns a fallback value.
The parsed value of the buffer when parsed as JSON. If buffer is null, undefined, or does not represent valid JSON, then fallback is returned.
Attempts to parse the string buffer as json.
This is similar to JSON.parse, but instead of throwing an error, it returns the fallback.
Param: buffer
The string buffer that may be json.
Param: fallback
The fallback value in the case that buffer cannot be parsed. Note that parsing the text "null" will return null instead of the fallback. The default value for this is null.
Returns
The parsed value of the buffer when parsed as JSON. If buffer is null, undefined, or does not represent valid JSON, then the fallback is returned.