Skip to content

Commit 16c6ba9

Browse files
Address negative zero lint validation (#3820)
1 parent 7bf7379 commit 16c6ba9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/moody-jobs-deliver.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/firestore": patch
3+
---
4+
5+
Fixes a "Comparison with -0" lint warning for customers that build from source.

packages/firestore/src/util/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function isNullOrUndefined(value: unknown): value is null | undefined {
3131
export function isNegativeZero(value: number): boolean {
3232
// Detect if the value is -0.0. Based on polyfill from
3333
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
34-
return value === -0 && 1 / value === 1 / -0;
34+
return value === 0 && 1 / value === 1 / -0;
3535
}
3636

3737
/**

0 commit comments

Comments
 (0)