MCPcopy Create free account
hub / github.com/2fd/graphdoc / enum

Method enum

plugins/document.schema/index.ts:214–228  ·  view source on GitHub ↗
(type: SchemaType)

Source from the content-addressed store, hash-verified

212 }
213
214 enum(type: SchemaType): string {
215
216 const reduceEnumValues = (lines: string[], enumValue: EnumValue) => lines
217 .concat(
218 [''],
219 this.description(enumValue.description), [html.property(enumValue.name) + this.deprecated(enumValue)],
220 );
221
222 return html.line(html.keyword('enum') + ' ' + html.identifier(type) + ' {') +
223 type.enumValues
224 .reduce(reduceEnumValues, [])
225 .map(line => html.line(html.tab(line)))
226 .join('') +
227 html.line('}');
228 }
229
230 field(field: Field): string {
231

Callers 1

codeMethod · 0.95

Calls 4

lineMethod · 0.80
keywordMethod · 0.80
identifierMethod · 0.80
tabMethod · 0.80

Tested by

no test coverage detected