8000 perf(internal): use strict equality for isObject() (#4493) · ReactiveX/rxjs@fc84a00 · GitHub
[go: up one dir, main page]

Skip to content

Commit fc84a00

Browse files
bmeurerbenlesh
authored andcommitted
perf(internal): use strict equality for isObject() (#4493)
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.
1 parent 83a8485 commit fc84a00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/internal/util/isObject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export function isObject(x: any): x is Object {
2-
return x != null && typeof x === 'object';
2+
return x !== null && typeof x === 'object';
33
}

0 commit comments

Comments
 (0)
0