MCPcopy Index your code
hub / github.com/nodejs/node / json_to_object

Function json_to_object

deps/inspector_protocol/code_generator.py:40–51  ·  view source on GitHub ↗
(data, output_base, config_base)

Source from the content-addressed store, hash-verified

38def read_config():
39 # pylint: disable=W0703
40 def json_to_object(data, output_base, config_base):
41 def json_object_hook(object_dict):
42 items = [(k, os.path.join(config_base, v) if k == "path" else v)
43 for (k, v) in object_dict.items()]
44 items = [(k, os.path.join(output_base, v) if k == "output" else v)
45 for (k, v) in items]
46 keys, values = list(zip(*items))
47 # 'async' is a keyword since Python 3.7.
48 # Avoid namedtuple(rename=True) for compatibility with Python 2.X.
49 keys = tuple('async_' if k == 'async' else k for k in keys)
50 return collections.namedtuple('X', keys)(*values)
51 return json.loads(data, object_hook=json_object_hook)
52
53 def init_defaults(config_tuple, path, defaults):
54 keys = list(config_tuple._fields) # pylint: disable=E1101

Callers 1

read_configFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…