injectSelf.mjs 438 B

1234567891011121314
  1. // Utilities
  2. import { getCurrentInstance } from "./getCurrentInstance.mjs"; // Types
  3. export function injectSelf(key) {
  4. let vm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentInstance('injectSelf');
  5. const {
  6. provides
  7. } = vm;
  8. if (provides && key in provides) {
  9. // TS doesn't allow symbol as index type
  10. return provides[key];
  11. }
  12. return undefined;
  13. }
  14. //# sourceMappingURL=injectSelf.mjs.map