Home / Function/ tryFormatInitialValue() — supabase Function Reference

tryFormatInitialValue() — supabase Function Reference

Architecture documentation for the tryFormatInitialValue() function in JsonEditor.tsx from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  ba33b09c_bc18_30d6_2ff3_8b87e531dcd1["tryFormatInitialValue()"]
  50bc62ef_1d39_0ed0_7e0c_1bec2d8d5b85["JsonEditor()"]
  50bc62ef_1d39_0ed0_7e0c_1bec2d8d5b85 -->|calls| ba33b09c_bc18_30d6_2ff3_8b87e531dcd1
  style ba33b09c_bc18_30d6_2ff3_8b87e531dcd1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/grid/components/editor/JsonEditor.tsx lines 34–45

const tryFormatInitialValue = (value: string) => {
  try {
    const jsonValue = JSON.parse(value)
    return JSON.stringify(jsonValue)
  } catch (err) {
    if (typeof value === 'string') {
      return value.replaceAll(`\"`, `"`)
    } else {
      return JSON.stringify(value)
    }
  }
}

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free