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

Function compare_schemas

deps/inspector_protocol/check_protocol_compatibility.py:64–80  ·  view source on GitHub ↗
(d_1, d_2, reverse)

Source from the content-addressed store, hash-verified

62
63
64def compare_schemas(d_1, d_2, reverse):
65 errors = []
66 domains_1 = copy.deepcopy(d_1)
67 domains_2 = copy.deepcopy(d_2)
68 types_1 = normalize_types_in_schema(domains_1)
69 types_2 = normalize_types_in_schema(domains_2)
70
71 domains_by_name_1 = list_to_map(domains_1, "domain")
72 domains_by_name_2 = list_to_map(domains_2, "domain")
73
74 for name in domains_by_name_1:
75 domain_1 = domains_by_name_1[name]
76 if name not in domains_by_name_2:
77 errors.append("%s: domain has been %s" % (name, removed(reverse)))
78 continue
79 compare_domains(domain_1, domains_by_name_2[name], types_1, types_2, errors, reverse)
80 return errors
81
82
83def compare_domains(domain_1, domain_2, types_map_1, types_map_2, errors, reverse):

Callers 2

self_testFunction · 0.70
mainFunction · 0.70

Calls 5

list_to_mapFunction · 0.70
removedFunction · 0.70
compare_domainsFunction · 0.70
appendMethod · 0.45

Tested by

no test coverage detected