Skip to content

Commit b8919bb

Browse files
committed
Fix lint
1 parent 0355c22 commit b8919bb

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

npm/yarn-resolve/src/resolve.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,16 @@ function npmLocator(locator: Locator): Locator | undefined {
134134
}
135135

136136
function extractPatchPaths(locator: Locator): string[] {
137-
if (locator.reference.startsWith("patch:")) {
138-
return patchUtils
139-
.parseLocator(locator)
140-
.patchPaths.filter((patchPath) => !patchPath.startsWith("~builtin"))
141-
.map((patchPath) => {
142-
// Replace final slash with a colon to make it a bazel label
143-
const parts = patchPath.split("/");
144-
return `//${parts.slice(0, -1).join("/")}:${parts.slice(-1)}`;
145-
});
146-
} else {
147-
return [];
148-
}
137+
return locator.reference.startsWith("patch:")
138+
? patchUtils
139+
.parseLocator(locator)
140+
.patchPaths.filter((patchPath) => !patchPath.startsWith("~builtin"))
141+
.map((patchPath) => {
142+
// Replace final slash with a colon to make it a bazel label
143+
const parts = patchPath.split("/");
144+
return `//${parts.slice(0, -1).join("/")}:${parts.slice(-1)}`;
145+
})
146+
: [];
149147
}
150148

151149
function bzlId(locator: Locator): string | undefined {

0 commit comments

Comments
 (0)