@@ -48,7 +48,7 @@ export function getOwnMetadata(metadataKey: MetadataKey, target: Target, propert
4848}
4949
5050export function hasOwnMetadata ( metadataKey : MetadataKey , target : Target , propertyKey ?: PropertyKey ) : boolean {
51- return ordinaryHasOwnMetadata ( metadataKey , target , propertyKey ) ;
51+ return ! ! ordinaryGetOwnMetadata ( metadataKey , target , propertyKey ) ;
5252}
5353
5454function decorateConstructor ( decorators : ClassDecorator [ ] , target : Function ) : Function {
@@ -63,10 +63,7 @@ function decorateConstructor(decorators: ClassDecorator[], target: Function): Fu
6363
6464function decorateProperty ( decorators : MemberDecorator [ ] , target : Target , propertyKey : PropertyKey , descriptor ?: PropertyDescriptor ) : PropertyDescriptor | undefined {
6565 decorators . reverse ( ) . forEach ( ( decorator : MemberDecorator ) => {
66- const decorated = decorator ( target , propertyKey , descriptor ) ;
67- if ( decorated ) {
68- descriptor = decorated ;
69- }
66+ descriptor = decorator ( target , propertyKey , descriptor ) || descriptor ;
7067 } ) ;
7168 return descriptor ;
7269}
@@ -79,18 +76,13 @@ function ordinaryDefineOwnMetadata(metadataKey: MetadataKey, metadataValue: Meta
7976}
8077
8178function ordinaryGetMetadata ( metadataKey : MetadataKey , target : Target , propertyKey ?: PropertyKey ) : Function | undefined {
82- return ordinaryHasOwnMetadata ( metadataKey , target , propertyKey )
79+ return ! ! ordinaryGetOwnMetadata ( metadataKey , target , propertyKey )
8380 ? ordinaryGetOwnMetadata ( metadataKey , target , propertyKey )
8481 : Object . getPrototypeOf ( target )
8582 ? ordinaryGetMetadata ( metadataKey , Object . getPrototypeOf ( target ) , propertyKey )
8683 : undefined ;
8784}
8885
89- function ordinaryHasOwnMetadata ( metadataKey : MetadataKey , target : Target , propertyKey ?: PropertyKey ) : boolean {
90- const metadataMap = getMetadataMap ( target , propertyKey ) ;
91- return ! ! metadataMap && ! ! metadataMap . has ( metadataKey ) ;
92- }
93-
9486function ordinaryGetOwnMetadata ( metadataKey : MetadataKey , target : Target , propertyKey ?: PropertyKey ) : Function | undefined {
9587 if ( target === undefined ) throw new TypeError ( ) ;
9688 const metadataMap = getMetadataMap ( target , propertyKey ) ;
0 commit comments