Home / Function/ loadGuides() — supabase Function Reference

loadGuides() — supabase Function Reference

Architecture documentation for the loadGuides() function in guideModelLoader.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  cb5b1bc9_56b5_9240_6bd2_f1b8c5f0e6a7["loadGuides()"]
  35b58177_96a8_a8b9_6670_b3063b6cc9c7["allFromFs()"]
  35b58177_96a8_a8b9_6670_b3063b6cc9c7 -->|calls| cb5b1bc9_56b5_9240_6bd2_f1b8c5f0e6a7
  eb1b33c7_935b_b61a_962a_2e11b76d01bc["fromFs()"]
  cb5b1bc9_56b5_9240_6bd2_f1b8c5f0e6a7 -->|calls| eb1b33c7_935b_b61a_962a_2e11b76d01bc
  040a5796_eb59_9ff7_60d0_b127fcaa25c2["map()"]
  cb5b1bc9_56b5_9240_6bd2_f1b8c5f0e6a7 -->|calls| 040a5796_eb59_9ff7_60d0_b127fcaa25c2
  6b6adaac_18fc_5147_3872_082ddf2861ce["appendError()"]
  cb5b1bc9_56b5_9240_6bd2_f1b8c5f0e6a7 -->|calls| 6b6adaac_18fc_5147_3872_082ddf2861ce
  f0cb3c6d_e823_6f6f_b9a4_ab144fc70aa5["extractMessageFromAnyError()"]
  cb5b1bc9_56b5_9240_6bd2_f1b8c5f0e6a7 -->|calls| f0cb3c6d_e823_6f6f_b9a4_ab144fc70aa5
  style cb5b1bc9_56b5_9240_6bd2_f1b8c5f0e6a7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/resources/guide/guideModelLoader.ts lines 159–186

  private static async loadGuides(
    filePaths: Array<string>,
    multiError: { current: MultiError | null }
  ): Promise<Array<GuideModel>> {
    const loadPromises = filePaths.map(async (filePath) => {
      const relPath = relative(GUIDES_DIRECTORY, filePath)
      return this.fromFs(relPath)
    })

    const results = await Promise.all(loadPromises)
    const guides: Array<GuideModel> = []

    results.forEach((result, index) => {
      const relPath = relative(GUIDES_DIRECTORY, filePaths[index])

      result.match(
        (guide) => guides.push(guide),
        (error) => {
          ;(multiError.current ??= new MultiError('Failed to load some guides:')).appendError(
            `Failed to load ${relPath}: ${extractMessageFromAnyError(error)}`,
            error
          )
        }
      )
    })

    return guides
  }

Subdomains

Called By

Frequently Asked Questions

What does loadGuides() do?
loadGuides() is a function in the supabase codebase.
What does loadGuides() call?
loadGuides() calls 4 function(s): appendError, extractMessageFromAnyError, fromFs, map.
What calls loadGuides()?
loadGuides() is called by 1 function(s): allFromFs.

Analyze Your Own Codebase

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

Try Supermodel Free