Skip to content

Commit

Permalink
fix(types): removed type dependency and eased input (#10)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
seanmay authored Aug 1, 2018
1 parent 03bae67 commit b109046
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/guards.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ describe("Guard", () => {
}
};

//@ts-ignore
const dent: User = {
name: "Arthur Dent",
//@ts-ignore
address: null
};

Expand Down
8 changes: 2 additions & 6 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
export interface ObjectTypeGuard<T> {
(x: ValueMap<T>): x is T;
}

export interface IterableTypeGuard<T> {
(xs: Iterable<T>): xs is Iterable<T>;
(x: any): x is T;
}

export interface ArrayTypeGuard<T> {
(xs: T[]): xs is T[];
(xs: any[]): xs is T[];
}

export interface ValueTypeGuard<T> {
Expand Down

0 comments on commit b109046

Please sign in to comment.