Skip to content

Commit

Permalink
chore(file): use const for path in getCandidates
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Mar 27, 2022
1 parent 9a5499c commit 21379cf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/plugin-file/sources/TarballFileResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ export class TarballFileResolver implements Resolver {
}

async getCandidates(descriptor: Descriptor, dependencies: unknown, opts: ResolveOptions) {
let path = descriptor.range;

if (path.startsWith(PROTOCOL))
path = path.slice(PROTOCOL.length);
const path = descriptor.range.startsWith(PROTOCOL)
? descriptor.range.slice(PROTOCOL.length)
: descriptor.range;

return [structUtils.makeLocator(descriptor, `${PROTOCOL}${npath.toPortablePath(path)}`)];
}
Expand Down

0 comments on commit 21379cf

Please sign in to comment.