Skip to content

Commit

Permalink
make create paste work with big int
Browse files Browse the repository at this point in the history
Summary: the network plugin can create big ints so using create paste from data table context menu was failing

Reviewed By: antonk52

Differential Revision: D63977460

fbshipit-source-id: bdf176f8fd5e1ec2d2cb4980004d5e126e5ed06d
  • Loading branch information
Luke De Feo authored and facebook-github-bot committed Oct 7, 2024
1 parent 154910a commit 17dd95d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion desktop/flipper-plugin/src/utils/safeStringify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

export function safeStringify(value: any, space: number = 2) {
try {
return JSON.stringify(value, null, space);
return JSON.stringify(
value,
(_, v) => (typeof v === 'bigint' ? v.toString() : v),
space,
);
} catch (e) {
return `<Failed to serialize: ${e}>`;
}
Expand Down

0 comments on commit 17dd95d

Please sign in to comment.