Skip to content

Gun-Vue docs v0.21.4Docs


Gun-Vue docs v0.21.4 / Crypto / safeJSONParse

Function: safeJSONParse()

safeJSONParse(input, def?): any

Safely parses a JSON string, returning a default object if parsing fails.

Parameters

input: any

The JSON string or object to parse.

def?: any = {}

The default object to return if parsing fails.

Returns

any

  • The parsed object or the default object.

Defined in

src/crypto/useCrypto.js:162

MIT