Skip to content

Commit 9eed5db

Browse files
committed
chore(file): use const for path in getCandidates
1 parent fde9dfa commit 9eed5db

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/plugin-file/sources/TarballFileResolver.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ export class TarballFileResolver implements Resolver {
4848
}
4949

5050
async getCandidates(descriptor: Descriptor, dependencies: unknown, opts: ResolveOptions) {
51-
let path = descriptor.range;
52-
53-
if (path.startsWith(PROTOCOL))
54-
path = path.slice(PROTOCOL.length);
51+
const path = descriptor.range.startsWith(PROTOCOL)
52+
? descriptor.range.slice(PROTOCOL.length)
53+
: descriptor.range;
5554

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

0 commit comments

Comments
 (0)