MCPcopy Create free account
hub / github.com/LambdaNote/support-ts-tapl / getParam

Function getParam

book/tiny-ts-parser.ts:568–574  ·  view source on GitHub ↗
(node: p.TSESTree.Parameter)

Source from the content-addressed store, hash-verified

566}
567
568function getParam(node: p.TSESTree.Parameter): Param {
569 if (node.type !== "Identifier") error("parameter must be a variable", node);
570 if (!node.typeAnnotation) error("parameter type is required", node);
571 const name = node.name;
572 const type = convertType(node.typeAnnotation.typeAnnotation);
573 return { name, type };
574}
575
576function getRecFunc(node: p.TSESTree.FunctionDeclaration, ctx: Context, restFunc: (() => Term) | null): Term {
577 if (!node.id) error("function name is required", node);

Callers 3

getRecFuncFunction · 0.70
convertTypeFunction · 0.70
convertExprFunction · 0.70

Calls 2

errorFunction · 0.70
convertTypeFunction · 0.70

Tested by

no test coverage detected