File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ debug.adapter = (level, ...args) => {
7878 }
7979} ;
8080
81+ const IGNORED_KEYS = [ 'Symbol(' , '_' , '$' , '#' ] ;
8182class Parser {
8283 resolved = { } ;
8384 constructor ( data , included = [ ] ) {
@@ -140,9 +141,12 @@ class Parser {
140141 return true ;
141142 }
142143 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?` ) ;
144144 return target [ prop ] ;
145145 }
146+ const propString = prop . toString ( ) ;
147+ if ( IGNORED_KEYS . some ( k => propString . startsWith ( k ) ) ) {
148+ return undefined ;
149+ }
146150 debug ( 'error' , `Trying to call property "${ prop . toString ( ) } " to a model that is not included. Add "${ loadedElement . type } " to included models.` ) ;
147151 return undefined ;
148152 }
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ debug.adapter = (level, ...args) => {
7474 }
7575} ;
7676
77+ const IGNORED_KEYS = [ 'Symbol(' , '_' , '$' , '#' ] ;
7778class Parser {
7879 resolved = { } ;
7980 constructor ( data , included = [ ] ) {
@@ -136,9 +137,12 @@ class Parser {
136137 return true ;
137138 }
138139 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?` ) ;
140140 return target [ prop ] ;
141141 }
142+ const propString = prop . toString ( ) ;
143+ if ( IGNORED_KEYS . some ( k => propString . startsWith ( k ) ) ) {
144+ return undefined ;
145+ }
142146 debug ( 'error' , `Trying to call property "${ prop . toString ( ) } " to a model that is not included. Add "${ loadedElement . type } " to included models.` ) ;
143147 return undefined ;
144148 }
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import { Model } from "./Model";
66import { $registeredAttributes , $registeredModels , $registeredRelationships } from "./data" ;
77import { debug } from "./utils" ;
88
9+ const IGNORED_KEYS = [ 'Symbol(' , '_' , '$' , '#' ] ;
10+
911export class Parser {
1012 readonly resolved : Record < string , Model > = { } ;
1113
@@ -95,9 +97,12 @@ export class Parser {
9597 return true ;
9698 }
9799 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?` ) ;
99100 return target [ prop ] ;
100101 }
102+ const propString = prop . toString ( ) ;
103+ if ( IGNORED_KEYS . some ( ( k ) => propString . startsWith ( k ) ) ) {
104+ return undefined ;
105+ }
101106 debug ( 'error' , `Trying to call property "${ prop . toString ( ) } " to a model that is not included. Add "${ loadedElement . type } " to included models.` ) ;
102107 return undefined ;
103108 } ,
You can’t perform that action at this time.
0 commit comments