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

Function assignType

deps/inspector_protocol/pdl.py:19–36  ·  view source on GitHub ↗
(item, type, is_array=False, map_binary_to_string=False)

Source from the content-addressed store, hash-verified

17
18
19def assignType(item, type, is_array=False, map_binary_to_string=False):
20 if is_array:
21 item['type'] = 'array'
22 item['items'] = collections.OrderedDict()
23 assignType(item['items'], type, False, map_binary_to_string)
24 return
25
26 if type == 'enum':
27 type = 'string'
28 if map_binary_to_string and type == 'binary':
29 type = 'string'
30 if 'description' in item:
31 item['description'] = (item['description'] +
32 ' (Encoded as a base64 string when passed over JSON)')
33 if type in primitiveTypes:
34 item['type'] = type
35 else:
36 item['$ref'] = type
37
38
39def createItem(d, experimental, deprecated, name=None):

Callers 1

parseFunction · 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…