Skip to content

Commit cd01abb

Browse files
authored
fix: remove custom registry end / (#166)
1 parent 423c198 commit cd01abb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/neat-toes-doubt.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@modern-js/codesmith": patch
3+
---
4+
5+
fix: remove custom registry end /
6+
7+
fix: 移除自定义 registry 结尾 /

packages/core/src/utils/getNpmPackageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function getNpmPackageInfo(
2828
}
2929
const { registryUrl = await getNpmRegistry() } = options || {};
3030

31-
const url = `${registryUrl}/${pkgName}/${pkgVersion}`;
31+
const url = `${registryUrl.replace(/\/$/, '')}/${pkgName}/${pkgVersion}`;
3232

3333
const response = await timeoutPromise(
3434
axios.get(url),

0 commit comments

Comments
 (0)