Skip to content

Commit

Permalink
fix(utils): async resolve types
Browse files Browse the repository at this point in the history
  • Loading branch information
Anidetrix committed Dec 26, 2020
1 parent cc6256d commit 08ae382
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"deno.enable": false
}
3 changes: 2 additions & 1 deletion src/utils/resolve-async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import resolveAsync, { AsyncOpts } from "resolve";

export default async (id: string, options: AsyncOpts = {}): Promise<string> =>
new Promise((resolve, reject) => {
resolveAsync(id, options, (err, res) => (err ? reject(err) : resolve(res)));
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- always present if there is no error
resolveAsync(id, options, (err, res) => (err ? reject(err) : resolve(res!)));
});

0 comments on commit 08ae382

Please sign in to comment.