We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7fcb60d commit 49734e6Copy full SHA for 49734e6
packages/wrap/src/transforms/WrapQuery.ts
@@ -87,11 +87,18 @@ export default class WrapQuery<TContext = Record<string, any>>
87
const path = [...this.path];
88
while (path.length > 1) {
89
const next = path.shift()!;
90
+ if (next === '__proto__' || next === 'constructor' || next === 'prototype') {
91
+ throw new Error('Invalid path key');
92
+ }
93
if (data[next]) {
94
data = data[next];
95
}
96
- data[path[0]!] = this.extractor(data[path[0]!]);
97
+ const lastKey = path[0]!;
98
+ if (lastKey === '__proto__' || lastKey === 'constructor' || lastKey === 'prototype') {
99
100
101
+ data[lastKey] = this.extractor(data[lastKey]);
102
103
104
return {
0 commit comments