Home / Function/ isImportUsed() — vue Function Reference

isImportUsed() — vue Function Reference

Architecture documentation for the isImportUsed() function in compileScript.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  da2f5c14_8623_685a_a52f_77d53de34be4["isImportUsed()"]
  af57cd20_c4ce_0877_c02c_52056ca04d4a["compileScript()"]
  af57cd20_c4ce_0877_c02c_52056ca04d4a -->|calls| da2f5c14_8623_685a_a52f_77d53de34be4
  b31e5b26_32b1_8a91_cb54_b4b50934e2ba["hmrShouldReload()"]
  b31e5b26_32b1_8a91_cb54_b4b50934e2ba -->|calls| da2f5c14_8623_685a_a52f_77d53de34be4
  cb40d1fd_2ff1_986b_17b9_664308ced21f["resolveTemplateUsageCheckString()"]
  da2f5c14_8623_685a_a52f_77d53de34be4 -->|calls| cb40d1fd_2ff1_986b_17b9_664308ced21f
  style da2f5c14_8623_685a_a52f_77d53de34be4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/compiler-sfc/src/compileScript.ts lines 1879–1889

function isImportUsed(
  local: string,
  sfc: SFCDescriptor,
  isTS: boolean
): boolean {
  return new RegExp(
    // #4274 escape $ since it's a special char in regex
    // (and is the only regex special char that is valid in identifiers)
    `[^\\w$_]${local.replace(/\$/g, '\\$')}[^\\w$_]`
  ).test(resolveTemplateUsageCheckString(sfc, isTS))
}

Domain

Subdomains

Frequently Asked Questions

What does isImportUsed() do?
isImportUsed() is a function in the vue codebase.
What does isImportUsed() call?
isImportUsed() calls 1 function(s): resolveTemplateUsageCheckString.
What calls isImportUsed()?
isImportUsed() is called by 2 function(s): compileScript, hmrShouldReload.

Analyze Your Own Codebase

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

Try Supermodel Free