com.jimuwd.xian.registry-proxy 1.0.19 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -148,8 +148,8 @@ export async function startProxyServer(proxyConfigPath, localYarnConfigPath, glo
148
148
  const fetchPromises = registries.map(async ({ url, token }) => {
149
149
  await limiter.acquire();
150
150
  try {
151
- const cleanRelativePath = relativePath /*.replace(/^\/+|\/+$/g, '')*/;
152
- const targetUrl = `${url}/${cleanRelativePath}${fullUrl.search || ''}` /*.replace(/\/+/g, '/')*/;
151
+ const cleanRelativePath = relativePath.replace(/^\/+|\/+$/g, '');
152
+ const targetUrl = `${url}/${cleanRelativePath}${fullUrl.search || ''}`;
153
153
  console.log(`Fetching from: ${targetUrl}`);
154
154
  const headers = token ? { Authorization: `Bearer ${token}` } : undefined;
155
155
  const response = await fetch(targetUrl, { headers, });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.jimuwd.xian.registry-proxy",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "type": "module",
5
5
  "description": "A lightweight npm registry proxy with fallback support",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -187,8 +187,8 @@ export async function startProxyServer(
187
187
  const fetchPromises = registries.map(async ({ url, token }) => {
188
188
  await limiter.acquire();
189
189
  try {
190
- const cleanRelativePath = relativePath/*.replace(/^\/+|\/+$/g, '')*/;
191
- const targetUrl = `${url}/${cleanRelativePath}${fullUrl.search || ''}`/*.replace(/\/+/g, '/')*/;
190
+ const cleanRelativePath = relativePath.replace(/^\/+|\/+$/g, '');
191
+ const targetUrl = `${url}/${cleanRelativePath}${fullUrl.search || ''}`;
192
192
  console.log(`Fetching from: ${targetUrl}`);
193
193
  const headers = token ? { Authorization: `Bearer ${token}` } : undefined;
194
194
  const response = await fetch(targetUrl, { headers, });