MCPcopy
hub / github.com/elasticsearch-dump/elasticsearch-dump / parse

Function parse

lib/jsonparser.js:41–52  ·  view source on GitHub ↗
(str, configs)

Source from the content-addressed store, hash-verified

39 .value()
40
41const 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
54const stringify = (json, configs) => _.get(configs, 'options.support-big-int')
55 ? LosslessJSON.stringify(json, _replacer.call(this, _getBigIntFields(configs)))

Callers 1

setupGetMethod · 0.85

Calls 3

_getBigIntFieldsFunction · 0.85
parseMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected