add getTemplateForString
This commit is contained in:
parent
2246f101ba
commit
f917820545
4
dist/smarthbs.template.d.ts
vendored
4
dist/smarthbs.template.d.ts
vendored
@ -3,3 +3,7 @@
|
||||
* get a template for a file on disk
|
||||
*/
|
||||
export declare let getTemplateForFile: (filePathArg: string) => Promise<HandlebarsTemplateDelegate>;
|
||||
/**
|
||||
* get a template for string
|
||||
*/
|
||||
export declare let getTemplateForString: (fileStringArg: string) => Promise<HandlebarsTemplateDelegate>;
|
||||
|
8
dist/smarthbs.template.js
vendored
8
dist/smarthbs.template.js
vendored
@ -16,4 +16,10 @@ exports.getTemplateForFile = (filePathArg) => __awaiter(this, void 0, void 0, fu
|
||||
let filePathAbsolute = plugins.path.resolve(filePathArg);
|
||||
return plugins.handlebars.compile(plugins.smartfile.fs.toStringSync(filePathAbsolute));
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRoYnMudGVtcGxhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGhicy50ZW1wbGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsOENBQTZDO0FBRTdDOztHQUVHO0FBQ1EsUUFBQSxrQkFBa0IsR0FBRyxDQUFPLFdBQW1CO0lBQ3hELElBQUksZ0JBQWdCLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUE7SUFDeEQsTUFBTSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDLFlBQVksQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDLENBQUE7QUFDeEYsQ0FBQyxDQUFBLENBQUEifQ==
|
||||
/**
|
||||
* get a template for string
|
||||
*/
|
||||
exports.getTemplateForString = (fileStringArg) => __awaiter(this, void 0, void 0, function* () {
|
||||
return plugins.handlebars.compile(fileStringArg);
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRoYnMudGVtcGxhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGhicy50ZW1wbGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsOENBQTZDO0FBRTdDOztHQUVHO0FBQ1EsUUFBQSxrQkFBa0IsR0FBRyxDQUFPLFdBQW1CO0lBQ3hELElBQUksZ0JBQWdCLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUE7SUFDeEQsTUFBTSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDLFlBQVksQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDLENBQUE7QUFDeEYsQ0FBQyxDQUFBLENBQUE7QUFFRDs7R0FFRztBQUNRLFFBQUEsb0JBQW9CLEdBQUcsQ0FBTyxhQUFxQjtJQUM1RCxNQUFNLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxPQUFPLENBQUMsYUFBYSxDQUFDLENBQUE7QUFDbEQsQ0FBQyxDQUFBLENBQUEifQ==
|
@ -7,3 +7,10 @@ export let getTemplateForFile = async (filePathArg: string) => {
|
||||
let filePathAbsolute = plugins.path.resolve(filePathArg)
|
||||
return plugins.handlebars.compile(plugins.smartfile.fs.toStringSync(filePathAbsolute))
|
||||
}
|
||||
|
||||
/**
|
||||
* get a template for string
|
||||
*/
|
||||
export let getTemplateForString = async (fileStringArg: string) => {
|
||||
return plugins.handlebars.compile(fileStringArg)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user