// Utilities import { getCurrentInstance } from '@/utils/getCurrentInstance' // Types import type { InjectionKey } from 'vue' export function injectSelf(key: InjectionKey | string): T | undefined export function injectSelf(key: InjectionKey | string) { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore const { provides } = getCurrentInstance('injectSelf') if (provides && (key as string | symbol) in provides) { // TS doesn't allow symbol as index type return provides[key as string] } }