@kosatyi/ejs 0.0.104 → 0.0.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/bundler.js +1 -1
- package/dist/cjs/browser.js +329 -554
- package/dist/cjs/bundler.js +61 -68
- package/dist/cjs/index.js +333 -558
- package/dist/cjs/worker.js +549 -830
- package/dist/esm/browser.js +276 -276
- package/dist/esm/bundler.js +62 -69
- package/dist/esm/index.js +280 -280
- package/dist/esm/worker.js +276 -276
- package/dist/umd/browser.js +868 -1093
- package/dist/umd/browser.min.js +1 -1
- package/dist/umd/index.js +901 -1126
- package/dist/umd/index.min.js +1 -1
- package/dist/umd/worker.js +549 -830
- package/dist/umd/worker.min.js +3 -1
- package/package.json +2 -2
package/dist/umd/worker.js
CHANGED
|
@@ -4,13 +4,8 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ejs = {}));
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
throw new TypeError("Private element is not present on this object");
|
|
10
|
-
}
|
|
11
|
-
function _assertThisInitialized(e) {
|
|
12
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
13
|
-
return e;
|
|
7
|
+
function _OverloadYield(e, d) {
|
|
8
|
+
this.v = e, this.k = d;
|
|
14
9
|
}
|
|
15
10
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
16
11
|
try {
|
|
@@ -37,431 +32,246 @@
|
|
|
37
32
|
});
|
|
38
33
|
};
|
|
39
34
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
35
|
+
function _regenerator() {
|
|
36
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
37
|
+
var e,
|
|
38
|
+
t,
|
|
39
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
40
|
+
n = r.iterator || "@@iterator",
|
|
41
|
+
o = r.toStringTag || "@@toStringTag";
|
|
42
|
+
function i(r, n, o, i) {
|
|
43
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
44
|
+
u = Object.create(c.prototype);
|
|
45
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
46
|
+
var i,
|
|
47
|
+
c,
|
|
48
|
+
u,
|
|
49
|
+
f = 0,
|
|
50
|
+
p = o || [],
|
|
51
|
+
y = !1,
|
|
52
|
+
G = {
|
|
53
|
+
p: 0,
|
|
54
|
+
n: 0,
|
|
55
|
+
v: e,
|
|
56
|
+
a: d,
|
|
57
|
+
f: d.bind(e, 4),
|
|
58
|
+
d: function (t, r) {
|
|
59
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
function d(r, n) {
|
|
63
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
64
|
+
var o,
|
|
65
|
+
i = p[t],
|
|
66
|
+
d = G.p,
|
|
67
|
+
l = i[2];
|
|
68
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
69
|
+
}
|
|
70
|
+
if (o || r > 1) return a;
|
|
71
|
+
throw y = !0, n;
|
|
72
|
+
}
|
|
73
|
+
return function (o, p, l) {
|
|
74
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
75
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
76
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
77
|
+
try {
|
|
78
|
+
if (f = 2, i) {
|
|
79
|
+
if (c || (o = "next"), t = i[o]) {
|
|
80
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
81
|
+
if (!t.done) return t;
|
|
82
|
+
u = t.value, c < 2 && (c = 0);
|
|
83
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
84
|
+
i = e;
|
|
85
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
86
|
+
} catch (t) {
|
|
87
|
+
i = e, c = 1, u = t;
|
|
88
|
+
} finally {
|
|
89
|
+
f = 1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
value: t,
|
|
94
|
+
done: y
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
}(r, o, i), !0), u;
|
|
72
98
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
writable: !0
|
|
85
|
-
}) : e[r] = t, e;
|
|
86
|
-
}
|
|
87
|
-
function _getPrototypeOf(t) {
|
|
88
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
89
|
-
return t.__proto__ || Object.getPrototypeOf(t);
|
|
90
|
-
}, _getPrototypeOf(t);
|
|
91
|
-
}
|
|
92
|
-
function _inherits(t, e) {
|
|
93
|
-
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
94
|
-
t.prototype = Object.create(e && e.prototype, {
|
|
95
|
-
constructor: {
|
|
96
|
-
value: t,
|
|
97
|
-
writable: !0,
|
|
98
|
-
configurable: !0
|
|
99
|
-
}
|
|
100
|
-
}), Object.defineProperty(t, "prototype", {
|
|
101
|
-
writable: !1
|
|
102
|
-
}), e && _setPrototypeOf(t, e);
|
|
103
|
-
}
|
|
104
|
-
function _isNativeFunction(t) {
|
|
105
|
-
try {
|
|
106
|
-
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
107
|
-
} catch (n) {
|
|
108
|
-
return "function" == typeof t;
|
|
99
|
+
var a = {};
|
|
100
|
+
function Generator() {}
|
|
101
|
+
function GeneratorFunction() {}
|
|
102
|
+
function GeneratorFunctionPrototype() {}
|
|
103
|
+
t = Object.getPrototypeOf;
|
|
104
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
105
|
+
return this;
|
|
106
|
+
}), t),
|
|
107
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
108
|
+
function f(e) {
|
|
109
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
109
110
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
112
|
+
return this;
|
|
113
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
114
|
+
return "[object Generator]";
|
|
115
|
+
}), (_regenerator = function () {
|
|
116
|
+
return {
|
|
117
|
+
w: i,
|
|
118
|
+
m: f
|
|
119
|
+
};
|
|
117
120
|
})();
|
|
118
121
|
}
|
|
119
|
-
function
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
function _regeneratorAsync(n, e, r, t, o) {
|
|
123
|
+
var a = _regeneratorAsyncGen(n, e, r, t, o);
|
|
124
|
+
return a.next().then(function (n) {
|
|
125
|
+
return n.done ? n.value : a.next();
|
|
126
|
+
});
|
|
123
127
|
}
|
|
124
|
-
function
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
e = {},
|
|
130
|
-
r = Object.prototype,
|
|
131
|
-
n = r.hasOwnProperty,
|
|
132
|
-
o = Object.defineProperty || function (t, e, r) {
|
|
133
|
-
t[e] = r.value;
|
|
134
|
-
},
|
|
135
|
-
i = "function" == typeof Symbol ? Symbol : {},
|
|
136
|
-
a = i.iterator || "@@iterator",
|
|
137
|
-
c = i.asyncIterator || "@@asyncIterator",
|
|
138
|
-
u = i.toStringTag || "@@toStringTag";
|
|
139
|
-
function define(t, e, r) {
|
|
140
|
-
return Object.defineProperty(t, e, {
|
|
141
|
-
value: r,
|
|
142
|
-
enumerable: !0,
|
|
143
|
-
configurable: !0,
|
|
144
|
-
writable: !0
|
|
145
|
-
}), t[e];
|
|
146
|
-
}
|
|
147
|
-
try {
|
|
148
|
-
define({}, "");
|
|
149
|
-
} catch (t) {
|
|
150
|
-
define = function (t, e, r) {
|
|
151
|
-
return t[e] = r;
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
function wrap(t, e, r, n) {
|
|
155
|
-
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
156
|
-
a = Object.create(i.prototype),
|
|
157
|
-
c = new Context(n || []);
|
|
158
|
-
return o(a, "_invoke", {
|
|
159
|
-
value: makeInvokeMethod(t, r, c)
|
|
160
|
-
}), a;
|
|
161
|
-
}
|
|
162
|
-
function tryCatch(t, e, r) {
|
|
128
|
+
function _regeneratorAsyncGen(r, e, t, o, n) {
|
|
129
|
+
return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise);
|
|
130
|
+
}
|
|
131
|
+
function _regeneratorAsyncIterator(t, e) {
|
|
132
|
+
function n(r, o, i, f) {
|
|
163
133
|
try {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
134
|
+
var c = t[r](o),
|
|
135
|
+
u = c.value;
|
|
136
|
+
return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) {
|
|
137
|
+
n("next", t, i, f);
|
|
138
|
+
}, function (t) {
|
|
139
|
+
n("throw", t, i, f);
|
|
140
|
+
}) : e.resolve(u).then(function (t) {
|
|
141
|
+
c.value = t, i(c);
|
|
142
|
+
}, function (t) {
|
|
143
|
+
return n("throw", t, i, f);
|
|
144
|
+
});
|
|
168
145
|
} catch (t) {
|
|
169
|
-
|
|
170
|
-
type: "throw",
|
|
171
|
-
arg: t
|
|
172
|
-
};
|
|
146
|
+
f(t);
|
|
173
147
|
}
|
|
174
148
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
l = "suspendedYield",
|
|
178
|
-
f = "executing",
|
|
179
|
-
s = "completed",
|
|
180
|
-
y = {};
|
|
181
|
-
function Generator() {}
|
|
182
|
-
function GeneratorFunction() {}
|
|
183
|
-
function GeneratorFunctionPrototype() {}
|
|
184
|
-
var p = {};
|
|
185
|
-
define(p, a, function () {
|
|
149
|
+
var r;
|
|
150
|
+
this.next || (_regeneratorDefine(_regeneratorAsyncIterator.prototype), _regeneratorDefine(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
|
|
186
151
|
return this;
|
|
187
|
-
})
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
192
|
-
function defineIteratorMethods(t) {
|
|
193
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
194
|
-
define(t, e, function (t) {
|
|
195
|
-
return this._invoke(e, t);
|
|
152
|
+
})), _regeneratorDefine(this, "_invoke", function (t, o, i) {
|
|
153
|
+
function f() {
|
|
154
|
+
return new e(function (e, r) {
|
|
155
|
+
n(t, i, e, r);
|
|
196
156
|
});
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
function AsyncIterator(t, e) {
|
|
200
|
-
function invoke(r, o, i, a) {
|
|
201
|
-
var c = tryCatch(t[r], t, o);
|
|
202
|
-
if ("throw" !== c.type) {
|
|
203
|
-
var u = c.arg,
|
|
204
|
-
h = u.value;
|
|
205
|
-
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
206
|
-
invoke("next", t, i, a);
|
|
207
|
-
}, function (t) {
|
|
208
|
-
invoke("throw", t, i, a);
|
|
209
|
-
}) : e.resolve(h).then(function (t) {
|
|
210
|
-
u.value = t, i(u);
|
|
211
|
-
}, function (t) {
|
|
212
|
-
return invoke("throw", t, i, a);
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
a(c.arg);
|
|
216
157
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
});
|
|
158
|
+
return r = r ? r.then(f, f) : f();
|
|
159
|
+
}, !0);
|
|
160
|
+
}
|
|
161
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
162
|
+
var i = Object.defineProperty;
|
|
163
|
+
try {
|
|
164
|
+
i({}, "", {});
|
|
165
|
+
} catch (e) {
|
|
166
|
+
i = 0;
|
|
228
167
|
}
|
|
229
|
-
function
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
168
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
169
|
+
function o(r, n) {
|
|
170
|
+
_regeneratorDefine(e, r, function (e) {
|
|
171
|
+
return this._invoke(r, n, e);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
r ? i ? i(e, r, {
|
|
175
|
+
value: n,
|
|
176
|
+
enumerable: !t,
|
|
177
|
+
configurable: !t,
|
|
178
|
+
writable: !t
|
|
179
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
180
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
181
|
+
}
|
|
182
|
+
function _regeneratorKeys(e) {
|
|
183
|
+
var n = Object(e),
|
|
184
|
+
r = [];
|
|
185
|
+
for (var t in n) r.unshift(t);
|
|
186
|
+
return function e() {
|
|
187
|
+
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
|
|
188
|
+
return e.done = !0, e;
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function _regeneratorValues(e) {
|
|
192
|
+
if (null != e) {
|
|
193
|
+
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
|
|
194
|
+
r = 0;
|
|
195
|
+
if (t) return t.call(e);
|
|
196
|
+
if ("function" == typeof e.next) return e;
|
|
197
|
+
if (!isNaN(e.length)) return {
|
|
198
|
+
next: function () {
|
|
199
|
+
return e && r >= e.length && (e = void 0), {
|
|
200
|
+
value: e && e[r++],
|
|
201
|
+
done: !e
|
|
238
202
|
};
|
|
239
203
|
}
|
|
240
|
-
for (n.method = i, n.arg = a;;) {
|
|
241
|
-
var c = n.delegate;
|
|
242
|
-
if (c) {
|
|
243
|
-
var u = maybeInvokeDelegate(c, n);
|
|
244
|
-
if (u) {
|
|
245
|
-
if (u === y) continue;
|
|
246
|
-
return u;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
250
|
-
if (o === h) throw o = s, n.arg;
|
|
251
|
-
n.dispatchException(n.arg);
|
|
252
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
253
|
-
o = f;
|
|
254
|
-
var p = tryCatch(e, r, n);
|
|
255
|
-
if ("normal" === p.type) {
|
|
256
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
257
|
-
return {
|
|
258
|
-
value: p.arg,
|
|
259
|
-
done: n.done
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
263
|
-
}
|
|
264
204
|
};
|
|
265
205
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
var e = {
|
|
277
|
-
tryLoc: t[0]
|
|
278
|
-
};
|
|
279
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
280
|
-
}
|
|
281
|
-
function resetTryEntry(t) {
|
|
282
|
-
var e = t.completion || {};
|
|
283
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
284
|
-
}
|
|
285
|
-
function Context(t) {
|
|
286
|
-
this.tryEntries = [{
|
|
287
|
-
tryLoc: "root"
|
|
288
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
289
|
-
}
|
|
290
|
-
function values(e) {
|
|
291
|
-
if (e || "" === e) {
|
|
292
|
-
var r = e[a];
|
|
293
|
-
if (r) return r.call(e);
|
|
294
|
-
if ("function" == typeof e.next) return e;
|
|
295
|
-
if (!isNaN(e.length)) {
|
|
296
|
-
var o = -1,
|
|
297
|
-
i = function next() {
|
|
298
|
-
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
299
|
-
return next.value = t, next.done = !0, next;
|
|
300
|
-
};
|
|
301
|
-
return i.next = i;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
206
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
207
|
+
}
|
|
208
|
+
function _regeneratorRuntime() {
|
|
209
|
+
|
|
210
|
+
var r = _regenerator(),
|
|
211
|
+
e = r.m(_regeneratorRuntime),
|
|
212
|
+
t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
|
|
213
|
+
function n(r) {
|
|
214
|
+
var e = "function" == typeof r && r.constructor;
|
|
215
|
+
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
|
|
305
216
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
var e
|
|
314
|
-
return
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
return this;
|
|
331
|
-
}), define(g, "toString", function () {
|
|
332
|
-
return "[object Generator]";
|
|
333
|
-
}), e.keys = function (t) {
|
|
334
|
-
var e = Object(t),
|
|
335
|
-
r = [];
|
|
336
|
-
for (var n in e) r.push(n);
|
|
337
|
-
return r.reverse(), function next() {
|
|
338
|
-
for (; r.length;) {
|
|
339
|
-
var t = r.pop();
|
|
340
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
341
|
-
}
|
|
342
|
-
return next.done = !0, next;
|
|
343
|
-
};
|
|
344
|
-
}, e.values = values, Context.prototype = {
|
|
345
|
-
constructor: Context,
|
|
346
|
-
reset: function (e) {
|
|
347
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
348
|
-
},
|
|
349
|
-
stop: function () {
|
|
350
|
-
this.done = !0;
|
|
351
|
-
var t = this.tryEntries[0].completion;
|
|
352
|
-
if ("throw" === t.type) throw t.arg;
|
|
353
|
-
return this.rval;
|
|
354
|
-
},
|
|
355
|
-
dispatchException: function (e) {
|
|
356
|
-
if (this.done) throw e;
|
|
357
|
-
var r = this;
|
|
358
|
-
function handle(n, o) {
|
|
359
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
360
|
-
}
|
|
361
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
362
|
-
var i = this.tryEntries[o],
|
|
363
|
-
a = i.completion;
|
|
364
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
365
|
-
if (i.tryLoc <= this.prev) {
|
|
366
|
-
var c = n.call(i, "catchLoc"),
|
|
367
|
-
u = n.call(i, "finallyLoc");
|
|
368
|
-
if (c && u) {
|
|
369
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
370
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
371
|
-
} else if (c) {
|
|
372
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
373
|
-
} else {
|
|
374
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
375
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
},
|
|
380
|
-
abrupt: function (t, e) {
|
|
381
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
382
|
-
var o = this.tryEntries[r];
|
|
383
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
384
|
-
var i = o;
|
|
385
|
-
break;
|
|
217
|
+
var o = {
|
|
218
|
+
throw: 1,
|
|
219
|
+
return: 2,
|
|
220
|
+
break: 3,
|
|
221
|
+
continue: 3
|
|
222
|
+
};
|
|
223
|
+
function a(r) {
|
|
224
|
+
var e, t;
|
|
225
|
+
return function (n) {
|
|
226
|
+
e || (e = {
|
|
227
|
+
stop: function () {
|
|
228
|
+
return t(n.a, 2);
|
|
229
|
+
},
|
|
230
|
+
catch: function () {
|
|
231
|
+
return n.v;
|
|
232
|
+
},
|
|
233
|
+
abrupt: function (r, e) {
|
|
234
|
+
return t(n.a, o[r], e);
|
|
235
|
+
},
|
|
236
|
+
delegateYield: function (r, o, a) {
|
|
237
|
+
return e.resultName = o, t(n.d, _regeneratorValues(r), a);
|
|
238
|
+
},
|
|
239
|
+
finish: function (r) {
|
|
240
|
+
return t(n.f, r);
|
|
386
241
|
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
if ("throw" === t.type) throw t.arg;
|
|
394
|
-
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
395
|
-
},
|
|
396
|
-
finish: function (t) {
|
|
397
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
398
|
-
var r = this.tryEntries[e];
|
|
399
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
400
|
-
}
|
|
401
|
-
},
|
|
402
|
-
catch: function (t) {
|
|
403
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
404
|
-
var r = this.tryEntries[e];
|
|
405
|
-
if (r.tryLoc === t) {
|
|
406
|
-
var n = r.completion;
|
|
407
|
-
if ("throw" === n.type) {
|
|
408
|
-
var o = n.arg;
|
|
409
|
-
resetTryEntry(r);
|
|
410
|
-
}
|
|
411
|
-
return o;
|
|
242
|
+
}, t = function (r, t, o) {
|
|
243
|
+
n.p = e.prev, n.n = e.next;
|
|
244
|
+
try {
|
|
245
|
+
return r(t, o);
|
|
246
|
+
} finally {
|
|
247
|
+
e.next = n.n;
|
|
412
248
|
}
|
|
249
|
+
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
|
|
250
|
+
try {
|
|
251
|
+
return r.call(this, e);
|
|
252
|
+
} finally {
|
|
253
|
+
n.p = e.prev, n.n = e.next;
|
|
413
254
|
}
|
|
414
|
-
|
|
415
|
-
},
|
|
416
|
-
delegateYield: function (e, r, n) {
|
|
417
|
-
return this.delegate = {
|
|
418
|
-
iterator: values(e),
|
|
419
|
-
resultName: r,
|
|
420
|
-
nextLoc: n
|
|
421
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
422
|
-
}
|
|
423
|
-
}, e;
|
|
424
|
-
}
|
|
425
|
-
function _setPrototypeOf(t, e) {
|
|
426
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
427
|
-
return t.__proto__ = e, t;
|
|
428
|
-
}, _setPrototypeOf(t, e);
|
|
429
|
-
}
|
|
430
|
-
function _toPrimitive(t, r) {
|
|
431
|
-
if ("object" != typeof t || !t) return t;
|
|
432
|
-
var e = t[Symbol.toPrimitive];
|
|
433
|
-
if (void 0 !== e) {
|
|
434
|
-
var i = e.call(t, r);
|
|
435
|
-
if ("object" != typeof i) return i;
|
|
436
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
255
|
+
};
|
|
437
256
|
}
|
|
438
|
-
return (
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
return Wrapper.prototype = Object.create(t.prototype, {
|
|
457
|
-
constructor: {
|
|
458
|
-
value: Wrapper,
|
|
459
|
-
enumerable: !1,
|
|
460
|
-
writable: !0,
|
|
461
|
-
configurable: !0
|
|
462
|
-
}
|
|
463
|
-
}), _setPrototypeOf(Wrapper, t);
|
|
464
|
-
}, _wrapNativeSuper(t);
|
|
257
|
+
return (_regeneratorRuntime = function () {
|
|
258
|
+
return {
|
|
259
|
+
wrap: function (e, t, n, o) {
|
|
260
|
+
return r.w(a(e), t, n, o && o.reverse());
|
|
261
|
+
},
|
|
262
|
+
isGeneratorFunction: n,
|
|
263
|
+
mark: r.m,
|
|
264
|
+
awrap: function (r, e) {
|
|
265
|
+
return new _OverloadYield(r, e);
|
|
266
|
+
},
|
|
267
|
+
AsyncIterator: _regeneratorAsyncIterator,
|
|
268
|
+
async: function (r, e, t, o, u) {
|
|
269
|
+
return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u);
|
|
270
|
+
},
|
|
271
|
+
keys: _regeneratorKeys,
|
|
272
|
+
values: _regeneratorValues
|
|
273
|
+
};
|
|
274
|
+
})();
|
|
465
275
|
}
|
|
466
276
|
|
|
467
277
|
var typeProp = function typeProp() {
|
|
@@ -525,12 +335,6 @@
|
|
|
525
335
|
var check = value;
|
|
526
336
|
return check == null ? '' : Boolean(escape) === true ? entities(check) : check;
|
|
527
337
|
};
|
|
528
|
-
var instanceOf = function instanceOf(object, instance) {
|
|
529
|
-
return Boolean(object instanceof instance);
|
|
530
|
-
};
|
|
531
|
-
var assertInstanceOf = function assertInstanceOf(object, instance) {
|
|
532
|
-
if (instanceOf(object, instance) === false) throw new TypeError("".concat(object, " in not instance of ").concat(instance));
|
|
533
|
-
};
|
|
534
338
|
var getPath = function getPath(context, name, strict) {
|
|
535
339
|
var data = context;
|
|
536
340
|
var chunks = String(name).split('.');
|
|
@@ -551,14 +355,6 @@
|
|
|
551
355
|
}
|
|
552
356
|
return [data, prop];
|
|
553
357
|
};
|
|
554
|
-
var bindContext = function bindContext(object) {
|
|
555
|
-
var methods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
556
|
-
methods.forEach(function (name) {
|
|
557
|
-
if (name in object) {
|
|
558
|
-
object[name] = object[name].bind(object);
|
|
559
|
-
}
|
|
560
|
-
});
|
|
561
|
-
};
|
|
562
358
|
var ext = function ext(path, defaults) {
|
|
563
359
|
var ext = path.split('.').pop();
|
|
564
360
|
if (ext !== defaults) {
|
|
@@ -673,7 +469,7 @@
|
|
|
673
469
|
};
|
|
674
470
|
|
|
675
471
|
var configSchema = function configSchema(config, options) {
|
|
676
|
-
extend(config, {
|
|
472
|
+
return extend(config, {
|
|
677
473
|
path: typeProp(isString, defaults.path, config.path, options.path),
|
|
678
474
|
"export": typeProp(isString, defaults["export"], config["export"], options["export"]),
|
|
679
475
|
resolver: typeProp(isFunction, defaults.resolver, config.resolver, options.resolver),
|
|
@@ -687,223 +483,192 @@
|
|
|
687
483
|
});
|
|
688
484
|
};
|
|
689
485
|
|
|
690
|
-
var
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
}, {
|
|
708
|
-
key: "get",
|
|
709
|
-
value: function get(key) {
|
|
710
|
-
if (_classPrivateFieldGet2(_enabled, this)) {
|
|
711
|
-
return _classPrivateFieldGet2(_list, this)[key];
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
}, {
|
|
715
|
-
key: "set",
|
|
716
|
-
value: function set(key, value) {
|
|
717
|
-
if (_classPrivateFieldGet2(_enabled, this)) {
|
|
718
|
-
_classPrivateFieldGet2(_list, this)[key] = value;
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
}, {
|
|
722
|
-
key: "exist",
|
|
723
|
-
value: function exist(key) {
|
|
724
|
-
if (_classPrivateFieldGet2(_enabled, this)) {
|
|
725
|
-
return hasProp(_classPrivateFieldGet2(_list, this), key);
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
}, {
|
|
729
|
-
key: "clear",
|
|
730
|
-
value: function clear() {
|
|
731
|
-
_classPrivateFieldSet2(_list, this, {});
|
|
732
|
-
}
|
|
733
|
-
}, {
|
|
734
|
-
key: "remove",
|
|
735
|
-
value: function remove(key) {
|
|
736
|
-
delete _classPrivateFieldGet2(_list, this)[key];
|
|
486
|
+
var Template = function Template(options, cache, compiler) {
|
|
487
|
+
var config = {
|
|
488
|
+
path: null,
|
|
489
|
+
resolver: null
|
|
490
|
+
};
|
|
491
|
+
var resolve = function resolve(path) {
|
|
492
|
+
return config.resolver(config.path, path);
|
|
493
|
+
};
|
|
494
|
+
var result = function result(template, content) {
|
|
495
|
+
cache.set(template, content);
|
|
496
|
+
return content;
|
|
497
|
+
};
|
|
498
|
+
var compile = function compile(content, template) {
|
|
499
|
+
if (isFunction(content)) {
|
|
500
|
+
return content;
|
|
501
|
+
} else {
|
|
502
|
+
return compiler.compile(content, template);
|
|
737
503
|
}
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
return
|
|
504
|
+
};
|
|
505
|
+
var get = function get(template) {
|
|
506
|
+
if (cache.exist(template)) {
|
|
507
|
+
return cache.resolve(template);
|
|
742
508
|
}
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
509
|
+
return resolve(template).then(function (content) {
|
|
510
|
+
return result(template, compile(content, template));
|
|
511
|
+
});
|
|
512
|
+
};
|
|
513
|
+
var configure = function configure(options) {
|
|
514
|
+
config.path = options.path;
|
|
515
|
+
if (isFunction(options.resolver)) {
|
|
516
|
+
config.resolver = options.resolver;
|
|
750
517
|
}
|
|
751
|
-
}
|
|
752
|
-
|
|
518
|
+
};
|
|
519
|
+
configure(options);
|
|
520
|
+
return {
|
|
521
|
+
get: get,
|
|
522
|
+
configure: configure,
|
|
523
|
+
compile: compile
|
|
524
|
+
};
|
|
525
|
+
};
|
|
753
526
|
|
|
754
|
-
var
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
_classCallCheck(this, Compiler);
|
|
759
|
-
_classPrivateFieldInitSpec(this, _config$1, {});
|
|
760
|
-
_classPrivateFieldInitSpec(this, _symbols, [{
|
|
761
|
-
symbol: '-',
|
|
762
|
-
format: function format(value) {
|
|
763
|
-
return "')\n".concat(this.BUFFER, "(").concat(this.SAFE, "(").concat(value, ",1))\n").concat(this.BUFFER, "('");
|
|
764
|
-
}
|
|
765
|
-
}, {
|
|
766
|
-
symbol: '=',
|
|
767
|
-
format: function format(value) {
|
|
768
|
-
return "')\n".concat(this.BUFFER, "(").concat(this.SAFE, "(").concat(value, "))\n").concat(this.BUFFER, "('");
|
|
769
|
-
}
|
|
770
|
-
}, {
|
|
771
|
-
symbol: '#',
|
|
772
|
-
format: function format(value) {
|
|
773
|
-
return "')\n/**".concat(value, "**/\n").concat(this.BUFFER, "('");
|
|
774
|
-
}
|
|
775
|
-
}, {
|
|
776
|
-
symbol: '',
|
|
777
|
-
format: function format(value) {
|
|
778
|
-
return "')\n".concat(value.trim(), "\n").concat(this.BUFFER, "('");
|
|
779
|
-
}
|
|
780
|
-
}]);
|
|
781
|
-
this.configure(config);
|
|
527
|
+
var configSymbols = [{
|
|
528
|
+
symbol: '-',
|
|
529
|
+
format: function format(value) {
|
|
530
|
+
return "')\n".concat(this.BUFFER, "(").concat(this.SAFE, "(").concat(value, ",1))\n").concat(this.BUFFER, "('");
|
|
782
531
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
532
|
+
}, {
|
|
533
|
+
symbol: '=',
|
|
534
|
+
format: function format(value) {
|
|
535
|
+
return "')\n".concat(this.BUFFER, "(").concat(this.SAFE, "(").concat(value, "))\n").concat(this.BUFFER, "('");
|
|
536
|
+
}
|
|
537
|
+
}, {
|
|
538
|
+
symbol: '#',
|
|
539
|
+
format: function format(value) {
|
|
540
|
+
return "')\n/**".concat(value, "**/\n").concat(this.BUFFER, "('");
|
|
541
|
+
}
|
|
542
|
+
}, {
|
|
543
|
+
symbol: '',
|
|
544
|
+
format: function format(value) {
|
|
545
|
+
return "')\n".concat(value.trim(), "\n").concat(this.BUFFER, "('");
|
|
546
|
+
}
|
|
547
|
+
}];
|
|
548
|
+
var Compiler = function Compiler(options) {
|
|
549
|
+
var config = {};
|
|
550
|
+
var configure = function configure(options) {
|
|
551
|
+
config.withObject = options.withObject;
|
|
552
|
+
config.rmWhitespace = options.rmWhitespace;
|
|
553
|
+
config.token = options.token;
|
|
554
|
+
config.vars = options.vars;
|
|
555
|
+
config.globalHelpers = options.globalHelpers;
|
|
556
|
+
config.matches = [];
|
|
557
|
+
config.formats = [];
|
|
558
|
+
config.slurp = {
|
|
559
|
+
match: '[s\t\n]*',
|
|
560
|
+
start: [config.token.start, '_'],
|
|
561
|
+
end: ['_', config.token.end]
|
|
562
|
+
};
|
|
563
|
+
configSymbols.forEach(function (item) {
|
|
564
|
+
config.matches.push(config.token.start.concat(item.symbol).concat(config.token.regex).concat(config.token.end));
|
|
565
|
+
config.formats.push(item.format.bind(config.vars));
|
|
566
|
+
});
|
|
567
|
+
config.regex = new RegExp(config.matches.join('|').concat('|$'), 'g');
|
|
568
|
+
config.slurpStart = new RegExp([config.slurp.match, config.slurp.start.join('')].join(''), 'gm');
|
|
569
|
+
config.slurpEnd = new RegExp([config.slurp.end.join(''), config.slurp.match].join(''), 'gm');
|
|
570
|
+
};
|
|
571
|
+
var compile = function compile(content, path) {
|
|
572
|
+
var _config$vars = config.vars,
|
|
573
|
+
SCOPE = _config$vars.SCOPE,
|
|
574
|
+
SAFE = _config$vars.SAFE,
|
|
575
|
+
BUFFER = _config$vars.BUFFER,
|
|
576
|
+
COMPONENT = _config$vars.COMPONENT,
|
|
577
|
+
ELEMENT = _config$vars.ELEMENT;
|
|
578
|
+
var GLOBALS = config.globalHelpers;
|
|
579
|
+
if (config.rmWhitespace) {
|
|
580
|
+
content = String(content).replace(/[\r\n]+/g, '\n').replace(/^\s+|\s+$/gm, '');
|
|
806
581
|
}
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
COMPONENT = _classPrivateFieldGet2$1.COMPONENT,
|
|
816
|
-
ELEMENT = _classPrivateFieldGet2$1.ELEMENT;
|
|
817
|
-
var GLOBALS = _classPrivateFieldGet2(_config$1, this).globalHelpers;
|
|
818
|
-
if (_classPrivateFieldGet2(_config$1, this).rmWhitespace) {
|
|
819
|
-
content = String(content).replace(/[\r\n]+/g, '\n').replace(/^\s+|\s+$/gm, '');
|
|
820
|
-
}
|
|
821
|
-
content = String(content).replace(_classPrivateFieldGet2(_config$1, this).slurpStart, _classPrivateFieldGet2(_config$1, this).token.start).replace(_classPrivateFieldGet2(_config$1, this).slurpEnd, _classPrivateFieldGet2(_config$1, this).token.end);
|
|
822
|
-
var source = "".concat(BUFFER, "('");
|
|
823
|
-
matchTokens(_classPrivateFieldGet2(_config$1, this).regex, content, function (params, index, offset) {
|
|
824
|
-
source += symbols(content.slice(index, offset));
|
|
825
|
-
params.forEach(function (value, index) {
|
|
826
|
-
if (value) {
|
|
827
|
-
source += _classPrivateFieldGet2(_config$1, _this2).formats[index](value);
|
|
828
|
-
}
|
|
829
|
-
});
|
|
582
|
+
content = String(content).replace(config.slurpStart, config.token.start).replace(config.slurpEnd, config.token.end);
|
|
583
|
+
var source = "".concat(BUFFER, "('");
|
|
584
|
+
matchTokens(config.regex, content, function (params, index, offset) {
|
|
585
|
+
source += symbols(content.slice(index, offset));
|
|
586
|
+
params.forEach(function (value, index) {
|
|
587
|
+
if (value) {
|
|
588
|
+
source += config.formats[index](value);
|
|
589
|
+
}
|
|
830
590
|
});
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
}
|
|
836
|
-
source = "".concat(BUFFER, ".start();").concat(source, "return ").concat(BUFFER, ".end();");
|
|
837
|
-
source += "\n//# sourceURL=".concat(path);
|
|
838
|
-
var result = null;
|
|
839
|
-
var params = [SCOPE, COMPONENT, ELEMENT, BUFFER, SAFE].concat(GLOBALS);
|
|
840
|
-
try {
|
|
841
|
-
result = Function.apply(null, params.concat(source));
|
|
842
|
-
result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n});");
|
|
843
|
-
} catch (e) {
|
|
844
|
-
e.filename = path;
|
|
845
|
-
e.source = source;
|
|
846
|
-
throw e;
|
|
847
|
-
}
|
|
848
|
-
return result;
|
|
591
|
+
});
|
|
592
|
+
source += "');";
|
|
593
|
+
source = "try{".concat(source, "}catch(e){return ").concat(BUFFER, ".error(e)}");
|
|
594
|
+
if (config.withObject) {
|
|
595
|
+
source = "with(".concat(SCOPE, "){").concat(source, "}");
|
|
849
596
|
}
|
|
850
|
-
|
|
851
|
-
|
|
597
|
+
source = "".concat(BUFFER, ".start();").concat(source, "return ").concat(BUFFER, ".end();");
|
|
598
|
+
source += "\n//# sourceURL=".concat(path);
|
|
599
|
+
var result = null;
|
|
600
|
+
var params = [SCOPE, COMPONENT, ELEMENT, BUFFER, SAFE].concat(GLOBALS);
|
|
601
|
+
try {
|
|
602
|
+
result = Function.apply(null, params.concat(source));
|
|
603
|
+
result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n});");
|
|
604
|
+
} catch (e) {
|
|
605
|
+
e.filename = path;
|
|
606
|
+
e.source = source;
|
|
607
|
+
throw e;
|
|
608
|
+
}
|
|
609
|
+
return result;
|
|
610
|
+
};
|
|
611
|
+
configure(options);
|
|
612
|
+
return {
|
|
613
|
+
configure: configure,
|
|
614
|
+
compile: compile
|
|
615
|
+
};
|
|
616
|
+
};
|
|
852
617
|
|
|
853
|
-
var
|
|
854
|
-
var
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
_classPrivateMethodInitSpec(this, _Template_brand);
|
|
862
|
-
_classPrivateFieldInitSpec(this, _path, void 0);
|
|
863
|
-
_classPrivateFieldInitSpec(this, _cache$1, void 0);
|
|
864
|
-
_classPrivateFieldInitSpec(this, _compiler$1, void 0);
|
|
865
|
-
_classPrivateFieldInitSpec(this, _resolver, void 0);
|
|
866
|
-
assertInstanceOf(cache, Cache);
|
|
867
|
-
assertInstanceOf(compiler, Compiler);
|
|
868
|
-
_classPrivateFieldSet2(_cache$1, this, cache);
|
|
869
|
-
_classPrivateFieldSet2(_compiler$1, this, compiler);
|
|
870
|
-
this.configure(config);
|
|
871
|
-
}
|
|
872
|
-
return _createClass(Template, [{
|
|
873
|
-
key: "configure",
|
|
874
|
-
value: function configure(config) {
|
|
875
|
-
_classPrivateFieldSet2(_path, this, config.path);
|
|
876
|
-
if (isFunction(config.resolver)) {
|
|
877
|
-
_classPrivateFieldSet2(_resolver, this, config.resolver);
|
|
878
|
-
}
|
|
618
|
+
var global = typeof globalThis !== 'undefined' ? globalThis : window || self;
|
|
619
|
+
var Cache = function Cache() {
|
|
620
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
621
|
+
var config = {};
|
|
622
|
+
var list = {};
|
|
623
|
+
var load = function load(data) {
|
|
624
|
+
if (config.enabled) {
|
|
625
|
+
extend(list, data || {});
|
|
879
626
|
}
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
if (_classPrivateFieldGet2(_cache$1, this).exist(template)) {
|
|
885
|
-
return _classPrivateFieldGet2(_cache$1, this).resolve(template);
|
|
886
|
-
}
|
|
887
|
-
return _assertClassBrand(_Template_brand, this, _resolve).call(this, template).then(function (content) {
|
|
888
|
-
return _assertClassBrand(_Template_brand, _this, _result).call(_this, template, _assertClassBrand(_Template_brand, _this, _compile).call(_this, content, template));
|
|
889
|
-
});
|
|
627
|
+
};
|
|
628
|
+
var get = function get(key) {
|
|
629
|
+
if (config.enabled) {
|
|
630
|
+
return list[key];
|
|
890
631
|
}
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
632
|
+
};
|
|
633
|
+
var set = function set(key, value) {
|
|
634
|
+
if (config.enabled) {
|
|
635
|
+
list[key] = value;
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
var exist = function exist(key) {
|
|
639
|
+
if (config.enabled) {
|
|
640
|
+
return hasProp(list, key);
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
var clear = function clear() {
|
|
644
|
+
Object.keys(list).forEach(remove);
|
|
645
|
+
};
|
|
646
|
+
var remove = function remove(key) {
|
|
647
|
+
delete list[key];
|
|
648
|
+
};
|
|
649
|
+
var resolve = function resolve(key) {
|
|
650
|
+
return Promise.resolve(get(key));
|
|
651
|
+
};
|
|
652
|
+
var configure = function configure() {
|
|
653
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
654
|
+
config.enabled = options.cache;
|
|
655
|
+
config["export"] = options["export"];
|
|
656
|
+
if (isNode() === false) {
|
|
657
|
+
load(global[config["export"]]);
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
configure(options);
|
|
661
|
+
return {
|
|
662
|
+
configure: configure,
|
|
663
|
+
load: load,
|
|
664
|
+
set: set,
|
|
665
|
+
get: get,
|
|
666
|
+
exist: exist,
|
|
667
|
+
clear: clear,
|
|
668
|
+
remove: remove,
|
|
669
|
+
resolve: resolve
|
|
670
|
+
};
|
|
671
|
+
};
|
|
907
672
|
|
|
908
673
|
var selfClosed = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
|
|
909
674
|
var space = ' ';
|
|
@@ -930,61 +695,50 @@
|
|
|
930
695
|
return result.join('');
|
|
931
696
|
};
|
|
932
697
|
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
},
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
return this.message;
|
|
952
|
-
}
|
|
953
|
-
}, {
|
|
954
|
-
key: "toString",
|
|
955
|
-
value: function toString() {
|
|
956
|
-
return this.getMessage();
|
|
957
|
-
}
|
|
958
|
-
}]);
|
|
959
|
-
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
960
|
-
var TemplateNotFound = /*#__PURE__*/function (_TemplateError2) {
|
|
961
|
-
function TemplateNotFound() {
|
|
962
|
-
var _this2;
|
|
963
|
-
_classCallCheck(this, TemplateNotFound);
|
|
964
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
965
|
-
args[_key] = arguments[_key];
|
|
966
|
-
}
|
|
967
|
-
_this2 = _callSuper(this, TemplateNotFound, [].concat(args));
|
|
968
|
-
_defineProperty(_this2, "code", 404);
|
|
969
|
-
return _this2;
|
|
970
|
-
}
|
|
971
|
-
_inherits(TemplateNotFound, _TemplateError2);
|
|
972
|
-
return _createClass(TemplateNotFound);
|
|
973
|
-
}(TemplateError);
|
|
974
|
-
var TemplateSyntaxError = /*#__PURE__*/function (_TemplateError3) {
|
|
975
|
-
function TemplateSyntaxError() {
|
|
976
|
-
var _this3;
|
|
977
|
-
_classCallCheck(this, TemplateSyntaxError);
|
|
978
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
979
|
-
args[_key2] = arguments[_key2];
|
|
980
|
-
}
|
|
981
|
-
_this3 = _callSuper(this, TemplateSyntaxError, [].concat(args));
|
|
982
|
-
_defineProperty(_this3, "code", 500);
|
|
983
|
-
return _this3;
|
|
698
|
+
/**
|
|
699
|
+
*
|
|
700
|
+
* @constructor
|
|
701
|
+
*/
|
|
702
|
+
function TemplateError() {
|
|
703
|
+
TemplateError.call(this);
|
|
704
|
+
}
|
|
705
|
+
Object.setPrototypeOf(TemplateError.prototype, Error.prototype);
|
|
706
|
+
Object.assign(TemplateError.prototype, {
|
|
707
|
+
code: 0,
|
|
708
|
+
getCode: function getCode() {
|
|
709
|
+
return this.code;
|
|
710
|
+
},
|
|
711
|
+
getMessage: function getMessage() {
|
|
712
|
+
return this.message;
|
|
713
|
+
},
|
|
714
|
+
toString: function toString() {
|
|
715
|
+
return this.getMessage();
|
|
984
716
|
}
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
*
|
|
721
|
+
* @constructor
|
|
722
|
+
*/
|
|
723
|
+
function TemplateNotFound() {
|
|
724
|
+
TemplateError.call(this);
|
|
725
|
+
}
|
|
726
|
+
Object.setPrototypeOf(TemplateNotFound.prototype, TemplateError.prototype);
|
|
727
|
+
Object.assign(TemplateNotFound.prototype, {
|
|
728
|
+
code: 404
|
|
729
|
+
});
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
*
|
|
733
|
+
* @constructor
|
|
734
|
+
*/
|
|
735
|
+
function TemplateSyntaxError() {
|
|
736
|
+
TemplateError.call(this);
|
|
737
|
+
}
|
|
738
|
+
Object.setPrototypeOf(TemplateSyntaxError.prototype, TemplateError.prototype);
|
|
739
|
+
Object.assign(TemplateSyntaxError.prototype, {
|
|
740
|
+
code: 500
|
|
741
|
+
});
|
|
988
742
|
|
|
989
743
|
function resolve(list) {
|
|
990
744
|
return Promise.all(list || []).then(function (list) {
|
|
@@ -1040,6 +794,7 @@
|
|
|
1040
794
|
SCOPE = _config$vars.SCOPE,
|
|
1041
795
|
COMPONENT = _config$vars.COMPONENT,
|
|
1042
796
|
ELEMENT = _config$vars.ELEMENT;
|
|
797
|
+
|
|
1043
798
|
/**
|
|
1044
799
|
*
|
|
1045
800
|
* @type {symbol}
|
|
@@ -1336,149 +1091,113 @@
|
|
|
1336
1091
|
});
|
|
1337
1092
|
return ContextScope;
|
|
1338
1093
|
};
|
|
1339
|
-
var
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
}
|
|
1361
|
-
}]);
|
|
1362
|
-
}();
|
|
1094
|
+
var Context = function Context(options, methods) {
|
|
1095
|
+
/**
|
|
1096
|
+
* @type {InstanceType<ContextScope>}
|
|
1097
|
+
*/
|
|
1098
|
+
var Scope;
|
|
1099
|
+
var create = function create(data) {
|
|
1100
|
+
return new Scope(data);
|
|
1101
|
+
};
|
|
1102
|
+
var helpers = function helpers(methods) {
|
|
1103
|
+
extend(Scope.prototype, methods || {});
|
|
1104
|
+
};
|
|
1105
|
+
var configure = function configure(options, methods) {
|
|
1106
|
+
Scope = createContextScope(options, methods);
|
|
1107
|
+
};
|
|
1108
|
+
configure(options, methods);
|
|
1109
|
+
return {
|
|
1110
|
+
configure: configure,
|
|
1111
|
+
create: create,
|
|
1112
|
+
helpers: helpers
|
|
1113
|
+
};
|
|
1114
|
+
};
|
|
1363
1115
|
|
|
1364
|
-
var
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
function
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
//
|
|
1389
|
-
this.helpers({
|
|
1390
|
-
require: this.require,
|
|
1391
|
-
render: this.render
|
|
1116
|
+
var _EJS$1 = function EJS() {
|
|
1117
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1118
|
+
var config = configSchema({}, options);
|
|
1119
|
+
var methods = {};
|
|
1120
|
+
var context = Context(config, methods);
|
|
1121
|
+
var compiler = Compiler(config);
|
|
1122
|
+
var cache = Cache(config);
|
|
1123
|
+
var template = Template(config, cache, compiler);
|
|
1124
|
+
var configure = function configure() {
|
|
1125
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1126
|
+
configSchema(config, options || {});
|
|
1127
|
+
context.configure(config, methods);
|
|
1128
|
+
compiler.configure(config);
|
|
1129
|
+
cache.configure(config);
|
|
1130
|
+
template.configure(config);
|
|
1131
|
+
return config;
|
|
1132
|
+
};
|
|
1133
|
+
var filePath = function filePath(name) {
|
|
1134
|
+
return ext(name, config.extension);
|
|
1135
|
+
};
|
|
1136
|
+
var require = function require(name) {
|
|
1137
|
+
var scope = createContext({});
|
|
1138
|
+
return output(filePath(name), scope).then(function () {
|
|
1139
|
+
return scope.getMacro();
|
|
1392
1140
|
});
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
}
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
}
|
|
1423
|
-
}
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
}
|
|
1442
|
-
}, {
|
|
1443
|
-
key: "helpers",
|
|
1444
|
-
value: function helpers(methods) {
|
|
1445
|
-
_classPrivateFieldGet2(_context, this).helpers(extend(_classPrivateFieldGet2(_extend, this), methods));
|
|
1446
|
-
}
|
|
1447
|
-
}, {
|
|
1448
|
-
key: "context",
|
|
1449
|
-
value: function context(data) {
|
|
1450
|
-
return _classPrivateFieldGet2(_context, this).create(data);
|
|
1451
|
-
}
|
|
1452
|
-
}, {
|
|
1453
|
-
key: "compile",
|
|
1454
|
-
value: function compile(content, path) {
|
|
1455
|
-
return _classPrivateFieldGet2(_compiler, this).compile(content, path);
|
|
1456
|
-
}
|
|
1457
|
-
}, {
|
|
1458
|
-
key: "preload",
|
|
1459
|
-
value: function preload(list) {
|
|
1460
|
-
return _classPrivateFieldGet2(_cache, this).load(list || {});
|
|
1461
|
-
}
|
|
1462
|
-
}, {
|
|
1463
|
-
key: "create",
|
|
1464
|
-
value: function create(options) {
|
|
1465
|
-
return new this.constructor(options);
|
|
1466
|
-
}
|
|
1467
|
-
}]);
|
|
1468
|
-
}();
|
|
1469
|
-
function _output(path, scope) {
|
|
1470
|
-
var _classPrivateFieldGet2$1 = _classPrivateFieldGet2(_config, this),
|
|
1471
|
-
globalHelpers = _classPrivateFieldGet2$1.globalHelpers;
|
|
1472
|
-
var params = [scope, scope.useComponent, scope.useElement, scope.getBuffer(), scope.useSafeValue];
|
|
1473
|
-
var globals = globalHelpers.filter(function (name) {
|
|
1474
|
-
return isFunction(scope[name]);
|
|
1475
|
-
}).map(function (name) {
|
|
1476
|
-
return scope[name].bind(scope);
|
|
1477
|
-
});
|
|
1478
|
-
return _classPrivateFieldGet2(_template, this).get(path).then(function (callback) {
|
|
1479
|
-
return callback.apply(scope, params.concat(globals));
|
|
1141
|
+
};
|
|
1142
|
+
var render = function render(name, data) {
|
|
1143
|
+
var scope = createContext(data);
|
|
1144
|
+
return output(filePath(name), scope).then(outputContent(name, scope));
|
|
1145
|
+
};
|
|
1146
|
+
var outputContent = function outputContent(name, scope) {
|
|
1147
|
+
return function (content) {
|
|
1148
|
+
if (scope.getExtend()) {
|
|
1149
|
+
scope.setExtend(false);
|
|
1150
|
+
return renderLayout(scope.getLayout(), scope, name);
|
|
1151
|
+
}
|
|
1152
|
+
return content;
|
|
1153
|
+
};
|
|
1154
|
+
};
|
|
1155
|
+
var renderLayout = function renderLayout(name, data, parent) {
|
|
1156
|
+
var scope = createContext(data);
|
|
1157
|
+
if (parent) scope.setParentTemplate(parent);
|
|
1158
|
+
return output(filePath(name), scope).then(outputContent(name, scope));
|
|
1159
|
+
};
|
|
1160
|
+
var helpers = function helpers(extendMethods) {
|
|
1161
|
+
context.helpers(extend(methods, extendMethods));
|
|
1162
|
+
};
|
|
1163
|
+
var createContext = function createContext(data) {
|
|
1164
|
+
return context.create(data);
|
|
1165
|
+
};
|
|
1166
|
+
var compile = function compile(content, path) {
|
|
1167
|
+
return compiler.compile(content, path);
|
|
1168
|
+
};
|
|
1169
|
+
var preload = function preload(list) {
|
|
1170
|
+
return cache.load(list || {});
|
|
1171
|
+
};
|
|
1172
|
+
var create = function create(config) {
|
|
1173
|
+
return _EJS$1(config);
|
|
1174
|
+
};
|
|
1175
|
+
var output = function output(path, scope) {
|
|
1176
|
+
var params = [scope, scope.useComponent, scope.useElement, scope.getBuffer(), scope.useSafeValue];
|
|
1177
|
+
var globals = config.globalHelpers.filter(function (name) {
|
|
1178
|
+
return isFunction(scope[name]);
|
|
1179
|
+
}).map(function (name) {
|
|
1180
|
+
return scope[name].bind(scope);
|
|
1181
|
+
});
|
|
1182
|
+
return template.get(path).then(function (callback) {
|
|
1183
|
+
return callback.apply(scope, params.concat(globals));
|
|
1184
|
+
});
|
|
1185
|
+
};
|
|
1186
|
+
helpers({
|
|
1187
|
+
render: render,
|
|
1188
|
+
require: require
|
|
1480
1189
|
});
|
|
1481
|
-
|
|
1190
|
+
return {
|
|
1191
|
+
configure: configure,
|
|
1192
|
+
create: create,
|
|
1193
|
+
createContext: createContext,
|
|
1194
|
+
render: render,
|
|
1195
|
+
require: require,
|
|
1196
|
+
preload: preload,
|
|
1197
|
+
compile: compile,
|
|
1198
|
+
helpers: helpers
|
|
1199
|
+
};
|
|
1200
|
+
};
|
|
1482
1201
|
|
|
1483
1202
|
var templateCache = {};
|
|
1484
1203
|
var getOrigin = function getOrigin(url, secure) {
|
|
@@ -1486,7 +1205,7 @@
|
|
|
1486
1205
|
url.protocol = secure ? 'https:' : 'http:';
|
|
1487
1206
|
return url.origin;
|
|
1488
1207
|
};
|
|
1489
|
-
var _EJS =
|
|
1208
|
+
var _EJS = _EJS$1({
|
|
1490
1209
|
cache: false,
|
|
1491
1210
|
withObject: false,
|
|
1492
1211
|
resolver: function resolver(path, name) {
|
|
@@ -1494,13 +1213,13 @@
|
|
|
1494
1213
|
if (isFunction(templateCache[name])) {
|
|
1495
1214
|
resolve(templateCache[name]);
|
|
1496
1215
|
} else {
|
|
1497
|
-
reject(new TemplateNotFound(
|
|
1216
|
+
reject(new TemplateNotFound());
|
|
1498
1217
|
}
|
|
1499
1218
|
});
|
|
1500
1219
|
}
|
|
1501
1220
|
}),
|
|
1502
1221
|
render = _EJS.render,
|
|
1503
|
-
|
|
1222
|
+
createContext = _EJS.createContext,
|
|
1504
1223
|
helpers = _EJS.helpers,
|
|
1505
1224
|
configure = _EJS.configure;
|
|
1506
1225
|
function useTemplates() {
|
|
@@ -1541,7 +1260,7 @@
|
|
|
1541
1260
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1542
1261
|
while (1) switch (_context.prev = _context.next) {
|
|
1543
1262
|
case 0:
|
|
1544
|
-
c.data =
|
|
1263
|
+
c.data = createContext({});
|
|
1545
1264
|
c.data.set('version', version);
|
|
1546
1265
|
c.data.set('origin', getOrigin(c.req.url, secure));
|
|
1547
1266
|
c.data.set('path', c.req.path);
|
|
@@ -1580,7 +1299,7 @@
|
|
|
1580
1299
|
exports.TemplateNotFound = TemplateNotFound;
|
|
1581
1300
|
exports.TemplateSyntaxError = TemplateSyntaxError;
|
|
1582
1301
|
exports.configure = configure;
|
|
1583
|
-
exports.
|
|
1302
|
+
exports.createContext = createContext;
|
|
1584
1303
|
exports.helpers = helpers;
|
|
1585
1304
|
exports.render = render;
|
|
1586
1305
|
exports.setRenderer = setRenderer;
|