Why doesn't Reflect object have `defineMetadata` and `getOwnMetadata` methods

378 Views Asked by At

I'm looking at this reflect-metadata shim, it shows methods available on Reflect object like Reflect.defineMetadata and Reflect.getOwnMetadata. The MDN page on Reflect object doesn't list these methods. Are those two different Reflect objects?

1

There are 1 best solutions below

0
On

The reflect-metadata package is extending that namespace so by default that method is not available in the original Reflect Prototype but this package is extending those functions in the same API to leverage the benefit of storing metadata.