MCPcopy Create free account
hub / github.com/Peterclark1996/s2ts / getMethodSignature

Function getMethodSignature

scripts/generateInstanceDocs.ts:39–51  ·  view source on GitHub ↗
(method: ts.MethodSignature)

Source from the content-addressed store, hash-verified

37}
38
39const getMethodSignature = (method: ts.MethodSignature): string => {
40 const methodName = method.name?.getText(sourceFile) ?? "Unnamed"
41 const parameters = method.parameters
42 .map(param => {
43 const paramName = param.name.getText(sourceFile)
44 const paramType = param.type ? param.type.getFullText(sourceFile).trim() : "any"
45 return `${paramName}: ${paramType}`
46 })
47 .join(", ")
48
49 const returnType = method.type ? method.type.getFullText(sourceFile).trim() : "void"
50 return `${methodName}(${parameters}): ${returnType}`
51}
52
53const getMemberSignature = (member: ts.TypeElement): string => {
54 if (ts.isMethodSignature(member)) {

Callers 1

getMemberSignatureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected