@lvce-editor/quick-pick-worker 4.28.0 → 4.28.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.
@@ -2943,9 +2943,8 @@ const invoke$2 = (method, ...args) => {
2943
2943
 
2944
2944
  const cacheName = 'quick-pick-files-v1';
2945
2945
  const cacheUrl = workspace => {
2946
- const url = new URL('https://quick-pick-cache.invalid/cache/v1');
2947
- url.searchParams.set('folder', workspace);
2948
- return url.href;
2946
+ const path = workspace.replaceAll('\\', '/').replace(/^\/+/, '').split('/').map(encodeURIComponent).join('/');
2947
+ return `https://quick-pick-cache.invalid/cache/v1/file/${path}`;
2949
2948
  };
2950
2949
  const isEntry = value => {
2951
2950
  if (!value || typeof value !== 'object') {
@@ -2972,12 +2971,15 @@ const get = async workspace => {
2972
2971
  };
2973
2972
  const set$1 = async (workspace, entry) => {
2974
2973
  const expires = new Date(Date.now() + 90 * 24 * 60 * 60 * 1000).toUTCString();
2974
+ const body = JSON.stringify(entry);
2975
2975
  const headers = {
2976
2976
  'cache-control': 'private, max-age=7776000',
2977
+ 'content-length': String(new TextEncoder().encode(body).byteLength),
2978
+ 'content-type': 'application/json',
2977
2979
  expires
2978
2980
  };
2979
2981
  try {
2980
- await invoke$2('Cache.setCacheStorageItem', cacheUrl(workspace), JSON.stringify(entry), cacheName, headers);
2982
+ await invoke$2('Cache.setCacheStorageItem', cacheUrl(workspace), body, cacheName, headers);
2981
2983
  } catch {
2982
2984
  // Caching is optional; a storage failure must not break file search.
2983
2985
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/quick-pick-worker",
3
- "version": "4.28.0",
3
+ "version": "4.28.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/lvce-editor/quick-pick-worker.git"