@kosatyi/ejs 0.0.103 → 0.0.105
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/dist/cjs/worker.js +252 -296
- package/dist/esm/worker.js +21 -12
- package/dist/umd/worker.js +252 -296
- package/dist/umd/worker.min.js +3 -1
- package/package.json +2 -2
package/dist/umd/worker.js
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ejs = {}));
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
|
+
function _OverloadYield(e, d) {
|
|
8
|
+
this.v = e, this.k = d;
|
|
9
|
+
}
|
|
7
10
|
function _assertClassBrand(e, t, n) {
|
|
8
11
|
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
9
12
|
throw new TypeError("Private element is not present on this object");
|
|
@@ -121,306 +124,178 @@
|
|
|
121
124
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
122
125
|
return _assertThisInitialized(t);
|
|
123
126
|
}
|
|
124
|
-
function
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
127
|
+
function _regenerator() {
|
|
128
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
129
|
+
var e,
|
|
130
|
+
t,
|
|
131
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
132
|
+
n = r.iterator || "@@iterator",
|
|
133
|
+
o = r.toStringTag || "@@toStringTag";
|
|
134
|
+
function i(r, n, o, i) {
|
|
135
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
136
|
+
u = Object.create(c.prototype);
|
|
137
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
138
|
+
var i,
|
|
139
|
+
c,
|
|
140
|
+
u,
|
|
141
|
+
f = 0,
|
|
142
|
+
p = o || [],
|
|
143
|
+
y = !1,
|
|
144
|
+
G = {
|
|
145
|
+
p: 0,
|
|
146
|
+
n: 0,
|
|
147
|
+
v: e,
|
|
148
|
+
a: d,
|
|
149
|
+
f: d.bind(e, 4),
|
|
150
|
+
d: function (t, r) {
|
|
151
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
function d(r, n) {
|
|
155
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
156
|
+
var o,
|
|
157
|
+
i = p[t],
|
|
158
|
+
d = G.p,
|
|
159
|
+
l = i[2];
|
|
160
|
+
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));
|
|
161
|
+
}
|
|
162
|
+
if (o || r > 1) return a;
|
|
163
|
+
throw y = !0, n;
|
|
164
|
+
}
|
|
165
|
+
return function (o, p, l) {
|
|
166
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
167
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
168
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
169
|
+
try {
|
|
170
|
+
if (f = 2, i) {
|
|
171
|
+
if (c || (o = "next"), t = i[o]) {
|
|
172
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
173
|
+
if (!t.done) return t;
|
|
174
|
+
u = t.value, c < 2 && (c = 0);
|
|
175
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
176
|
+
i = e;
|
|
177
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
178
|
+
} catch (t) {
|
|
179
|
+
i = e, c = 1, u = t;
|
|
180
|
+
} finally {
|
|
181
|
+
f = 1;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
value: t,
|
|
186
|
+
done: y
|
|
187
|
+
};
|
|
172
188
|
};
|
|
173
|
-
}
|
|
189
|
+
}(r, o, i), !0), u;
|
|
174
190
|
}
|
|
175
|
-
|
|
176
|
-
var h = "suspendedStart",
|
|
177
|
-
l = "suspendedYield",
|
|
178
|
-
f = "executing",
|
|
179
|
-
s = "completed",
|
|
180
|
-
y = {};
|
|
191
|
+
var a = {};
|
|
181
192
|
function Generator() {}
|
|
182
193
|
function GeneratorFunction() {}
|
|
183
194
|
function GeneratorFunctionPrototype() {}
|
|
184
|
-
|
|
185
|
-
|
|
195
|
+
t = Object.getPrototypeOf;
|
|
196
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
197
|
+
return this;
|
|
198
|
+
}), t),
|
|
199
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
200
|
+
function f(e) {
|
|
201
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
202
|
+
}
|
|
203
|
+
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 () {
|
|
186
204
|
return this;
|
|
205
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
206
|
+
return "[object Generator]";
|
|
207
|
+
}), (_regenerator = function () {
|
|
208
|
+
return {
|
|
209
|
+
w: i,
|
|
210
|
+
m: f
|
|
211
|
+
};
|
|
212
|
+
})();
|
|
213
|
+
}
|
|
214
|
+
function _regeneratorAsync(n, e, r, t, o) {
|
|
215
|
+
var a = _regeneratorAsyncGen(n, e, r, t, o);
|
|
216
|
+
return a.next().then(function (n) {
|
|
217
|
+
return n.done ? n.value : a.next();
|
|
187
218
|
});
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
219
|
+
}
|
|
220
|
+
function _regeneratorAsyncGen(r, e, t, o, n) {
|
|
221
|
+
return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise);
|
|
222
|
+
}
|
|
223
|
+
function _regeneratorAsyncIterator(t, e) {
|
|
224
|
+
function n(r, o, i, f) {
|
|
225
|
+
try {
|
|
226
|
+
var c = t[r](o),
|
|
227
|
+
u = c.value;
|
|
228
|
+
return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) {
|
|
229
|
+
n("next", t, i, f);
|
|
230
|
+
}, function (t) {
|
|
231
|
+
n("throw", t, i, f);
|
|
232
|
+
}) : e.resolve(u).then(function (t) {
|
|
233
|
+
c.value = t, i(c);
|
|
234
|
+
}, function (t) {
|
|
235
|
+
return n("throw", t, i, f);
|
|
196
236
|
});
|
|
197
|
-
})
|
|
237
|
+
} catch (t) {
|
|
238
|
+
f(t);
|
|
239
|
+
}
|
|
198
240
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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);
|
|
241
|
+
var r;
|
|
242
|
+
this.next || (_regeneratorDefine(_regeneratorAsyncIterator.prototype), _regeneratorDefine(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
|
|
243
|
+
return this;
|
|
244
|
+
})), _regeneratorDefine(this, "_invoke", function (t, o, i) {
|
|
245
|
+
function f() {
|
|
246
|
+
return new e(function (e, r) {
|
|
247
|
+
n(t, i, e, r);
|
|
248
|
+
});
|
|
216
249
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
});
|
|
250
|
+
return r = r ? r.then(f, f) : f();
|
|
251
|
+
}, !0);
|
|
252
|
+
}
|
|
253
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
254
|
+
var i = Object.defineProperty;
|
|
255
|
+
try {
|
|
256
|
+
i({}, "", {});
|
|
257
|
+
} catch (e) {
|
|
258
|
+
i = 0;
|
|
228
259
|
}
|
|
229
|
-
function
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
260
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
261
|
+
function o(r, n) {
|
|
262
|
+
_regeneratorDefine(e, r, function (e) {
|
|
263
|
+
return this._invoke(r, n, e);
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
r ? i ? i(e, r, {
|
|
267
|
+
value: n,
|
|
268
|
+
enumerable: !t,
|
|
269
|
+
configurable: !t,
|
|
270
|
+
writable: !t
|
|
271
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
272
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
273
|
+
}
|
|
274
|
+
function _regeneratorKeys(e) {
|
|
275
|
+
var n = Object(e),
|
|
276
|
+
r = [];
|
|
277
|
+
for (var t in n) r.unshift(t);
|
|
278
|
+
return function e() {
|
|
279
|
+
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
|
|
280
|
+
return e.done = !0, e;
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
function _regeneratorValues(e) {
|
|
284
|
+
if (null != e) {
|
|
285
|
+
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
|
|
286
|
+
r = 0;
|
|
287
|
+
if (t) return t.call(e);
|
|
288
|
+
if ("function" == typeof e.next) return e;
|
|
289
|
+
if (!isNaN(e.length)) return {
|
|
290
|
+
next: function () {
|
|
291
|
+
return e && r >= e.length && (e = void 0), {
|
|
292
|
+
value: e && e[r++],
|
|
293
|
+
done: !e
|
|
238
294
|
};
|
|
239
295
|
}
|
|
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
296
|
};
|
|
265
297
|
}
|
|
266
|
-
|
|
267
|
-
var n = r.method,
|
|
268
|
-
o = e.iterator[n];
|
|
269
|
-
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
270
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
271
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
272
|
-
var a = i.arg;
|
|
273
|
-
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
274
|
-
}
|
|
275
|
-
function pushTryEntry(t) {
|
|
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");
|
|
305
|
-
}
|
|
306
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
307
|
-
value: GeneratorFunctionPrototype,
|
|
308
|
-
configurable: !0
|
|
309
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
310
|
-
value: GeneratorFunction,
|
|
311
|
-
configurable: !0
|
|
312
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
313
|
-
var e = "function" == typeof t && t.constructor;
|
|
314
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
315
|
-
}, e.mark = function (t) {
|
|
316
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
317
|
-
}, e.awrap = function (t) {
|
|
318
|
-
return {
|
|
319
|
-
__await: t
|
|
320
|
-
};
|
|
321
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
322
|
-
return this;
|
|
323
|
-
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
324
|
-
void 0 === i && (i = Promise);
|
|
325
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
326
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
327
|
-
return t.done ? t.value : a.next();
|
|
328
|
-
});
|
|
329
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
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;
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
389
|
-
var a = i ? i.completion : {};
|
|
390
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
391
|
-
},
|
|
392
|
-
complete: function (t, e) {
|
|
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;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
throw Error("illegal catch attempt");
|
|
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;
|
|
298
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
424
299
|
}
|
|
425
300
|
function _setPrototypeOf(t, e) {
|
|
426
301
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
@@ -463,6 +338,74 @@
|
|
|
463
338
|
}), _setPrototypeOf(Wrapper, t);
|
|
464
339
|
}, _wrapNativeSuper(t);
|
|
465
340
|
}
|
|
341
|
+
function _regeneratorRuntime() {
|
|
342
|
+
|
|
343
|
+
var r = _regenerator(),
|
|
344
|
+
e = r.m(_regeneratorRuntime),
|
|
345
|
+
t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
|
|
346
|
+
function n(r) {
|
|
347
|
+
var e = "function" == typeof r && r.constructor;
|
|
348
|
+
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
|
|
349
|
+
}
|
|
350
|
+
var o = {
|
|
351
|
+
throw: 1,
|
|
352
|
+
return: 2,
|
|
353
|
+
break: 3,
|
|
354
|
+
continue: 3
|
|
355
|
+
};
|
|
356
|
+
function a(r) {
|
|
357
|
+
var e, t;
|
|
358
|
+
return function (n) {
|
|
359
|
+
e || (e = {
|
|
360
|
+
stop: function () {
|
|
361
|
+
return t(n.a, 2);
|
|
362
|
+
},
|
|
363
|
+
catch: function () {
|
|
364
|
+
return n.v;
|
|
365
|
+
},
|
|
366
|
+
abrupt: function (r, e) {
|
|
367
|
+
return t(n.a, o[r], e);
|
|
368
|
+
},
|
|
369
|
+
delegateYield: function (r, o, a) {
|
|
370
|
+
return e.resultName = o, t(n.d, _regeneratorValues(r), a);
|
|
371
|
+
},
|
|
372
|
+
finish: function (r) {
|
|
373
|
+
return t(n.f, r);
|
|
374
|
+
}
|
|
375
|
+
}, t = function (r, t, o) {
|
|
376
|
+
n.p = e.prev, n.n = e.next;
|
|
377
|
+
try {
|
|
378
|
+
return r(t, o);
|
|
379
|
+
} finally {
|
|
380
|
+
e.next = n.n;
|
|
381
|
+
}
|
|
382
|
+
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
|
|
383
|
+
try {
|
|
384
|
+
return r.call(this, e);
|
|
385
|
+
} finally {
|
|
386
|
+
n.p = e.prev, n.n = e.next;
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
return (_regeneratorRuntime = function () {
|
|
391
|
+
return {
|
|
392
|
+
wrap: function (e, t, n, o) {
|
|
393
|
+
return r.w(a(e), t, n, o && o.reverse());
|
|
394
|
+
},
|
|
395
|
+
isGeneratorFunction: n,
|
|
396
|
+
mark: r.m,
|
|
397
|
+
awrap: function (r, e) {
|
|
398
|
+
return new _OverloadYield(r, e);
|
|
399
|
+
},
|
|
400
|
+
AsyncIterator: _regeneratorAsyncIterator,
|
|
401
|
+
async: function (r, e, t, o, u) {
|
|
402
|
+
return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u);
|
|
403
|
+
},
|
|
404
|
+
keys: _regeneratorKeys,
|
|
405
|
+
values: _regeneratorValues
|
|
406
|
+
};
|
|
407
|
+
})();
|
|
408
|
+
}
|
|
466
409
|
|
|
467
410
|
var typeProp = function typeProp() {
|
|
468
411
|
var args = [].slice.call(arguments);
|
|
@@ -1480,9 +1423,9 @@
|
|
|
1480
1423
|
});
|
|
1481
1424
|
}
|
|
1482
1425
|
|
|
1483
|
-
var
|
|
1426
|
+
var templateCache = {};
|
|
1484
1427
|
var getOrigin = function getOrigin(url, secure) {
|
|
1485
|
-
url =
|
|
1428
|
+
url = URL.parse(url);
|
|
1486
1429
|
url.protocol = secure ? 'https:' : 'http:';
|
|
1487
1430
|
return url.origin;
|
|
1488
1431
|
};
|
|
@@ -1491,8 +1434,8 @@
|
|
|
1491
1434
|
withObject: false,
|
|
1492
1435
|
resolver: function resolver(path, name) {
|
|
1493
1436
|
return new Promise(function (resolve, reject) {
|
|
1494
|
-
if (
|
|
1495
|
-
resolve(
|
|
1437
|
+
if (isFunction(templateCache[name])) {
|
|
1438
|
+
resolve(templateCache[name]);
|
|
1496
1439
|
} else {
|
|
1497
1440
|
reject(new TemplateNotFound("template ".concat(name, " not found")));
|
|
1498
1441
|
}
|
|
@@ -1502,12 +1445,18 @@
|
|
|
1502
1445
|
render = _EJS.render,
|
|
1503
1446
|
context = _EJS.context,
|
|
1504
1447
|
helpers = _EJS.helpers,
|
|
1505
|
-
configure = _EJS.configure
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
Object.assign(
|
|
1448
|
+
configure = _EJS.configure;
|
|
1449
|
+
function useTemplates() {
|
|
1450
|
+
var templates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1451
|
+
Object.assign(templateCache, templates);
|
|
1509
1452
|
}
|
|
1510
1453
|
|
|
1454
|
+
/**
|
|
1455
|
+
* @deprecated Renamed to `useTemplates`
|
|
1456
|
+
* @param {Object<string,any>} templates
|
|
1457
|
+
*/
|
|
1458
|
+
var setTemplates = useTemplates;
|
|
1459
|
+
|
|
1511
1460
|
/**
|
|
1512
1461
|
* @typedef {{}} HonoContext
|
|
1513
1462
|
* @property {function(*):Promise<Response>} html
|
|
@@ -1522,11 +1471,14 @@
|
|
|
1522
1471
|
* @param {Object<string,any>} options
|
|
1523
1472
|
* @return {(function(c:HonoContext, next): Promise<any>)|*}
|
|
1524
1473
|
*/
|
|
1525
|
-
function
|
|
1474
|
+
function useRenderer() {
|
|
1526
1475
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
1476
|
+
_ref$templates = _ref.templates,
|
|
1477
|
+
templates = _ref$templates === void 0 ? {} : _ref$templates,
|
|
1527
1478
|
version = _ref.version,
|
|
1528
1479
|
_ref$secure = _ref.secure,
|
|
1529
1480
|
secure = _ref$secure === void 0 ? true : _ref$secure;
|
|
1481
|
+
useTemplates(templates);
|
|
1530
1482
|
return /*#__PURE__*/function () {
|
|
1531
1483
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(c, next) {
|
|
1532
1484
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -1562,17 +1514,21 @@
|
|
|
1562
1514
|
}();
|
|
1563
1515
|
}
|
|
1564
1516
|
|
|
1565
|
-
|
|
1517
|
+
/**
|
|
1518
|
+
* @deprecated Renamed to `useRenderer`
|
|
1519
|
+
*/
|
|
1520
|
+
var setRenderer = useRenderer;
|
|
1566
1521
|
|
|
1567
1522
|
exports.TemplateError = TemplateError;
|
|
1568
1523
|
exports.TemplateNotFound = TemplateNotFound;
|
|
1569
1524
|
exports.TemplateSyntaxError = TemplateSyntaxError;
|
|
1570
1525
|
exports.configure = configure;
|
|
1571
1526
|
exports.context = context;
|
|
1572
|
-
exports.create = create;
|
|
1573
1527
|
exports.helpers = helpers;
|
|
1574
1528
|
exports.render = render;
|
|
1575
1529
|
exports.setRenderer = setRenderer;
|
|
1576
1530
|
exports.setTemplates = setTemplates;
|
|
1531
|
+
exports.useRenderer = useRenderer;
|
|
1532
|
+
exports.useTemplates = useTemplates;
|
|
1577
1533
|
|
|
1578
1534
|
}));
|