Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80684 views
1
/*globals Handlebars: true */
2
module base from "./handlebars/base";
3
4
// Each of these augment the Handlebars object. No need to setup here.
5
// (This is done to easily share code between commonjs and browse envs)
6
import SafeString from "./handlebars/safe-string";
7
import Exception from "./handlebars/exception";
8
module Utils from "./handlebars/utils";
9
module runtime from "./handlebars/runtime";
10
11
// For compatibility and usage outside of module systems, make the Handlebars object a namespace
12
var create = function() {
13
var hb = new base.HandlebarsEnvironment();
14
15
Utils.extend(hb, base);
16
hb.SafeString = SafeString;
17
hb.Exception = Exception;
18
hb.Utils = Utils;
19
hb.escapeExpression = Utils.escapeExpression;
20
21
hb.VM = runtime;
22
hb.template = function(spec) {
23
return runtime.template(spec, hb);
24
};
25
26
return hb;
27
};
28
29
var Handlebars = create();
30
Handlebars.create = create;
31
32
/*jshint -W040 */
33
/* istanbul ignore next */
34
var root = typeof global !== 'undefined' ? global : window,
35
$Handlebars = root.Handlebars;
36
/* istanbul ignore next */
37
Handlebars.noConflict = function() {
38
if (root.Handlebars === Handlebars) {
39
root.Handlebars = $Handlebars;
40
}
41
};
42
43
Handlebars['default'] = Handlebars;
44
45
export default Handlebars;
46
47