update to handlebars
This commit is contained in:
2
dist/index.d.ts
vendored
2
dist/index.d.ts
vendored
@ -2,7 +2,7 @@
|
||||
* class Tlt allows templates to be used with different sets of data
|
||||
*/
|
||||
export declare class Tlt {
|
||||
templateString: string;
|
||||
template: any;
|
||||
/**
|
||||
* constructor of class Tlt
|
||||
*/
|
||||
|
10
dist/index.js
vendored
10
dist/index.js
vendored
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
const mustache = require("mustache");
|
||||
const handlebars = require("handlebars");
|
||||
/**
|
||||
* class Tlt allows templates to be used with different sets of data
|
||||
*/
|
||||
@ -8,20 +8,20 @@ class Tlt {
|
||||
* constructor of class Tlt
|
||||
*/
|
||||
constructor(templateStringArg) {
|
||||
this.templateString = templateStringArg;
|
||||
this.template = handlebars.compile(templateStringArg);
|
||||
}
|
||||
/**
|
||||
* returns template string with data applied
|
||||
*/
|
||||
applyData(data) {
|
||||
return mustache.render(this.templateString, data);
|
||||
return this.template(data);
|
||||
}
|
||||
/**
|
||||
* set a new template string
|
||||
*/
|
||||
setTemplate(templateStringArg) {
|
||||
this.templateString = templateStringArg;
|
||||
this.template = handlebars.compile(templateStringArg);
|
||||
}
|
||||
}
|
||||
exports.Tlt = Tlt;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEscUNBQW9DO0FBRXBDOztHQUVHO0FBQ0g7SUFHSTs7T0FFRztJQUNILFlBQVksaUJBQXlCO1FBQ2pDLElBQUksQ0FBQyxjQUFjLEdBQUcsaUJBQWlCLENBQUE7SUFDM0MsQ0FBQztJQUVEOztPQUVHO0lBQ0gsU0FBUyxDQUFDLElBQVM7UUFDZixNQUFNLENBQUMsUUFBUSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsY0FBYyxFQU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