6 Commits

Author SHA1 Message Date
1c53edca7d 2.0.5 2019-02-17 16:55:08 +01:00
6b279824fb fix(core): update 2019-02-17 16:55:07 +01:00
c06b8e6a18 2.0.4 2018-09-15 12:43:01 +02:00
a707dff92d fix(structure): fix internal naming 2018-09-15 12:43:01 +02:00
7bad738cb1 2.0.3 2018-09-15 01:31:22 +02:00
0e5db8f6b4 fix(core): update 2018-09-15 01:31:22 +02:00
6 changed files with 684 additions and 196 deletions

18
dist/index.d.ts vendored
View File

@@ -1,18 +0,0 @@
/**
* class Tlt allows templates to be used with different sets of data
*/
export declare class Tlt {
template: any;
/**
* constructor of class Tlt
*/
constructor(templateStringArg: string);
/**
* returns template string with data applied
*/
applyData(data: any): string;
/**
* set a new template string
*/
setTemplate(templateStringArg: string): void;
}

27
dist/index.js vendored
View File

@@ -1,27 +0,0 @@
"use strict";
const handlebars = require("handlebars");
/**
* class Tlt allows templates to be used with different sets of data
*/
class Tlt {
/**
* constructor of class Tlt
*/
constructor(templateStringArg) {
this.template = handlebars.compile(templateStringArg);
}
/**
* returns template string with data applied
*/
applyData(data) {
return this.template(data);
}
/**
* set a new template string
*/
setTemplate(templateStringArg) {
this.template = handlebars.compile(templateStringArg);
}
}
exports.Tlt = Tlt;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEseUNBQXdDO0FBRXhDOztHQUVHO0FBQ0g7SUFHRTs7T0FFRztJQUNILFlBQVksaUJBQXlCO1FBQ25DLElBQUksQ0FBQyxRQUFRLEdBQUcsVUFBVSxDQUFDLE9BQU8sQ0FBQyxpQkFBaUIsQ0FBQyxDQUFBO0lBQ3ZELENBQUM7SUFFRDs7T0FFRztJQUNILFNBQVMsQ0FBQyxJQUFTO1FBQ2pCLE1BQU0sQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxDQUFBO0lBQzVCLENBQUM7SUFFRDs7T0FFRztJQUNILFdBQVcsQ0FBQyxpQkFBeUI7UUFDbkMsSUFBSSxDQUFDLFFBQVEsR0FBRyxVQUFVLENBQUMsT0FBTyxDQUFDLGlCQUFpQixDQUFDLENBQUE7SUFDdkQsQ0FBQztDQUNGO0FBdkJELGtCQXVCQyJ9

810
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@pushrocks/tlt",
"version": "2.0.2",
"name": "@pushrocks/smartmustache",
"version": "2.0.5",
"description": "templates done right",
"private": false,
"main": "dist/index.js",
@@ -23,13 +23,12 @@
},
"homepage": "https://gitlab.com/pushrocks/tlt#README",
"dependencies": {
"@types/handlebars": "^4.0.39",
"handlebars": "^4.0.12"
"handlebars": "^4.1.0"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.0.22",
"@gitzone/tsrun": "^1.1.12",
"@gitzone/tstest": "^1.0.15",
"@gitzone/tsbuild": "^2.1.8",
"@gitzone/tsrun": "^1.1.17",
"@gitzone/tstest": "^1.0.18",
"@pushrocks/tapbundle": "^3.0.7"
}
}

View File

@@ -1,14 +1,14 @@
import { tap, expect } from '@pushrocks/tapbundle';
import * as tlt from '../dist/index';
import * as tlt from '../ts/index';
let testTlt: tlt.Tlt;
let testMustache: tlt.SmartMustache;
tap.test('should create a valid instance of tlt', async () => {
testTlt = new tlt.Tlt('some awesome {{customString}} that is {{license}} licensed');
expect(testTlt).to.be.instanceOf(tlt.Tlt);
testMustache = new tlt.SmartMustache('some awesome {{customString}} that is {{license}} licensed');
expect(testMustache).to.be.instanceOf(tlt.SmartMustache);
});
tap.test('should output a valid string with some data', async () => {
let appliedString = testTlt.applyData({
let appliedString = testMustache.applyData({
customString: 'horse',
license: 'MIT'
});

View File

@@ -3,7 +3,7 @@ import * as handlebars from 'handlebars';
/**
* class Tlt allows templates to be used with different sets of data
*/
export class Tlt {
export class SmartMustache {
template: any;
/**