Skip to content

Commit

Permalink
fix: remove custom registry end / (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
caohuilin authored Oct 16, 2024
1 parent 423c198 commit cd01abb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/neat-toes-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@modern-js/codesmith": patch
---

fix: remove custom registry end /

fix: 移除自定义 registry 结尾 /
2 changes: 1 addition & 1 deletion packages/core/src/utils/getNpmPackageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function getNpmPackageInfo(
}
const { registryUrl = await getNpmRegistry() } = options || {};

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

const response = await timeoutPromise(
axios.get(url),
Expand Down

0 comments on commit cd01abb

Please sign in to comment.