Socket
Socket
Sign inDemoInstall

vue-class-di

Package Overview
Dependencies
28
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.3 to 1.2.4

2

package.json
{
"name": "vue-class-di",
"version": "1.2.3",
"version": "1.2.4",
"description": "",

@@ -5,0 +5,0 @@ "main": "src/index.ts",

@@ -106,2 +106,10 @@ import { defineComponent, getCurrentInstance, h, inject, InjectionKey, provide } from 'vue-demi'

for (const key in Component) {
if (Object.prototype.hasOwnProperty.call(Component, key)) {
const element = Component[key]
//@ts-ignore
Extended[key] ||= element
}
}
return Extended as any

@@ -215,3 +223,2 @@ }

/**

@@ -223,13 +230,13 @@ * 从当前容器中获取服务

export function injectService<T extends { new (...args: any[]): any }>(
token: T,
notFoundValue?: any
token: T,
notFoundValue?: any
): InstanceType<T> | undefined
export function injectService<T>(
token: string | number | symbol,
notFoundValue?: any
token: string | number | symbol,
notFoundValue?: any
): T | undefined {
const currentInjector = getCurrentInjector()
if (!currentInjector) return notFoundValue
const currentInjector = getCurrentInjector()
if (!currentInjector) return notFoundValue
return currentInjector.get(token, notFoundValue)
return currentInjector.get(token, notFoundValue)
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc