Home / Function/ substituteVars() — supabase Function Reference

substituteVars() — supabase Function Reference

Architecture documentation for the substituteVars() function in Partial.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  e11920c8_cc89_8ce7_7817_2d80408d3b7b["substituteVars()"]
  f759d72f_4789_4f16_671d_55f55b4a2ad9["rewriteNodes()"]
  f759d72f_4789_4f16_671d_55f55b4a2ad9 -->|calls| e11920c8_cc89_8ce7_7817_2d80408d3b7b
  style e11920c8_cc89_8ce7_7817_2d80408d3b7b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/features/directives/Partial.ts lines 130–139

function substituteVars(content: string, vars: Record<string, string> | undefined) {
  if (vars === undefined) {
    return content
  }

  for (const [key, value] of Object.entries(vars)) {
    content = content.replace(new RegExp(`(?<!\\\\)\\{\\{\\s*\\.${key}\\s*\\}\\}`, 'g'), value)
  }
  return content
}

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free