Skip to content

Commit

Permalink
Address negative zero lint validation (#3820)
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt-sebastian authored Sep 21, 2020
1 parent 7bf7379 commit 16c6ba9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/moody-jobs-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/firestore": patch
---

Fixes a "Comparison with -0" lint warning for customers that build from source.
2 changes: 1 addition & 1 deletion packages/firestore/src/util/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function isNullOrUndefined(value: unknown): value is null | undefined {
export function isNegativeZero(value: number): boolean {
// Detect if the value is -0.0. Based on polyfill from
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
return value === -0 && 1 / value === 1 / -0;
return value === 0 && 1 / value === 1 / -0;
}

/**
Expand Down

0 comments on commit 16c6ba9

Please sign in to comment.