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