From d0d8895417c4c7b95deae6a4424a1a825baf726c Mon Sep 17 00:00:00 2001 From: Benedikt Meurer Date: Thu, 24 Jan 2019 21:08:44 +0100 Subject: [PATCH] perf(internal): use strict equality for isObject() 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. --- src/internal/util/isObject.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/util/isObject.ts b/src/internal/util/isObject.ts index d9572aeaca..536a52eb4b 100644 --- a/src/internal/util/isObject.ts +++ b/src/internal/util/isObject.ts @@ -1,3 +1,3 @@ export function isObject(x: any): x is Object { - return x != null && typeof x === 'object'; + return x !== null && typeof x === 'object'; }