Skip to content

Commit

Permalink
chore: bump lru-cache (#1160)
Browse files Browse the repository at this point in the history
  • Loading branch information
bailnl authored and ulivz committed Jan 8, 2019
1 parent 9665196 commit 45481b9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { parseVueFrontmatter: { parseStrippedFrontmatter }} = require('@vuepress/shared-utils')
const { frontmatterEmitter } = require('@vuepress/markdown-loader')
const LRU = require('lru-cache')
const cache = LRU({ max: 1000 })
const cache = new LRU({ max: 1000 })

module.exports = function (source, map) {
const isProd = process.env.NODE_ENV === 'production'
Expand Down
2 changes: 1 addition & 1 deletion packages/@vuepress/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"koa-mount": "^3.0.0",
"koa-range": "^0.3.0",
"koa-static": "^4.0.2",
"lru-cache": "^4.1.2",
"lru-cache": "^5.1.1",
"mini-css-extract-plugin": "0.4.4",
"optimize-css-assets-webpack-plugin": "^4.0.0",
"portfinder": "^1.0.13",
Expand Down
4 changes: 2 additions & 2 deletions packages/@vuepress/markdown-loader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const { fs, path, hash, parseFrontmatter, inferTitle, extractHeaders } = require
const LRU = require('lru-cache')
const md = require('@vuepress/markdown')

const cache = LRU({ max: 1000 })
const devCache = LRU({ max: 1000 })
const cache = new LRU({ max: 1000 })
const devCache = new LRU({ max: 1000 })

/**
* Expose markdown loader.
Expand Down
2 changes: 1 addition & 1 deletion packages/@vuepress/markdown/__tests__/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs-extra'
import LRU from 'lru-cache'
import path from 'path'

const cache = LRU({ max: 1000 })
const cache = new LRU({ max: 1000 })

export function Md () {
return require('markdown-it')()
Expand Down
2 changes: 1 addition & 1 deletion packages/@vuepress/shared-utils/src/extractHeaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import deeplyParseHeaders from './deeplyParseHeaders'
* @returns {array}
*/

const cache = LRU({ max: 1000 })
const cache = new LRU({ max: 1000 })

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

0 comments on commit 45481b9

Please sign in to comment.