Home / Function/ fromBranchValue() — supabase Function Reference

fromBranchValue() — supabase Function Reference

Architecture documentation for the fromBranchValue() function in ProjectConfigVariables.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  965ae01b_f498_32bb_fc8b_be1fabbe301c["fromBranchValue()"]
  a18b0675_01e4_91fb_4b0f_69aed0bf085e["BranchSelector()"]
  a18b0675_01e4_91fb_4b0f_69aed0bf085e -->|calls| 965ae01b_f498_32bb_fc8b_be1fabbe301c
  fe42775f_6af4_6072_bcb8_7ca5df94d5da["unescapeDoubleQuotes()"]
  965ae01b_f498_32bb_fc8b_be1fabbe301c -->|calls| fe42775f_6af4_6072_bcb8_7ca5df94d5da
  style 965ae01b_f498_32bb_fc8b_be1fabbe301c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/components/ProjectConfigVariables/ProjectConfigVariables.utils.ts lines 78–90

export function fromBranchValue(maybeBranch: string): [string, string] | [null, null] {
  try {
    // not restoring the double quotes on the branch name is fine because it's only used for
    // command fuzzy search, not for exact/literal matching
    const data = JSON.parse(unescapeDoubleQuotes(maybeBranch))
    if (!Array.isArray(data) || data.length !== 2) {
      throw Error("Shape of parsed JSON doesn't match form of branch value")
    }
    return data as [string, string]
  } catch {
    return [null, null]
  }
}

Subdomains

Called By

Frequently Asked Questions

What does fromBranchValue() do?
fromBranchValue() is a function in the supabase codebase.
What does fromBranchValue() call?
fromBranchValue() calls 1 function(s): unescapeDoubleQuotes.
What calls fromBranchValue()?
fromBranchValue() is called by 1 function(s): BranchSelector.

Analyze Your Own Codebase

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

Try Supermodel Free