Home / Function/ bailType() — vue Function Reference

bailType() — vue Function Reference

Architecture documentation for the bailType() function in reactivity-test.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  f716b1d9_2c18_38af_9c29_79a7def570d3["bailType()"]
  b4eae887_aae6_b3d1_59a1_c048a1e8c568["reactivity-test.ts"]
  f716b1d9_2c18_38af_9c29_79a7def570d3 -->|defined in| b4eae887_aae6_b3d1_59a1_c048a1e8c568
  style f716b1d9_2c18_38af_9c29_79a7def570d3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

types/test/v3/reactivity-test.ts lines 81–100

function bailType(arg: HTMLElement | Ref<HTMLElement>) {
  // ref coercing
  const coerced = ref(arg)
  expectType<Ref<HTMLElement>>(coerced)

  // isRef as type guard
  if (isRef(arg)) {
    expectType<Ref<HTMLElement>>(arg)
  }

  // ref unwrapping
  expectType<HTMLElement>(unref(arg))

  // ref inner type should be unwrapped
  // eslint-disable-next-line no-restricted-globals
  const nestedRef = ref({ foo: ref(document.createElement('DIV')) })

  expectType<Ref<{ foo: HTMLElement }>>(nestedRef)
  expectType<{ foo: HTMLElement }>(nestedRef.value)
}

Domain

Subdomains

Frequently Asked Questions

What does bailType() do?
bailType() is a function in the vue codebase, defined in types/test/v3/reactivity-test.ts.
Where is bailType() defined?
bailType() is defined in types/test/v3/reactivity-test.ts at line 81.

Analyze Your Own Codebase

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

Try Supermodel Free