Skip to content

chore(deps): update dependency lru-cache to v10 #9267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/compiler-sfc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@
"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",
Expand Down
12 changes: 6 additions & 6 deletions packages/compiler-sfc/src/cache.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
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>
const cache = new LRUCache<string, T>({ max })
return cache
}
11 changes: 2 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.