Home / Function/ normalize() — supabase Function Reference

normalize() — supabase Function Reference

Architecture documentation for the normalize() function in NetworkRestrictions.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  24a9d585_11ec_2bea_6a58_468a861991a9["normalize()"]
  4ff86e27_10bd_51fe_bb6f_c71cd9f5b6f7["AddRestrictionModal()"]
  4ff86e27_10bd_51fe_bb6f_c71cd9f5b6f7 -->|calls| 24a9d585_11ec_2bea_6a58_468a861991a9
  style 24a9d585_11ec_2bea_6a58_468a861991a9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.utils.ts lines 61–74

export const normalize = (address: string) => {
  const [isIpV4] = Validator.isValidIPv4String(address.split('/')[0])
  if (isIpV4) {
    const cidr = IPv4CidrRange.fromCidr(address)
    const base = cidr.getFirst().toString()
    const mask = cidr.getPrefix().toString()
    return `${base}/${mask}`
  } else {
    const cidr = IPv6CidrRange.fromCidr(address)
    const base = collapseIPv6Number(cidr.getFirst().toString())
    const mask = cidr.getPrefix().toString()
    return `${base}/${mask}`
  }
}

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free