MCPcopy Create free account
hub / github.com/glideapps/quicktype / inferMaps

Function inferMaps

src/InferMaps.ts:86–90  ·  view source on GitHub ↗
(graph: TypeGraph, stringTypeMapping: StringTypeMapping)

Source from the content-addressed store, hash-verified

84}
85
86export function inferMaps(graph: TypeGraph, stringTypeMapping: StringTypeMapping): TypeGraph {
87 const allClasses = graph.allNamedTypesSeparated().classes;
88 const classesToReplace = allClasses.filter(c => !c.isFixed && shouldBeMap(c.properties) !== undefined).toArray();
89 return graph.rewrite(stringTypeMapping, classesToReplace.map(c => [c]), replaceClass);
90}

Callers 1

RunClass · 0.90

Calls 3

shouldBeMapFunction · 0.85
rewriteMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…