]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore(deps): update lru-cache to v10
authorEvan You <yyx990803@gmail.com>
Fri, 20 Oct 2023 02:37:39 +0000 (10:37 +0800)
committerEvan You <yyx990803@gmail.com>
Fri, 20 Oct 2023 02:38:41 +0000 (10:38 +0800)
ref #9267

packages/compiler-sfc/package.json
packages/compiler-sfc/src/cache.ts
pnpm-lock.yaml

index a985b60315dfd8f8d18587ee764ef912219479a8..6d4a99e23fd2cf6c94deb6d8eb128046b282a8e2 100644 (file)
   "devDependencies": {
     "@babel/types": "^7.22.19",
     "@types/estree": "^0.0.52",
-    "@types/lru-cache": "^5.1.1",
     "@vue/consolidate": "^0.17.3",
     "hash-sum": "^2.0.0",
-    "lru-cache": "^5.1.1",
+    "lru-cache": "^10.0.1",
     "merge-source-map": "^1.1.0",
     "minimatch": "^9.0.3",
     "postcss-modules": "^4.3.1",
index 36d240810c766204c56656747a526fe20710c1eb..f04b231f6d9e8fe4bea7b8e51e068bb12344d139 100644 (file)
@@ -1,11 +1,10 @@
-import LRU from 'lru-cache'
+import { LRUCache } from 'lru-cache'
 
-export function createCache<T>(size = 500): Map<string, T> & { max?: number } {
+export function createCache<T extends {}>(
+  max = 500
+): Map<string, T> | LRUCache<string, T> {
   if (__GLOBAL__ || __ESM_BROWSER__) {
     return new Map<string, T>()
   }
-  const cache = new LRU(size)
-  // @ts-expect-error
-  cache.delete = cache.del.bind(cache)
-  return cache as any as Map<string, T>
+  return new LRUCache({ max })
 }
index 03aee7ec3011a340a30dea56e86724a49c3caa81..bfd39cc2dbf5130e3e4fb15e7b8514380b5421dc 100644 (file)
@@ -223,9 +223,6 @@ importers:
       '@types/estree':
         specifier: ^0.0.52
         version: 0.0.52
-      '@types/lru-cache':
-        specifier: ^5.1.1
-        version: 5.1.1
       '@vue/consolidate':
         specifier: ^0.17.3
         version: 0.17.3
@@ -233,8 +230,8 @@ importers:
         specifier: ^2.0.0
         version: 2.0.0
       lru-cache:
-        specifier: ^5.1.1
-        version: 5.1.1
+        specifier: ^10.0.1
+        version: 10.0.1
       merge-source-map:
         specifier: ^1.1.0
         version: 1.1.0
@@ -1584,10 +1581,6 @@ packages:
     resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==}
     dev: true
 
-  /@types/lru-cache@5.1.1:
-    resolution: {integrity: sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==}
-    dev: true
-
   /@types/node@18.18.5:
     resolution: {integrity: sha512-4slmbtwV59ZxitY4ixUZdy1uRLf9eSIvBWPQxNjhHYWEtn0FryfKpyS2cvADYXTayWdKEIsJengncrVvkI4I6A==}
     dev: true