diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index f61c787..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -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; -} diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index 54cdac6..0000000 --- a/dist/index.js +++ /dev/null @@ -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 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index dd87341..5f68bb8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "@pushrocks/tlt", + "name": "@pushrocks/smartmustache", "version": "2.0.3", "lockfileVersion": 1, "requires": true, diff --git a/test/test.ts b/test/test.ts index e00a42b..dc0177c 100644 --- a/test/test.ts +++ b/test/test.ts @@ -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' }); diff --git a/ts/index.ts b/ts/index.ts index a9626f3..dedd7c4 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -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; /**