From 2f5e03bed2fbf83ac4079ee825b7d8c2c5caa8ba Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 4 Feb 2019 02:44:17 +0700 Subject: [PATCH] Minor tweaks --- source/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/index.ts b/source/index.ts index 60a29a2..fdd3edc 100644 --- a/source/index.ts +++ b/source/index.ts @@ -49,13 +49,13 @@ export const enum TypeName { const toString = Object.prototype.toString; const isOfType = (type: string) => (value: unknown): value is T => typeof value === type; -const getObjectType = (value: unknown): TypeName | null => { +const getObjectType = (value: unknown): TypeName | undefined => { const objectName = toString.call(value).slice(8, -1); if (objectName) { return objectName as TypeName; } - return null; + return; }; const isObjectOfType = (type: TypeName) => (value: unknown): value is T => getObjectType(value) === type; @@ -238,7 +238,7 @@ export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array is.typedArray = (value: unknown): value is TypedArray => { const objectType = getObjectType(value); - if (objectType === null) { + if (objectType === undefined) { return false; }