Home / Function/ findClosingParen() — vite Function Reference

findClosingParen() — vite Function Reference

Architecture documentation for the findClosingParen() function in workerImportMetaUrl.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  27cfa263_1da2_277d_659e_15cddfc4a68f["findClosingParen()"]
  f241296c_aba8_08ac_c4f9_aed85a9eb247["workerImportMetaUrl.ts"]
  27cfa263_1da2_277d_659e_15cddfc4a68f -->|defined in| f241296c_aba8_08ac_c4f9_aed85a9eb247
  fcb9c288_b3dc_c5f2_7476_d243d97d0e75["getWorkerType()"]
  fcb9c288_b3dc_c5f2_7476_d243d97d0e75 -->|calls| 27cfa263_1da2_277d_659e_15cddfc4a68f
  style 27cfa263_1da2_277d_659e_15cddfc4a68f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/plugins/workerImportMetaUrl.ts lines 30–40

function findClosingParen(input: string, fromIndex: number) {
  let count = 1

  for (let i = fromIndex; i < input.length; i++) {
    if (input[i] === '(') count++
    if (input[i] === ')') count--
    if (count === 0) return i
  }

  return -1
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does findClosingParen() do?
findClosingParen() is a function in the vite codebase, defined in packages/vite/src/node/plugins/workerImportMetaUrl.ts.
Where is findClosingParen() defined?
findClosingParen() is defined in packages/vite/src/node/plugins/workerImportMetaUrl.ts at line 30.
What calls findClosingParen()?
findClosingParen() is called by 1 function(s): getWorkerType.

Analyze Your Own Codebase

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

Try Supermodel Free