Skip to content

Commit 3a1b860

Browse files
committed
test: avoid ajv cache lint violation
1 parent 777051b commit 3a1b860

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

extensions/lobster/src/lobster-runner.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import {
1111
} from "./lobster-runner.js";
1212

1313
const requireForTest = createRequire(import.meta.url);
14+
const ajvInternalCacheKey = "_cache";
1415

1516
type AjvInstance = {
16-
_cache?: { size: number };
1717
compile: (schema: unknown) => unknown;
1818
};
1919
type AjvConstructor = new (opts?: object) => AjvInstance;
2020

2121
function readAjvInternalCacheSize(ajv: unknown): number {
22-
return (ajv as AjvInstance)._cache?.size ?? 0;
22+
return (ajv as Record<string, { size: number } | undefined>)[ajvInternalCacheKey]?.size ?? 0;
2323
}
2424

2525
async function importLobsterAjvConstructor(): Promise<AjvConstructor> {

0 commit comments

Comments
 (0)