Skip to content

Commit

Permalink
Improved code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin McDonnell committed Jul 9, 2020
1 parent 9ad87d3 commit 5568a74
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/__tests__/anyunknown.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ import { util } from '../helpers/util';

test('check any inference', () => {
const t1 = z.any();
t1.optional();
t1.nullable();
t1.toJSON();
type t1 = z.infer<typeof t1>;
const f1: util.AssertEqual<t1, any> = true;
f1;
});

test('check unknown inference', () => {
const t1 = z.unknown();
t1.optional();
t1.nullable();
t1.toJSON();
type t1 = z.infer<typeof t1>;
const f1: util.AssertEqual<t1, unknown> = true;
f1;
Expand Down
9 changes: 0 additions & 9 deletions src/helpers/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ export namespace util {
throw new Error();
}

export const getObjectType = (value: unknown): string | undefined => {
const objectName = toString.call(value).slice(8, -1);
if (objectName) {
return objectName;
}

return undefined;
};

export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;

Expand Down

0 comments on commit 5568a74

Please sign in to comment.