From f12aef886d7c9ccc3f700f16f61887c2c20450b0 Mon Sep 17 00:00:00 2001 From: Lukas Tetzlaff Date: Wed, 2 May 2018 14:28:56 +0200 Subject: [PATCH] Fix linter issues --- source/index.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/index.ts b/source/index.ts index 771adaf..8fe4579 100644 --- a/source/index.ts +++ b/source/index.ts @@ -7,10 +7,12 @@ export interface ArrayLike { length: number; } -type Class = { new(...args: any[]): T; }; +export interface Class { + new(...args: any[]): T; +} -type DomElement = object & { nodeType: 1; nodeName: string } -type NodeStream = object & { pipe: Function } +type DomElement = object & { nodeType: 1; nodeName: string }; +type NodeStream = object & { pipe: Function }; export const enum TypeName { null = 'null', @@ -109,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'; + const isObject = (value: object) => typeof value === 'object'; // tslint:disable-line:strict-type-predicates // tslint:disable:variable-name export const undefined = isOfType('undefined'); @@ -241,8 +243,8 @@ namespace is { // tslint:disable-line:no-namespace 'nodeValue' ]; - export const domElement = (value: any): value is DomElement => value.nodeType === NODE_TYPE_ELEMENT && string(value.nodeName) && - !plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value) && object(value); + 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);