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

Function renderGraphAndSerialize

src/TargetLanguage.ts:30–44  ·  view source on GitHub ↗
(
        graph: TypeGraph,
        alphabetizeProperties: boolean,
        rendererOptions: { [name: string]: any }
    )

Source from the content-addressed store, hash-verified

28 protected abstract get rendererClass(): new (graph: TypeGraph, ...optionValues: any[]) => Renderer;
29
30 renderGraphAndSerialize(
31 graph: TypeGraph,
32 alphabetizeProperties: boolean,
33 rendererOptions: { [name: string]: any }
34 ): SerializedRenderResult {
35 if (this._options === undefined) {
36 return panic(`Target language ${this.displayName} did not set its options`);
37 }
38 const renderer = new this.rendererClass(graph, ...this._options.map(o => o.getValue(rendererOptions)));
39 if ((renderer as any).setAlphabetizeProperties !== undefined) {
40 (renderer as ConvenienceRenderer).setAlphabetizeProperties(alphabetizeProperties);
41 }
42 const renderResult = renderer.render();
43 return serializeRenderResult(renderResult, this.indentation);
44 }
45
46 protected get indentation(): string {
47 return " ";

Callers

nothing calls this directly

Calls 4

panicFunction · 0.90
serializeRenderResultFunction · 0.90
getValueMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…