6 Commits

Author SHA1 Message Date
7b27b231ff 2.0.6 2019-02-17 16:56:18 +01:00
bd9ac0ab46 fix(security): add snyk 2019-02-17 16:56:18 +01:00
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
7 changed files with 687 additions and 195 deletions

4
.snyk Normal file
View File

@@ -0,0 +1,4 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.13.3
ignore: {}
patch: {}

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

View File

@@ -1,14 +1,14 @@
import { tap, expect } from '@pushrocks/tapbundle'; 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 () => { tap.test('should create a valid instance of tlt', async () => {
testTlt = new tlt.Tlt('some awesome {{customString}} that is {{license}} licensed'); testMustache = new tlt.SmartMustache('some awesome {{customString}} that is {{license}} licensed');
expect(testTlt).to.be.instanceOf(tlt.Tlt); expect(testMustache).to.be.instanceOf(tlt.SmartMustache);
}); });
tap.test('should output a valid string with some data', async () => { tap.test('should output a valid string with some data', async () => {
let appliedString = testTlt.applyData({ let appliedString = testMustache.applyData({
customString: 'horse', customString: 'horse',
license: 'MIT' 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 * class Tlt allows templates to be used with different sets of data
*/ */
export class Tlt { export class SmartMustache {
template: any; template: any;
/** /**