import { Expose , ExposeOptions , Transform , TransformFnParams } from 'class-transformer' ; export function ExposeNested ( options ? ) { const exposeFn = Expose ( options ) ; const transformFn = ( propertyKey ) => Transform ( ( params ) => { return ( ( params . obj && Object . getOwnPropertyDescriptor ( params . obj , propertyKey ) ? params . obj [ propertyKey ] : options ?. default ) || params . value ) ; } ) ; return ( target , propertyKey ) => { transformFn ( propertyKey ) ( target , propertyKey ) ; exposeFn ( target , propertyKey ) ; } ; }