(str, configs)
| 39 | .value() |
| 40 | |
| 41 | const parse = (str, configs) => { |
| 42 | let result |
| 43 | try { |
| 44 | result = _.get(configs, 'options.support-big-int') |
| 45 | ? LosslessJSON.parse(str, _reviver.call(this, _getBigIntFields(configs))) |
| 46 | : JSON.parse(str) |
| 47 | } catch (e) { |
| 48 | throw new Error(`failed to parse json (message: "${e.message}") - source: ${JSON.stringify(str)}`) |
| 49 | } |
| 50 | |
| 51 | return result |
| 52 | } |
| 53 | |
| 54 | const stringify = (json, configs) => _.get(configs, 'options.support-big-int') |
| 55 | ? LosslessJSON.stringify(json, _replacer.call(this, _getBigIntFields(configs))) |
no test coverage detected