add __compile helper
This commit is contained in:
parent
fef292d81f
commit
69ff80cc2b
4
dist/index.d.ts
vendored
4
dist/index.d.ts
vendored
@ -1,5 +1,7 @@
|
||||
/// <reference types="handlebars" />
|
||||
export declare type TTemplateStringType = 'filePath' | 'code';
|
||||
export declare let handlebars: typeof Handlebars;
|
||||
export * from './smarthbs.compile';
|
||||
export * from './smarthbs.helpers';
|
||||
import './smarthbs.helpers';
|
||||
export * from './smarthbs.partials';
|
||||
export * from './smarthbs.template';
|
||||
|
6
dist/index.js
vendored
6
dist/index.js
vendored
@ -3,8 +3,10 @@ function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const plugins = require("./smarthbs.plugins");
|
||||
exports.handlebars = plugins.handlebars;
|
||||
__export(require("./smarthbs.compile"));
|
||||
__export(require("./smarthbs.helpers"));
|
||||
require("./smarthbs.helpers");
|
||||
__export(require("./smarthbs.partials"));
|
||||
__export(require("./smarthbs.template"));
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUdBLHdDQUFrQztBQUNsQyx3Q0FBa0M7QUFDbEMseUNBQW1DO0FBQ25DLHlDQUFtQyJ9
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLDhDQUE2QztBQUdsQyxRQUFBLFVBQVUsR0FBRyxPQUFPLENBQUMsVUFBVSxDQUFBO0FBQzFDLHdDQUFrQztBQUNsQyw4QkFBMkI7QUFDM0IseUNBQW1DO0FBQ25DLHlDQUFtQyJ9
|
2
dist/smarthbs.helpers.d.ts
vendored
2
dist/smarthbs.helpers.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
/// <reference types="handlebars" />
|
||||
export declare let registerHelper: typeof Handlebars.registerHelper;
|
7
dist/smarthbs.helpers.js
vendored
7
dist/smarthbs.helpers.js
vendored
@ -1,5 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const plugins = require("./smarthbs.plugins");
|
||||
exports.registerHelper = plugins.handlebars.registerHelper;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRoYnMuaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0aGJzLmhlbHBlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSw4Q0FBNkM7QUFFbEMsUUFBQSxjQUFjLEdBQUcsT0FBTyxDQUFDLFVBQVUsQ0FBQyxjQUFjLENBQUEifQ==
|
||||
plugins.handlebars.registerHelper('__compile', (evaluationString, evaluationContext) => {
|
||||
let template = plugins.handlebars.compile(evaluationString);
|
||||
return template(evaluationContext);
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRoYnMuaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0aGJzLmhlbHBlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSw4Q0FBNkM7QUFFN0MsT0FBTyxDQUFDLFVBQVUsQ0FBQyxjQUFjLENBQUMsV0FBVyxFQUFFLENBQUMsZ0JBQWdCLEVBQUUsaUJBQWlCO0lBQ2pGLElBQUksUUFBUSxHQUFHLE9BQU8sQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLGdCQUFnQixDQUFDLENBQUE7SUFDM0QsTUFBTSxDQUFDLFFBQVEsQ0FBQyxpQkFBaUIsQ0FBQyxDQUFBO0FBQ3BDLENBQUMsQ0FBQyxDQUFBIn0=
|
@ -1,7 +1,8 @@
|
||||
import * as plugins from './smarthbs.plugins'
|
||||
export type TTemplateStringType = 'filePath' | 'code'
|
||||
|
||||
export let handlebars = plugins.handlebars
|
||||
export * from './smarthbs.compile'
|
||||
export * from './smarthbs.helpers'
|
||||
import './smarthbs.helpers'
|
||||
export * from './smarthbs.partials'
|
||||
export * from './smarthbs.template'
|
||||
|
@ -1,4 +1,7 @@
|
||||
import * as plugins from './smarthbs.plugins'
|
||||
|
||||
export let registerHelper = plugins.handlebars.registerHelper
|
||||
plugins.handlebars.registerHelper('__compile', (evaluationString, evaluationContext) => {
|
||||
let template = plugins.handlebars.compile(evaluationString)
|
||||
return template(evaluationContext)
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user