How to use the @abraham/reflection.getMetadata function in @abraham/reflection

To help you get started, we’ve selected a few @abraham/reflection examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Hotell / rea-di / src / __tests__ / components / provide-inject.spec.tsx View on Github external
it(`should add metadata only once via wrapper`, () => {
      expect(getMetadata(metadataKey, Engine)).toEqual(undefined)

      const DecoratedEngine = optional(Engine)
      const OriginalEngine = ((DecoratedEngine as any) as () => typeof Engine)()

      expect(getMetadata(metadataKey, DecoratedEngine!)).toEqual({
        optional: true,
      })
      expect(getMetadata(metadataKey, Engine)).toEqual(undefined)
      expect(getMetadata(metadataKey, OriginalEngine)).toEqual(undefined)
      expect(OriginalEngine).toBe(Engine)
    })
github Hotell / rea-di / src / __tests__ / components / provide-inject.spec.tsx View on Github external
it(`should add metadata only once via wrapper`, () => {
      expect(getMetadata(metadataKey, Engine)).toEqual(undefined)

      const DecoratedEngine = optional(Engine)
      const OriginalEngine = ((DecoratedEngine as any) as () => typeof Engine)()

      expect(getMetadata(metadataKey, DecoratedEngine!)).toEqual({
        optional: true,
      })
      expect(getMetadata(metadataKey, Engine)).toEqual(undefined)
      expect(getMetadata(metadataKey, OriginalEngine)).toEqual(undefined)
      expect(OriginalEngine).toBe(Engine)
    })
github Hotell / rea-di / src / __tests__ / components / provide-inject.spec.tsx View on Github external
it(`should add metadata only once via wrapper`, () => {
      expect(getMetadata(metadataKey, Engine)).toEqual(undefined)

      const DecoratedEngine = optional(Engine)
      const OriginalEngine = ((DecoratedEngine as any) as () => typeof Engine)()

      expect(getMetadata(metadataKey, DecoratedEngine!)).toEqual({
        optional: true,
      })
      expect(getMetadata(metadataKey, Engine)).toEqual(undefined)
      expect(getMetadata(metadataKey, OriginalEngine)).toEqual(undefined)
      expect(OriginalEngine).toBe(Engine)
    })

@abraham/reflection

Lightweight ES Module implementation of reflect-metadata

MIT
Latest version published 1 year ago

Package Health Score

64 / 100
Full package analysis