MCPcopy Create free account
hub / github.com/Snapchat/Valdi / parseFunctionType

Function parseFunctionType

compiler/companion/src/AST.ts:105–127  ·  view source on GitHub ↗
(node: ts.SignatureDeclarationBase, references: AST.TypeReferences)

Source from the content-addressed store, hash-verified

103}
104
105function parseFunctionType(node: ts.SignatureDeclarationBase, references: AST.TypeReferences): AST.FunctionType {
106 const parameters: AST.PropertyLikeDeclaration[] = [];
107
108 if (node.parameters) {
109 for (const parameter of node.parameters) {
110 const parameterName = getIdentifierString(parameter.name);
111 const parameterType = parseType(parameter.type, references);
112
113 parameters.push({
114 start: parameter.getStart(),
115 end: parameter.getEnd(),
116 isOptional: !!parameter.questionToken,
117 name: parameterName,
118 type: parameterType,
119 });
120 }
121 }
122
123 return {
124 returnValue: parseType(node.type, references),
125 parameters,
126 };
127}
128
129interface ResolvedSymbol {
130 name: string;

Callers 3

parseTypeFunction · 0.85
parsePropertyLikeFunction · 0.85
dumpFunctionFunction · 0.85

Calls 4

getIdentifierStringFunction · 0.85
parseTypeFunction · 0.85
getEndMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected