Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80698 views
1
"use strict";
2
/*globals Handlebars: true */
3
var base = require("./handlebars/base");
4
5
// Each of these augment the Handlebars object. No need to setup here.
6
// (This is done to easily share code between commonjs and browse envs)
7
var SafeString = require("./handlebars/safe-string")["default"];
8
var Exception = require("./handlebars/exception")["default"];
9
var Utils = require("./handlebars/utils");
10
var runtime = require("./handlebars/runtime");
11
12
// For compatibility and usage outside of module systems, make the Handlebars object a namespace
13
var create = function() {
14
var hb = new base.HandlebarsEnvironment();
15
16
Utils.extend(hb, base);
17
hb.SafeString = SafeString;
18
hb.Exception = Exception;
19
hb.Utils = Utils;
20
hb.escapeExpression = Utils.escapeExpression;
21
22
hb.VM = runtime;
23
hb.template = function(spec) {
24
return runtime.template(spec, hb);
25
};
26
27
return hb;
28
};
29
30
var 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
exports["default"] = Handlebars;
47