MCPcopy Create free account
hub / github.com/microsoft/TypeChat / appendType

Function appendType

typescript/src/zod/validate.ts:123–134  ·  view source on GitHub ↗
(type: z.ZodType, minPrecedence = 0)

Source from the content-addressed store, hash-verified

121 }
122
123 function appendType(type: z.ZodType, minPrecedence = 0) {
124 const name = namedTypes.get(getTypeIdentity(type));
125 if (name) {
126 append(name);
127 }
128 else {
129 const parenthesize = getTypePrecedence(type) < minPrecedence;
130 if (parenthesize) append("(");
131 appendTypeDefinition(type);
132 if (parenthesize) append(")");
133 }
134 }
135
136 function appendTypeDefinition(type: z.ZodType) {
137 switch (getTypeKind(type)) {

Callers 6

appendArrayTypeFunction · 0.85
appendObjectTypeFunction · 0.85
appendTupleTypeFunction · 0.85
appendRecordTypeFunction · 0.85
appendReadonlyTypeFunction · 0.85

Calls 4

getTypeIdentityFunction · 0.85
appendFunction · 0.85
getTypePrecedenceFunction · 0.85
appendTypeDefinitionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…