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 2a0dcd9 commit 4899187Copy full SHA for 4899187
src/language/__tests__/toJSONDeep.js
@@ -6,7 +6,7 @@ import isObjectLike from '../../jsutils/isObjectLike';
6
* Deeply transforms an arbitrary value to a JSON-safe value by calling toJSON
7
* on any nested value which defines it.
8
*/
9
-export default function toJSONDeep<T>(value: T): T {
+export default function toJSONDeep(value: mixed): mixed {
10
if (!isObjectLike(value)) {
11
return value;
12
}
@@ -20,7 +20,7 @@ export default function toJSONDeep<T>(value: T): T {
20
return value.map(toJSONDeep);
21
22
23
- const result: any = {};
+ const result = Object.create(null);
24
for (const prop of Object.keys(value)) {
25
result[prop] = toJSONDeep(value[prop]);
26
0 commit comments