Support deno 1.3.x/0.67.0; replace handlebars with view_engine library

This commit is contained in:
2020-09-04 09:40:16 -05:00
parent 0f182b592b
commit ff34578d07
23 changed files with 287 additions and 141 deletions

View File

@@ -0,0 +1,20 @@
export enum ViewEngine {
Denjuck = 'Denjuck',
Ejs = 'Ejs',
Handlebars = 'Handlebars',
}
export enum ViewFileExtension {
Denjuck = '.html',
Ejs = '.ejs',
Handlebars = '.hbs',
}
export function isViewEngine(what: any): what is ViewEngine {
return (['Denjuck', 'Ejs', 'Handlebars'].includes(String(what)))
}
export function isViewFileExtension(what: any): what is ViewFileExtension {
return (['.html', '.ejs', '.hbs']).includes(String(what))
}