MCPcopy Index your code
hub / github.com/npmx-dev/npmx.dev / formatParam

Function formatParam

server/utils/docs/format.ts:63–67  ·  view source on GitHub ↗
(param: FunctionParam)

Source from the content-addressed store, hash-verified

61 * Format a function parameter.
62 */
63export function formatParam(param: FunctionParam): string {
64 const optional = param.optional ? '?' : ''
65 const type = formatType(param.tsType)
66 return type ? `${param.name}${optional}: ${type}` : `${param.name}${optional}`
67}
68
69/**
70 * Format a TypeScript type.

Callers 5

renderClassMembersFunction · 0.90
renderInterfaceMembersFunction · 0.90
getNodeSignatureFunction · 0.85
formatTypeLiteralTypeFunction · 0.85

Calls 1

formatTypeFunction · 0.85

Tested by

no test coverage detected