From cf302936d8b3bb383054d4c898d2d534b8e359cb Mon Sep 17 00:00:00 2001 From: Lukas Tetzlaff Date: Wed, 2 May 2018 14:48:12 +0200 Subject: [PATCH] Forgot isObject --- source/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/index.ts b/source/index.ts index 2963984..fd302d0 100644 --- a/source/index.ts +++ b/source/index.ts @@ -111,7 +111,7 @@ function is(value: any): TypeName { // tslint:disable-line:only-arrow-functions } namespace is { // tslint:disable-line:no-namespace - const isObject = (value: object) => typeof value === 'object'; // tslint:disable-line:strict-type-predicates + const isObject = (value: any): value is object => typeof value === 'object'; // tslint:disable:variable-name export const undefined = isOfType('undefined'); @@ -137,7 +137,7 @@ namespace is { // tslint:disable-line:no-namespace const hasPromiseAPI = (value: any): value is Promise => !null_(value) && - isObject(value) && + isObject(value) as any && function_(value.then) && function_(value.catch); @@ -246,7 +246,7 @@ namespace is { // tslint:disable-line:no-namespace export const domElement = (value: any): value is DomElement => object(value) as any && value.nodeType === NODE_TYPE_ELEMENT && string(value.nodeName) && !plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value); - export const nodeStream = (value: any): value is NodeStream => !nullOrUndefined(value) && isObject(value) && function_(value.pipe); + export const nodeStream = (value: any): value is NodeStream => !nullOrUndefined(value) && isObject(value) as any && function_(value.pipe); export const infinite = (value: any) => value === Infinity || value === -Infinity;