Home / Function/ parseType() — supabase Function Reference

parseType() — supabase Function Reference

Architecture documentation for the parseType() function in Reference.typeSpec.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  ba4cce53_051e_d69f_25a4_55d567b053b3["parseType()"]
  ba929624_b9f4_b767_ce03_d9523a729ce8["parseVariable()"]
  ba929624_b9f4_b767_ce03_d9523a729ce8 -->|calls| ba4cce53_051e_d69f_25a4_55d567b053b3
  0ebbf781_9122_475b_4149_017f2ce9e2eb["parseSignature()"]
  0ebbf781_9122_475b_4149_017f2ce9e2eb -->|calls| ba4cce53_051e_d69f_25a4_55d567b053b3
  a332c905_4ed4_b6ac_e01a_4884e6eb498f["delegateParsing()"]
  a332c905_4ed4_b6ac_e01a_4884e6eb498f -->|calls| ba4cce53_051e_d69f_25a4_55d567b053b3
  646c7617_33a5_8c5a_0a94_60c585380205["parseConditionalType()"]
  646c7617_33a5_8c5a_0a94_60c585380205 -->|calls| ba4cce53_051e_d69f_25a4_55d567b053b3
  fb700c5e_f2ad_0d4a_eeb3_3a30e4641ed9["parseReferenceType()"]
  fb700c5e_f2ad_0d4a_eeb3_3a30e4641ed9 -->|calls| ba4cce53_051e_d69f_25a4_55d567b053b3
  9f7b640c_e5ef_fffe_1cab_7e84ebdbfb4e["parseArrayType()"]
  9f7b640c_e5ef_fffe_1cab_7e84ebdbfb4e -->|calls| ba4cce53_051e_d69f_25a4_55d567b053b3
  0e76194d_bc4e_32e5_3703_ff787d5e6506["parseUnionType()"]
  0e76194d_bc4e_32e5_3703_ff787d5e6506 -->|calls| ba4cce53_051e_d69f_25a4_55d567b053b3
  631d0381_6b79_8c3d_38e4_afc9293b54b3["parseRecordType()"]
  631d0381_6b79_8c3d_38e4_afc9293b54b3 -->|calls| ba4cce53_051e_d69f_25a4_55d567b053b3
  c156f968_9bbd_a682_ae7b_67b0fd9615bc["parsePromiseType()"]
  c156f968_9bbd_a682_ae7b_67b0fd9615bc -->|calls| ba4cce53_051e_d69f_25a4_55d567b053b3
  66cf9bd2_2d9e_7ce9_7394_95c0d7b0ec67["parsePickType()"]
  66cf9bd2_2d9e_7ce9_7394_95c0d7b0ec67 -->|calls| ba4cce53_051e_d69f_25a4_55d567b053b3
  d92b9cf8_5353_8348_7da5_f0a2ee5203bc["parseTypeLiteral()"]
  d92b9cf8_5353_8348_7da5_f0a2ee5203bc -->|calls| ba4cce53_051e_d69f_25a4_55d567b053b3
  a5cc9a31_80eb_5e7f_c7c6_161be0f61787["parseTypeOperatorType()"]
  a5cc9a31_80eb_5e7f_c7c6_161be0f61787 -->|calls| ba4cce53_051e_d69f_25a4_55d567b053b3
  36cc7948_235b_7eb1_80a2_01fd4cf266cf["parseInternalProperty()"]
  36cc7948_235b_7eb1_80a2_01fd4cf266cf -->|calls| ba4cce53_051e_d69f_25a4_55d567b053b3
  fb700c5e_f2ad_0d4a_eeb3_3a30e4641ed9["parseReferenceType()"]
  ba4cce53_051e_d69f_25a4_55d567b053b3 -->|calls| fb700c5e_f2ad_0d4a_eeb3_3a30e4641ed9
  9f7b640c_e5ef_fffe_1cab_7e84ebdbfb4e["parseArrayType()"]
  ba4cce53_051e_d69f_25a4_55d567b053b3 -->|calls| 9f7b640c_e5ef_fffe_1cab_7e84ebdbfb4e
  0e76194d_bc4e_32e5_3703_ff787d5e6506["parseUnionType()"]
  ba4cce53_051e_d69f_25a4_55d567b053b3 -->|calls| 0e76194d_bc4e_32e5_3703_ff787d5e6506
  5bbc223c_f2f3_bb5d_0506_1f8279332a2d["parseReflectionType()"]
  ba4cce53_051e_d69f_25a4_55d567b053b3 -->|calls| 5bbc223c_f2f3_bb5d_0506_1f8279332a2d
  style ba4cce53_051e_d69f_25a4_55d567b053b3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/features/docs/Reference.typeSpec.ts lines 585–622

function parseType(type: any, map: Map<number, any>, typeArguments?: any, debug = false) {
  switch (type.type) {
    case 'literal':
      return type
    case 'intrinsic':
      return type
    case 'reference':
      return parseReferenceType(type, map, typeArguments, debug)
    case 'array':
      return parseArrayType(type, map, typeArguments, debug)
    case 'union':
      return parseUnionType(type, map, typeArguments, debug)
    case 'reflection':
      return parseReflectionType(type, map, typeArguments, debug)
    case 'indexedAccess':
      return parseIndexedAccessType(type, map, typeArguments, debug)
    case 'typeOperator':
      return parseTypeOperatorType(type, map, typeArguments, debug)
    case 'conditional':
      return parseConditionalType(type, map, typeArguments, debug)
    default:
      break
  }

  // Some nested types are wrapped in a kind node
  switch (type.kindString) {
    case 'Type alias':
      if (typeof type.type === 'object') {
        return parseType(type.type, map, typeArguments)
      }
    case 'Interface':
      return parseInterface(type, map, typeArguments)
    default:
      break
  }

  return undefined
}

Subdomains

Frequently Asked Questions

What does parseType() do?
parseType() is a function in the supabase codebase.
What does parseType() call?
parseType() calls 8 function(s): parseArrayType, parseConditionalType, parseIndexedAccessType, parseInterface, parseReferenceType, parseReflectionType, parseTypeOperatorType, parseUnionType.
What calls parseType()?
parseType() is called by 13 function(s): delegateParsing, parseArrayType, parseConditionalType, parseInternalProperty, parsePickType, parsePromiseType, parseRecordType, parseReferenceType, and 5 more.

Analyze Your Own Codebase

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

Try Supermodel Free