File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -136,12 +136,13 @@ class Parser {
136136 if ( loadedElement . $_partial ) {
137137 return new Proxy ( instance , {
138138 get : function ( target , prop ) {
139- if ( prop in target ) {
140- return target [ prop ] ;
141- }
142139 if ( prop === "$_partial" ) {
143140 return true ;
144141 }
142+ if ( prop in target ) {
143+ debug ( 'warn' , `Trying to call property ${ prop . toString ( ) } to a model that is not included ("${ loadedElement . type } "). Maybe you mean't to include it?` ) ;
144+ return target [ prop ] ;
145+ }
145146 debug ( 'error' , `Trying to call property "${ prop . toString ( ) } " to a model that is not included. Add "${ loadedElement . type } " to included models.` ) ;
146147 return undefined ;
147148 }
Original file line number Diff line number Diff line change @@ -132,12 +132,13 @@ class Parser {
132132 if ( loadedElement . $_partial ) {
133133 return new Proxy ( instance , {
134134 get : function ( target , prop ) {
135- if ( prop in target ) {
136- return target [ prop ] ;
137- }
138135 if ( prop === "$_partial" ) {
139136 return true ;
140137 }
138+ if ( prop in target ) {
139+ debug ( 'warn' , `Trying to call property ${ prop . toString ( ) } to a model that is not included ("${ loadedElement . type } "). Maybe you mean't to include it?` ) ;
140+ return target [ prop ] ;
141+ }
141142 debug ( 'error' , `Trying to call property "${ prop . toString ( ) } " to a model that is not included. Add "${ loadedElement . type } " to included models.` ) ;
142143 return undefined ;
143144 }
Original file line number Diff line number Diff line change @@ -91,12 +91,13 @@ export class Parser {
9191 instance ,
9292 {
9393 get : function < T extends object > ( target : T , prop : keyof T ) {
94- if ( prop in target ) {
95- return target [ prop ] ;
96- }
9794 if ( prop === "$_partial" ) {
9895 return true ;
9996 }
97+ if ( prop in target ) {
98+ debug ( 'warn' , `Trying to call property ${ prop . toString ( ) } to a model that is not included ("${ loadedElement . type } "). Maybe you mean't to include it?` ) ;
99+ return target [ prop ] ;
100+ }
100101 debug ( 'error' , `Trying to call property "${ prop . toString ( ) } " to a model that is not included. Add "${ loadedElement . type } " to included models.` ) ;
101102 return undefined ;
102103 } ,
You can’t perform that action at this time.
0 commit comments