BREAKING CHANGE(update scope to @pushrocks): update

This commit is contained in:
2018-08-27 23:04:15 +02:00
parent e2a93e1f47
commit 9ac0a94f59
32 changed files with 1268 additions and 1219 deletions

View File

@@ -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);
});