Skip to content

Commit

Permalink
change areBothNan to areBothNaN
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulmanb committed Nov 21, 2017
1 parent 04ceba9 commit 6052a7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/types/comparer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { deepEqual, areBothNan } from "../utils/utils"
import { deepEqual, areBothNaN } from "../utils/utils"

export interface IEqualsComparer<T> {
(a: T, b: T): boolean
Expand All @@ -13,7 +13,7 @@ function structuralComparer(a: any, b: any): boolean {
}

function defaultComparer(a: any, b: any): boolean {
return areBothNan(a,b) || identityComparer(a, b)
return areBothNaN(a,b) || identityComparer(a, b)
}

export const comparer = {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export function getEnumerableKeys(obj) {
export function deepEqual(a, b) {
if (a === null && b === null) return true
if (a === undefined && b === undefined) return true
if (areBothNan(a, b)) return true
if (areBothNaN(a, b)) return true
if (typeof a !== "object") return a === b
const aIsArray = isArrayLike(a)
const aIsMap = isMapLike(a)
Expand Down Expand Up @@ -192,7 +192,7 @@ export function createInstanceofPredicate<T>(
} as any
}

export function areBothNan(a: any, b: any): boolean {
export function areBothNaN(a: any, b: any): boolean {
return (typeof a === "number" && typeof b === "number" && isNaN(a) && isNaN(b));
}

Expand Down

0 comments on commit 6052a7c

Please sign in to comment.