Skip to content

Commit

Permalink
Use base 10 for better debuggability
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Mar 28, 2023
1 parent fa40187 commit 849adf3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/react-client/src/ReactFlightClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ export function parseModelString(
}
case 'n': {
// BigInt
return BigInt('0x' + value.substring(2));
return BigInt(value.substring(2));
}
default: {
// We assume that anything else is a reference ID.
Expand Down
2 changes: 1 addition & 1 deletion packages/react-client/src/ReactFlightReplyClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function serializeUndefined(): string {
}

function serializeBigInt(n: bigint): string {
return '$n' + n.toString(16);
return '$n' + n.toString(10);
}

function escapeStringValue(value: string): string {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-server/src/ReactFlightReplyServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ function parseModelString(
}
case 'n': {
// BigInt
return BigInt('0x' + value.substring(2));
return BigInt(value.substring(2));
}
default: {
// We assume that anything else is a reference ID.
Expand Down
2 changes: 1 addition & 1 deletion packages/react-server/src/ReactFlightServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ function serializeUndefined(): string {
}

function serializeBigInt(n: bigint): string {
return '$n' + n.toString(16);
return '$n' + n.toString(10);
}

function serializeClientReference(
Expand Down

0 comments on commit 849adf3

Please sign in to comment.