Skip to content

Commit

Permalink
chore(deps): bump lru-cache from 7.18.3 to 9.1.1 (#8692)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored May 5, 2023
1 parent d54fd3a commit e301f2a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions content/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from "node:path";
import childProcess from "node:child_process";

import LRU from "lru-cache";
import { LRUCache } from "lru-cache";

import { CONTENT_ROOT, CONTENT_TRANSLATED_ROOT } from "../libs/env/index.js";
import { slugToFolder as _slugToFolder } from "../libs/slug-utils/index.js";
Expand Down Expand Up @@ -49,7 +49,7 @@ export function memoize<Args>(
return fn as (...args: (Args | typeof MEMOIZE_INVALIDATE)[]) => any;
}

const cache = new LRU({ max: 2000 });
const cache = new LRUCache({ max: 2000 });
return (...args: (Args | typeof MEMOIZE_INVALIDATE)[]) => {
let invalidate = false;
if (args.includes(MEMOIZE_INVALIDATE)) {
Expand Down
6 changes: 3 additions & 3 deletions kumascript/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import LRU from "lru-cache";
import { LRUCache } from "lru-cache";
import * as cheerio from "cheerio";

import { Document } from "../content/index.js";
import { m2h } from "../markdown/index.js";

import info from "./src/info.js";
import { render as renderMacros } from "./src/render.js";
export { buildLiveSamplePages } from "./src/live-sample.js";
import { HTMLTool } from "./src/api/util.js";
import { DEFAULT_LOCALE } from "../libs/constants/index.js";
import {
Expand All @@ -15,11 +14,12 @@ import {
} from "../libs/env/index.js";
import { SourceCodeError } from "./src/errors.js";
import { Doc } from "../libs/types/document.js";
export { buildLiveSamplePages } from "./src/live-sample.js";

const DEPENDENCY_LOOP_INTRO =
'The following documents form a circular dependency when rendering (via the "page" macros):';

export const renderCache = new LRU<string, [string, SourceCodeError[]]>({
export const renderCache = new LRUCache<string, [string, SourceCodeError[]]>({
max: 2000,
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"is-svg": "^5.0.0",
"js-yaml": "^4.1.0",
"loglevel": "^1.8.1",
"lru-cache": "^7.18.3",
"lru-cache": "^9.1.1",
"md5-file": "^5.0.0",
"mdast-util-from-markdown": "^1.3.0",
"mdast-util-phrasing": "^3.0.1",
Expand Down
7 changes: 1 addition & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8861,12 +8861,7 @@ lru-cache@^6.0.0:
dependencies:
yallist "^4.0.0"

lru-cache@^7.18.3:
version "7.18.3"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89"
integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==

lru-cache@^9.0.0:
lru-cache@^9.0.0, lru-cache@^9.1.1:
version "9.1.1"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.1.1.tgz#c58a93de58630b688de39ad04ef02ef26f1902f1"
integrity sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A==
Expand Down

0 comments on commit e301f2a

Please sign in to comment.