fix(structure): fix internal naming
This commit is contained in:
parent
7bad738cb1
commit
a707dff92d
18
dist/index.d.ts
vendored
18
dist/index.d.ts
vendored
@ -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
27
dist/index.js
vendored
@ -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
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@pushrocks/tlt",
|
||||
"name": "@pushrocks/smartmustache",
|
||||
"version": "2.0.3",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
|
10
test/test.ts
10
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'
|
||||
});
|
||||
|
@ -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;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user