From 49b7bc8b33abf72ccf0026b0c25acf5b0ea4c2c7 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 19 Jun 2023 13:57:58 +0200 Subject: [PATCH] add explicit types --- src/resolve.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/resolve.ts b/src/resolve.ts index 011295f..593d58a 100644 --- a/src/resolve.ts +++ b/src/resolve.ts @@ -124,19 +124,22 @@ function _resolve(id: string, options: ResolveOptions = {}): string { return pathToFileURL(realPath).toString(); } -export function resolveSync(id: string, options?: ResolveOptions) { +export function resolveSync(id: string, options?: ResolveOptions): string { return _resolve(id, options); } -export function resolve(id: string, options?: ResolveOptions) { +export function resolve(id: string, options?: ResolveOptions): Promise { return pcall(resolveSync, id, options); } -export function resolvePathSync(id: string, options?: ResolveOptions) { +export function resolvePathSync(id: string, options?: ResolveOptions): string { return fileURLToPath(resolveSync(id, options)); } -export function resolvePath(id: string, options?: ResolveOptions) { +export function resolvePath( + id: string, + options?: ResolveOptions +): Promise { return pcall(resolvePathSync, id, options); }