Home / Function/ getAddressEndRange() — supabase Function Reference

getAddressEndRange() — supabase Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.utils.ts lines 37–57

export const getAddressEndRange = (type: 'IPv4' | 'IPv6', address: string) => {
  if (type === 'IPv4') {
    try {
      const cidr = IPv4CidrRange.fromCidr(address)
      const start = cidr.getFirst().octets.join('.')
      const end = cidr.getLast().octets.join('.')
      return { start, end }
    } catch (error: any) {
      return undefined
    }
  } else {
    try {
      const cidr = IPv6CidrRange.fromCidr(address)
      const start = cidr.getFirst().hexadecatet.toString().split(',').map(padHexadecimal).join(':')
      const end = cidr.getLast().hexadecatet.toString().split(',').map(padHexadecimal).join(':')
      return { start, end }
    } catch (error: any) {
      return undefined
    }
  }
}

Subdomains

Frequently Asked Questions

What does getAddressEndRange() do?
getAddressEndRange() is a function in the supabase codebase.
What calls getAddressEndRange()?
getAddressEndRange() 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