@lvce-editor/quick-pick-worker 4.16.0 → 4.17.1

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.
@@ -3008,8 +3008,30 @@ const getPicks$7 = async (_searchValue, _args, {
3008
3008
  return getUniqueLanguages(languages).map(toProtoVisibleItem$1);
3009
3009
  };
3010
3010
 
3011
+ const getUriKey = uri => {
3012
+ if (!uri.startsWith('/') && !uri.startsWith('file://')) {
3013
+ return uri;
3014
+ }
3015
+ try {
3016
+ const url = new URL(uri.startsWith('/') ? `file://${uri}` : uri);
3017
+ while (url.pathname.length > 1 && url.pathname.endsWith('/')) {
3018
+ url.pathname = url.pathname.slice(0, -1);
3019
+ }
3020
+ return url.href;
3021
+ } catch {
3022
+ return uri;
3023
+ }
3024
+ };
3011
3025
  const uniq = array => {
3012
- return [...new Set(array)];
3026
+ const seen = new Set();
3027
+ return array.filter(uri => {
3028
+ const key = getUriKey(uri);
3029
+ if (seen.has(key)) {
3030
+ return false;
3031
+ }
3032
+ seen.add(key);
3033
+ return true;
3034
+ });
3013
3035
  };
3014
3036
  const getRecentlyOpened = async () => {
3015
3037
  const recentlyOpened = await invoke$2(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/quick-pick-worker",
3
- "version": "4.16.0",
3
+ "version": "4.17.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/lvce-editor/quick-pick-worker.git"