Fixed Cache methods

This commit is contained in:
segayuu
2017-11-24 14:03:37 +09:00
parent b8cabc4f99
commit ae1ea52366
2 changed files with 5 additions and 2 deletions

View File

@@ -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);

View File

@@ -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;