export const paramMetadataKey = Symbol ( "param" ) ; import { Reflection as Reflect } from '@abraham/reflection' ; export function param ( props ? ) { return Reflect . metadata ( paramMetadataKey , props . name ) ; } export function defaultParam ( ) { return registerDefaultParamProperty ; } function registerDefaultParamProperty ( target , propertyKey ) { let properties = Reflect . getMetadata ( paramMetadataKey , target ) ; if ( properties ) { properties . push ( propertyKey ) ; } else { properties = [ propertyKey ] ; Reflect . defineMetadata ( paramMetadataKey , properties , target ) ; } } export function getDefaultParamProperties ( origin ) { const properties = Reflect . getMetadata ( paramMetadataKey , origin ) ; const result = { } ; properties . forEach ( key => result [ key ] = origin [ key ] ) ; return result ; } export const ignoreMetadataKey = Symbol ( "param" ) ; export function ignore ( ) { return registerIgnoreFieldProperty ; } function registerIgnoreFieldProperty ( target , propertyKey ) { let properties = Reflect . getMetadata ( ignoreMetadataKey , target ) ; if ( properties ) { properties . push ( propertyKey ) ; } else { properties = [ propertyKey ] ; Reflect . defineMetadata ( ignoreMetadataKey , properties , target ) ; } } export function getIgnoreProperties ( origin ) { const properties = Reflect . getMetadata ( ignoreMetadataKey , origin ) ; const result = { } ; properties . forEach ( key => result [ key ] = origin [ key ] ) ; return result ; }