Reflect.js
function getOwnMetadataKeys(target, propertyKey) {
            if (!IsObject(target))
                throw new TypeError();
            if (!IsUndefined(propertyKey))
                propertyKey = ToPropertyKey(propertyKey);
            return OrdinaryOwnMetadataKeys(target, propertyKey);
        }
function getOwnMetadataKeys(target, propertyKey) {
            if (!IsObject(target))
                throw new TypeError();
            if (!IsUndefined(propertyKey))
                propertyKey = ToPropertyKey(propertyKey);
            return OrdinaryOwnMetadataKeys(target, propertyKey);
        }
Gets the unique metadata keys defined on the target object.
@param target The target object on which the metadata is defined.
@param propertyKey (Optional) The property key for the target.
@returns An array of unique metadata keys.
@example

class Example {
// property declarations are not part of ES6, though they are valid in TypeScript:
// static staticProperty;
// property;

constructor(p) { }
static staticMethod(p) { }
method(p) { }
}

// constructor
result = Reflect.getOwnMetadataKeys(Example);

// property (on constructor)
result = Reflect.getOwnMetadataKeys(Example, "staticProperty");

// property (on prototype)
result = Reflect.getOwnMetadataKeys(Example.prototype, "property");

// method (on constructor)
result = Reflect.getOwnMetadataKeys(Example, "staticMethod");

// method (on prototype)
result = Reflect.getOwnMetadataKeys(Example.prototype, "method");