We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6dc6b65 commit 3647625Copy full SHA for 3647625
src/parser/parser_lib.ts
@@ -1,5 +1,5 @@
1
import { assert } from "@std/assert/assert";
2
-import { memoize } from "@std/cache/memoize";
+import { MemoizationCacheResult, memoize } from "@std/cache/memoize";
3
import { ArrayResult, ArrayResultError } from "../array_result.ts";
4
import { Clearable, ClearableCacheSet, Lazy } from "../cache.ts";
5
import { throwError } from "../misc.ts";
@@ -14,7 +14,7 @@ export class Parser<T> {
14
constructor(parser: (src: string) => ParserResult<T>) {
15
this.unmemoizedParser = parser;
16
if (Parser.cache != null) {
17
- const cache = new Map();
+ const cache = new Map<string, MemoizationCacheResult<ParserResult<T>>>();
18
Parser.addToCache(cache);
19
this.rawParser = memoize(this.unmemoizedParser, { cache });
20
} else {
0 commit comments