Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80684 views
1
/*globals Handlebars: true */
2
import Handlebars from "./handlebars.runtime";
3
4
// Compiler imports
5
import AST from "./handlebars/compiler/ast";
6
import { parser as Parser, parse } from "./handlebars/compiler/base";
7
import { Compiler, compile, precompile } from "./handlebars/compiler/compiler";
8
import JavaScriptCompiler from "./handlebars/compiler/javascript-compiler";
9
10
var _create = Handlebars.create;
11
var create = function() {
12
var hb = _create();
13
14
hb.compile = function(input, options) {
15
return compile(input, options, hb);
16
};
17
hb.precompile = function (input, options) {
18
return precompile(input, options, hb);
19
};
20
21
hb.AST = AST;
22
hb.Compiler = Compiler;
23
hb.JavaScriptCompiler = JavaScriptCompiler;
24
hb.Parser = Parser;
25
hb.parse = parse;
26
27
return hb;
28
};
29
30
Handlebars = create();
31
Handlebars.create = create;
32
33
/*jshint -W040 */
34
/* istanbul ignore next */
35
var root = typeof global !== 'undefined' ? global : window,
36
$Handlebars = root.Handlebars;
37
/* istanbul ignore next */
38
Handlebars.noConflict = function() {
39
if (root.Handlebars === Handlebars) {
40
root.Handlebars = $Handlebars;
41
}
42
};
43
44
Handlebars['default'] = Handlebars;
45
46
export default Handlebars;
47
48