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) => {
78
78
}
79
79
} ;
80
80
81
+ const IGNORED_KEYS = [ 'Symbol(' , '_' , '$' , '#' ] ;
81
82
class Parser {
82
83
resolved = { } ;
83
84
constructor ( data , included = [ ] ) {
@@ -140,9 +141,12 @@ class Parser {
140
141
return true ;
141
142
}
142
143
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
144
return target [ prop ] ;
145
145
}
146
+ const propString = prop . toString ( ) ;
147
+ if ( IGNORED_KEYS . some ( k => propString . startsWith ( k ) ) ) {
148
+ return undefined ;
149
+ }
146
150
debug ( 'error' , `Trying to call property "${ prop . toString ( ) } " to a model that is not included. Add "${ loadedElement . type } " to included models.` ) ;
147
151
return undefined ;
148
152
}
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ debug.adapter = (level, ...args) => {
74
74
}
75
75
} ;
76
76
77
+ const IGNORED_KEYS = [ 'Symbol(' , '_' , '$' , '#' ] ;
77
78
class Parser {
78
79
resolved = { } ;
79
80
constructor ( data , included = [ ] ) {
@@ -136,9 +137,12 @@ class Parser {
136
137
return true ;
137
138
}
138
139
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
140
return target [ prop ] ;
141
141
}
142
+ const propString = prop . toString ( ) ;
143
+ if ( IGNORED_KEYS . some ( k => propString . startsWith ( k ) ) ) {
144
+ return undefined ;
145
+ }
142
146
debug ( 'error' , `Trying to call property "${ prop . toString ( ) } " to a model that is not included. Add "${ loadedElement . type } " to included models.` ) ;
143
147
return undefined ;
144
148
}
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import { Model } from "./Model";
6
6
import { $registeredAttributes , $registeredModels , $registeredRelationships } from "./data" ;
7
7
import { debug } from "./utils" ;
8
8
9
+ const IGNORED_KEYS = [ 'Symbol(' , '_' , '$' , '#' ] ;
10
+
9
11
export class Parser {
10
12
readonly resolved : Record < string , Model > = { } ;
11
13
@@ -95,9 +97,12 @@ export class Parser {
95
97
return true ;
96
98
}
97
99
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
100
return target [ prop ] ;
100
101
}
102
+ const propString = prop . toString ( ) ;
103
+ if ( IGNORED_KEYS . some ( ( k ) => propString . startsWith ( k ) ) ) {
104
+ return undefined ;
105
+ }
101
106
debug ( 'error' , `Trying to call property "${ prop . toString ( ) } " to a model that is not included. Add "${ loadedElement . type } " to included models.` ) ;
102
107
return undefined ;
103
108
} ,
You can’t perform that action at this time.
0 commit comments