@lvce-editor/extension-search-view 7.29.0 → 7.29.2

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.
@@ -4289,6 +4289,10 @@ const getDownloadCount = extension => {
4289
4289
  return downloadCount.toLocaleString();
4290
4290
  };
4291
4291
 
4292
+ const pathSeparatorRegex = /[\\/]/;
4293
+ const normalizePath = path => {
4294
+ return path.split('/').filter(part => part && part !== '.').join('/');
4295
+ };
4292
4296
  const getRemoteUrl = (extension, platform, assetDir) => {
4293
4297
  if (extension === null || typeof extension !== 'object') {
4294
4298
  return '';
@@ -4299,9 +4303,12 @@ const getRemoteUrl = (extension, platform, assetDir) => {
4299
4303
  const path = 'path' in extension && typeof extension.path === 'string' ? extension.path : '';
4300
4304
  if (platform === Remote || platform === Electron) {
4301
4305
  if (builtin) {
4302
- return `${assetDir}/extensions/${id}/${icon}`;
4306
+ const directory = path.split(pathSeparatorRegex).findLast(Boolean) || id;
4307
+ return `${assetDir}/extensions/${directory}/${icon}`;
4303
4308
  }
4304
- return `/remote/${path}/${icon}`; // TODO support windows paths
4309
+ const normalizedPath = normalizePath(path);
4310
+ const normalizedIcon = normalizePath(icon);
4311
+ return `/remote/${[normalizedPath, normalizedIcon].filter(Boolean).join('/')}`; // TODO support windows paths
4305
4312
  }
4306
4313
  if (platform === Web) {
4307
4314
  return `${path}/${icon}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-search-view",
3
- "version": "7.29.0",
3
+ "version": "7.29.2",
4
4
  "description": "Extension Search View Worker",
5
5
  "repository": {
6
6
  "type": "git",