Skip to content

Commit

Permalink
Use typeof BigInt to check for BigInt support (#488)
Browse files Browse the repository at this point in the history
fixes #486

---------

Co-authored-by: Steve Ayers <sayers@buf.build>
  • Loading branch information
lukasIO and smaye81 authored Jun 12, 2023
1 parent fb74adc commit f955b29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/protobuf-bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ server would usually do.

| code generator | bundle size | minified | compressed |
|---------------------|------------------------:|-----------------------:|-------------------:|
| protobuf-es | 87,781 b | 37,518 b | 9,782 b |
| protobuf-es | 87,781 b | 37,517 b | 9,777 b |
| protobuf-javascript | 394,384 b | 288,761 b | 45,123 b |
2 changes: 1 addition & 1 deletion packages/protobuf/src/proto-int64.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function makeInt64Support(): Int64Support {
const dv = new DataView(new ArrayBuffer(8));
// note that Safari 14 implements BigInt, but not the DataView methods
const ok =
(globalThis.BigInt as unknown) !== undefined &&
typeof BigInt === "function" &&
typeof dv.getBigInt64 === "function" &&
typeof dv.getBigUint64 === "function" &&
typeof dv.setBigInt64 === "function" &&
Expand Down

0 comments on commit f955b29

Please sign in to comment.