diff --git a/types/ejs/ejs-tests.ts b/types/ejs/ejs-tests.ts index 8c6dae9965..40c610dd59 100644 --- a/types/ejs/ejs-tests.ts +++ b/types/ejs/ejs-tests.ts @@ -1,5 +1,7 @@ import ejs = require("ejs"); import * as fs from 'graceful-fs'; +import LRU = require("lru-cache"); +import { TemplateFunction } from "ejs"; const fileName = 'test.ejs'; const people = ['geddy', 'neil', 'alex']; @@ -33,3 +35,5 @@ ejs.compile(template, options); ejs.fileLoader = (str: string) => str; ejs.clearCache(); + +ejs.cache = LRU(100); diff --git a/types/ejs/index.d.ts b/types/ejs/index.d.ts index 771ab220e6..9d1294e681 100644 --- a/types/ejs/index.d.ts +++ b/types/ejs/index.d.ts @@ -107,8 +107,7 @@ export function escapeRegexChars(s: string): string; */ export function escapeXML(markup: string): string; export interface Cache { - _data: { [name: string]: TemplateFunction; }; - set(key: string, val: TemplateFunction): TemplateFunction; + set(key: string, val: TemplateFunction): void; get(key: string): TemplateFunction; } export let delimiter: string;