Home / Function/ formatMethodSignature() — supabase Function Reference

formatMethodSignature() — supabase Function Reference

Architecture documentation for the formatMethodSignature() function in Reference.typeSpec.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  3baee727_1abb_1eb1_6333_f79ca9f68539["formatMethodSignature()"]
  d0714c90_b2eb_810b_c046_3cb9bc737b59["FunctionSection()"]
  d0714c90_b2eb_810b_c046_3cb9bc737b59 -->|calls| 3baee727_1abb_1eb1_6333_f79ca9f68539
  style 3baee727_1abb_1eb1_6333_f79ca9f68539 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/features/docs/Reference.typeSpec.ts lines 1073–1097

export function formatMethodSignature(method: MethodTypes): string {
  let methodName = method.name !== TYPESPEC_NODE_ANONYMOUS ? method.name : 'anonymous'

  // Strip package/class prefix - keep only the method name after the last dot
  const lastDotIndex = methodName.lastIndexOf('.')
  if (lastDotIndex !== -1) {
    methodName = methodName.substring(lastDotIndex + 1)
  }

  // Hide constructors - they're already shown in the title
  if (methodName.toLowerCase() === 'constructor') {
    return ''
  }

  // Format parameters - only names, no types
  const params = method.params
    .map((param) => {
      const paramName = param.name !== TYPESPEC_NODE_ANONYMOUS ? param.name : 'arg'
      const optional = param.isOptional ? '?' : ''
      return `${paramName}${optional}`
    })
    .join(', ')

  return `${methodName}(${params})`
}

Subdomains

Called By

Frequently Asked Questions

What does formatMethodSignature() do?
formatMethodSignature() is a function in the supabase codebase.
What calls formatMethodSignature()?
formatMethodSignature() is called by 1 function(s): FunctionSection.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free