From b10904641aa0b3df4565118d4cb5536016a24eac Mon Sep 17 00:00:00 2001 From: Sean May Date: Wed, 1 Aug 2018 02:26:50 -0400 Subject: [PATCH] fix(types): removed type dependency and eased input (#10) Removed multiple unused types, including Iterable, which caused an @types/node dependency. Loosened expectations on input, to `any`; benefits of pre-checking type of input were outweighing ease of use in testing. Consider revisiting as feature, to lightly tighten (keys existing?) later. Fixes #9 --- src/guards.test.ts | 2 +- src/types.ts | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/guards.test.ts b/src/guards.test.ts index 765addc..ff92140 100644 --- a/src/guards.test.ts +++ b/src/guards.test.ts @@ -40,9 +40,9 @@ describe("Guard", () => { } }; + //@ts-ignore const dent: User = { name: "Arthur Dent", - //@ts-ignore address: null }; diff --git a/src/types.ts b/src/types.ts index d87f2a2..b07f252 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,13 +1,9 @@ export interface ObjectTypeGuard { - (x: ValueMap): x is T; -} - -export interface IterableTypeGuard { - (xs: Iterable): xs is Iterable; + (x: any): x is T; } export interface ArrayTypeGuard { - (xs: T[]): xs is T[]; + (xs: any[]): xs is T[]; } export interface ValueTypeGuard {