Skip to content

Commit 45481b9

Browse files
bailnlulivz
authored andcommitted
chore: bump lru-cache (#1160)
1 parent 9665196 commit 45481b9

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

packages/@vuepress/core/lib/internal-plugins/frontmatterBlock/loader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const { parseVueFrontmatter: { parseStrippedFrontmatter }} = require('@vuepress/shared-utils')
22
const { frontmatterEmitter } = require('@vuepress/markdown-loader')
33
const LRU = require('lru-cache')
4-
const cache = LRU({ max: 1000 })
4+
const cache = new LRU({ max: 1000 })
55

66
module.exports = function (source, map) {
77
const isProd = process.env.NODE_ENV === 'production'

packages/@vuepress/core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"koa-mount": "^3.0.0",
5252
"koa-range": "^0.3.0",
5353
"koa-static": "^4.0.2",
54-
"lru-cache": "^4.1.2",
54+
"lru-cache": "^5.1.1",
5555
"mini-css-extract-plugin": "0.4.4",
5656
"optimize-css-assets-webpack-plugin": "^4.0.0",
5757
"portfinder": "^1.0.13",

packages/@vuepress/markdown-loader/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const { fs, path, hash, parseFrontmatter, inferTitle, extractHeaders } = require
1010
const LRU = require('lru-cache')
1111
const md = require('@vuepress/markdown')
1212

13-
const cache = LRU({ max: 1000 })
14-
const devCache = LRU({ max: 1000 })
13+
const cache = new LRU({ max: 1000 })
14+
const devCache = new LRU({ max: 1000 })
1515

1616
/**
1717
* Expose markdown loader.

packages/@vuepress/markdown/__tests__/util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from 'fs-extra'
22
import LRU from 'lru-cache'
33
import path from 'path'
44

5-
const cache = LRU({ max: 1000 })
5+
const cache = new LRU({ max: 1000 })
66

77
export function Md () {
88
return require('markdown-it')()

packages/@vuepress/shared-utils/src/extractHeaders.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import deeplyParseHeaders from './deeplyParseHeaders'
1010
* @returns {array}
1111
*/
1212

13-
const cache = LRU({ max: 1000 })
13+
const cache = new LRU({ max: 1000 })
1414

1515
export = function (content: string, include = [], md: any) {
1616
const key = content + include.join(',')

0 commit comments

Comments
 (0)