Home / File/ inject-test.ts — vue Source File

inject-test.ts — vue Source File

Architecture documentation for inject-test.ts, a typescript file in the vue codebase. 4 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  c3a54bde_4d08_41e5_024f_8afb54059c58["inject-test.ts"]
  09422b63_6947_479f_f3b8_a48790187388["./index"]
  c3a54bde_4d08_41e5_024f_8afb54059c58 --> 09422b63_6947_479f_f3b8_a48790187388
  640c5630_c924_297a_b265_64ad36b365b4["utils.ts"]
  c3a54bde_4d08_41e5_024f_8afb54059c58 --> 640c5630_c924_297a_b265_64ad36b365b4
  526bbcde_5613_9f1a_1c80_ab1e7061c667["expectType"]
  c3a54bde_4d08_41e5_024f_8afb54059c58 --> 526bbcde_5613_9f1a_1c80_ab1e7061c667
  ae6eb6a4_c3be_68e2_81f6_f67b97a4ccd3["expectType"]
  c3a54bde_4d08_41e5_024f_8afb54059c58 --> ae6eb6a4_c3be_68e2_81f6_f67b97a4ccd3
  style c3a54bde_4d08_41e5_024f_8afb54059c58 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { InjectionKey, provide, inject } from '../../index'
import { expectType } from '../utils'

const key: InjectionKey<number> = Symbol()

provide(key, 1)
// @ts-expect-error
provide(key, 'foo')

expectType<number | undefined>(inject(key))
expectType<number>(inject(key, 1))
expectType<number>(inject(key, () => 1, true /* treatDefaultAsFactory */))

expectType<() => number>(inject('foo', () => 1))
expectType<() => number>(inject('foo', () => 1, false))
expectType<number>(inject('foo', () => 1, true))

Domain

Dependencies

Frequently Asked Questions

What does inject-test.ts do?
inject-test.ts is a source file in the vue codebase, written in typescript. It belongs to the CompilerSFC domain.
What does inject-test.ts depend on?
inject-test.ts imports 4 module(s): ./index, expectType, expectType, utils.ts.
Where is inject-test.ts in the architecture?
inject-test.ts is located at types/test/v3/inject-test.ts (domain: CompilerSFC, directory: types/test/v3).

Analyze Your Own Codebase

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

Try Supermodel Free