Skip to content

Commit

Permalink
add explicit types
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jun 19, 2023
1 parent 1f2dfaa commit 49b7bc8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
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<string> {
return pcall(resolvePathSync, id, options);
}

Expand Down

0 comments on commit 49b7bc8

Please sign in to comment.