Home / Function/ resolveAsset() — vue Function Reference

resolveAsset() — vue Function Reference

Architecture documentation for the resolveAsset() function in options.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  504862fc_412b_2ddd_849e_ed9f8b25641c["resolveAsset()"]
  395cc6b0_6f88_f1b1_f5dd_8cdf5c229777["options.ts"]
  504862fc_412b_2ddd_849e_ed9f8b25641c -->|defined in| 395cc6b0_6f88_f1b1_f5dd_8cdf5c229777
  48bc61b1_05ca_3121_50a7_2f02cdcf2f03["warn()"]
  504862fc_412b_2ddd_849e_ed9f8b25641c -->|calls| 48bc61b1_05ca_3121_50a7_2f02cdcf2f03
  style 504862fc_412b_2ddd_849e_ed9f8b25641c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/util/options.ts lines 466–489

export function resolveAsset(
  options: Record<string, any>,
  type: string,
  id: string,
  warnMissing?: boolean
): any {
  /* istanbul ignore if */
  if (typeof id !== 'string') {
    return
  }
  const assets = options[type]
  // check local registration variations first
  if (hasOwn(assets, id)) return assets[id]
  const camelizedId = camelize(id)
  if (hasOwn(assets, camelizedId)) return assets[camelizedId]
  const PascalCaseId = capitalize(camelizedId)
  if (hasOwn(assets, PascalCaseId)) return assets[PascalCaseId]
  // fallback to prototype chain
  const res = assets[id] || assets[camelizedId] || assets[PascalCaseId]
  if (__DEV__ && warnMissing && !res) {
    warn('Failed to resolve ' + type.slice(0, -1) + ': ' + id)
  }
  return res
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does resolveAsset() do?
resolveAsset() is a function in the vue codebase, defined in src/core/util/options.ts.
Where is resolveAsset() defined?
resolveAsset() is defined in src/core/util/options.ts at line 466.
What does resolveAsset() call?
resolveAsset() calls 1 function(s): warn.

Analyze Your Own Codebase

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

Try Supermodel Free