File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " @fabio.formosa/metamorphosis-nest" ,
3- "version" : " 2.1.1 " ,
3+ "version" : " 2.1.2 " ,
44 "description" : " Conversion service for Nest" ,
55 "main" : " dist/index.js" ,
66 "dependencies" : {
Original file line number Diff line number Diff line change @@ -14,8 +14,10 @@ export class ConversionService {
1414 }
1515
1616 public convert ( sourceObj : any , targetClass :{ new ( ...args : any ) : any } ) : any {
17- if ( sourceObj instanceof mongoose . Model || sourceObj instanceof mongoose . Schema . Types . Embedded || ( sourceObj . constructor && sourceObj . constructor . name == 'SingleNested' ) ) {
18- logger . log ( `CONVERSION SERVICE - Typegoose support - detected sourceObj ${ sourceObj . construct } converting to ${ targetClass } ` ) ;
17+ if ( sourceObj instanceof mongoose . Model || sourceObj instanceof mongoose . Schema . Types . Embedded
18+ || ( sourceObj . constructor && sourceObj . constructor . name == 'EmbeddedDocument' )
19+ || ( sourceObj . constructor && sourceObj . constructor . name == 'SingleNested' ) ) {
20+ logger . log ( `CONVERSION SERVICE - Typegoose support - detected sourceObj ${ sourceObj . constructor . name } converting to ${ targetClass . name } ` ) ;
1921 const actualSourceType = getClass ( sourceObj ) || sourceObj . constructor ;
2022 logger . log ( `CONVERSION SERVICE - Converting from actualSourceType ${ actualSourceType . name } to ${ targetClass . name } ` ) ;
2123 return this . metamorphosisConversionService . convertBySource ( sourceObj , actualSourceType , targetClass ) ;
You can’t perform that action at this time.
0 commit comments