Skip to content

Commit

Permalink
Continue to use utils for globalThis
Browse files Browse the repository at this point in the history
  • Loading branch information
timostamm committed Jun 7, 2024
1 parent 8ee95c0 commit 3a4e199
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,10 @@ function makeLongUtils(options: Options, bytes: ReturnType<typeof makeByteUtils>
"longToNumber",
code`
function longToNumber(long: ${Long}): number {
if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
if (long.gt(${bytes.globalThis}.Number.MAX_SAFE_INTEGER)) {
throw new ${bytes.globalThis}.Error("Value is larger than Number.MAX_SAFE_INTEGER")
}
if (long.lt(globalThis.Number.MIN_SAFE_INTEGER)) {
if (long.lt(${bytes.globalThis}.Number.MIN_SAFE_INTEGER)) {
throw new ${bytes.globalThis}.Error("Value is smaller than Number.MIN_SAFE_INTEGER")
}
return long.toNumber();
Expand Down

0 comments on commit 3a4e199

Please sign in to comment.