@samitouri / QOS-React / commits / d9a5170594

fix: check bigint in serializeToString and change it to string (#17931)

Farhad Yasir committed Feb 1, 2020 at 09:36 UTC d9a5170594486deeb767c243cc4b381e9e085c79
2 files changed +7
packages/react-devtools-shared/src/backend/utils.js
+4
@@ -81,6 +81,10 @@ export function serializeToString(data: any): string {
81 }
82 cache.add(value);
83 }
84 + // $FlowFixMe
85 + if (typeof value === 'bigint') {
86 + return value.toString() + 'n';
87 + }
88 return value;
89 });
90 }
packages/react-devtools-shell/src/app/InspectableElements/UnserializableProps.js
+3
@@ -31,6 +31,8 @@ const immutable = Immutable.fromJS({
31 xyz: 1,
32 },
33 });
34 +// $FlowFixMe
35 +const bigInt = BigInt(123); // eslint-disable-line no-undef
36
37 export default function UnserializableProps() {
38 return (
@@ -43,6 +45,7 @@ export default function UnserializableProps() {
45 setOfSets={setOfSets}
46 typedArray={typedArray}
47 immutable={immutable}
48 + bigInt={bigInt}
49 />
50 );
51 }