Skip to content

Commit

Permalink
fix ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
moshest committed May 30, 2021
1 parent b65ef68 commit a80bc34
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions src/schema/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,23 @@ export default function compiler<S>(

if (!promises.length) {
if (errors.length || mainError) {
throw createValidationError(errors, mainError || error, ...args);
throw createValidationError<SchemaParameters<S>>(
errors,
mainError || error,
...args,
);
}

return res as SchemaResolveType<S>;
}

return Promise.all(promises).then(() => {
if (errors.length || mainError) {
throw createValidationError(errors, mainError || error, ...args);
throw createValidationError<SchemaParameters<S>>(
errors,
mainError || error,
...args,
);
}

return res;
Expand Down

0 comments on commit a80bc34

Please sign in to comment.