fix(build): migrate filesystem access to smartfs and tighten TypeScript compatibility
This commit is contained in:
@@ -4,7 +4,7 @@ import * as plugins from './smarthbs.plugins.js';
|
||||
* Helper:
|
||||
* Allows you to analyze a context
|
||||
*/
|
||||
plugins.handlebars.registerHelper('__analyze', (analyzeContext) => {
|
||||
plugins.handlebars.registerHelper('__analyze', (analyzeContext: unknown) => {
|
||||
if (typeof analyzeContext === 'string') {
|
||||
if (plugins.handlebars.partials[analyzeContext]) {
|
||||
console.log(`The analyzed partial ${analyzeContext} looks like this`);
|
||||
@@ -20,12 +20,15 @@ plugins.handlebars.registerHelper('__analyze', (analyzeContext) => {
|
||||
* Helper:
|
||||
* logs all registered partials to console
|
||||
*/
|
||||
plugins.handlebars.registerHelper('__allPartialsLog', (analyzeContext) => {
|
||||
plugins.handlebars.registerHelper('__allPartialsLog', (_analyzeContext: unknown) => {
|
||||
console.log(plugins.handlebars.partials);
|
||||
return 'analyzed';
|
||||
});
|
||||
|
||||
plugins.handlebars.registerHelper('__compile', (evaluationString, evaluationContext) => {
|
||||
let template = plugins.handlebars.compile(evaluationString);
|
||||
plugins.handlebars.registerHelper('__compile', (evaluationString: unknown, evaluationContext: unknown) => {
|
||||
if (typeof evaluationString !== 'string') {
|
||||
return '';
|
||||
}
|
||||
const template = plugins.handlebars.compile(evaluationString);
|
||||
return template(evaluationContext);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user