BREAKING CHANGE(update scope to @pushrocks): update
This commit is contained in:
@@ -1,32 +1,31 @@
|
||||
import * as plugins from './smarthbs.plugins'
|
||||
import * as plugins from './smarthbs.plugins';
|
||||
|
||||
/**
|
||||
* Helper:
|
||||
* Allows you to analyze a context
|
||||
*/
|
||||
plugins.handlebars.registerHelper('__analyze', (analyzeContext) => {
|
||||
plugins.handlebars.registerHelper('__analyze', analyzeContext => {
|
||||
if (typeof analyzeContext === 'string') {
|
||||
if (plugins.handlebars.partials[analyzeContext]) {
|
||||
plugins.beautylog.log(`The analyzed partial ${analyzeContext} looks like this`)
|
||||
console.log(plugins.handlebars.partials[analyzeContext])
|
||||
console.log(`The analyzed partial ${analyzeContext} looks like this`);
|
||||
console.log(plugins.handlebars.partials[analyzeContext]);
|
||||
} else {
|
||||
plugins.beautylog.error(`The Partial ${analyzeContext} cannot be found`)
|
||||
console.error(`The Partial ${analyzeContext} cannot be found`);
|
||||
}
|
||||
return 'analyzed'
|
||||
return 'analyzed';
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
/**
|
||||
* Helper:
|
||||
* logs all registered partials to console
|
||||
*/
|
||||
plugins.handlebars.registerHelper('__allPartialsLog', (analyzeContext) => {
|
||||
console.log(plugins.handlebars.partials)
|
||||
return 'analyzed'
|
||||
})
|
||||
plugins.handlebars.registerHelper('__allPartialsLog', analyzeContext => {
|
||||
console.log(plugins.handlebars.partials);
|
||||
return 'analyzed';
|
||||
});
|
||||
|
||||
plugins.handlebars.registerHelper('__compile', (evaluationString, evaluationContext) => {
|
||||
let template = plugins.handlebars.compile(evaluationString)
|
||||
return template(evaluationContext)
|
||||
})
|
||||
|
||||
let template = plugins.handlebars.compile(evaluationString);
|
||||
return template(evaluationContext);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user