Skip to content

Commit

Permalink
perf(internal): use strict equality for isObject() (#4493)
Browse files Browse the repository at this point in the history
In `isObject(x)` use triple equal instead of double equal comparison
with `null`, since `undefined` will be ruled out via the `typeof`, and
therefore it's sufficient to just check for `null` initially.
  • Loading branch information
bmeurer authored and benlesh committed Jan 24, 2019
1 parent 83a8485 commit fc84a00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/internal/util/isObject.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function isObject(x: any): x is Object {
return x != null && typeof x === 'object';
return x !== null && typeof x === 'object';
}

0 comments on commit fc84a00

Please sign in to comment.