Home / Function/ sanitizeTaxIdValue() — supabase Function Reference

sanitizeTaxIdValue() — supabase Function Reference

Architecture documentation for the sanitizeTaxIdValue() function in TaxID.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  787b8322_4159_2ec1_90a5_9113923fa0a0["sanitizeTaxIdValue()"]
  1a045fde_de7d_a598_5955_195969fbbafd["useBillingCustomerDataForm()"]
  1a045fde_de7d_a598_5955_195969fbbafd -->|calls| 787b8322_4159_2ec1_90a5_9113923fa0a0
  style 787b8322_4159_2ec1_90a5_9113923fa0a0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/Organization/BillingSettings/BillingCustomerData/TaxID.utils.ts lines 3–14

export const sanitizeTaxIdValue = (taxId: { name: string; value: string }) => {
  const selectedTaxId = TAX_IDS.find((option) => option.name === taxId.name)

  const vatIdPrefix = selectedTaxId?.vatPrefix

  // if the value doesn't start with the prefix, prepend them
  if (vatIdPrefix && !taxId.value.startsWith(vatIdPrefix)) {
    return `${vatIdPrefix}${taxId.value}`
  }

  return taxId.value
}

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free