Comparing version 1.2.58 to 1.2.59
@@ -11,247 +11,252 @@ 'use strict'; | ||
_regeneratorRuntime = function () { | ||
return exports; | ||
return e; | ||
}; | ||
var exports = {}, | ||
Op = Object.prototype, | ||
hasOwn = Op.hasOwnProperty, | ||
defineProperty = Object.defineProperty || function (obj, key, desc) { | ||
obj[key] = desc.value; | ||
var t, | ||
e = {}, | ||
r = Object.prototype, | ||
n = r.hasOwnProperty, | ||
o = Object.defineProperty || function (t, e, r) { | ||
t[e] = r.value; | ||
}, | ||
$Symbol = "function" == typeof Symbol ? Symbol : {}, | ||
iteratorSymbol = $Symbol.iterator || "@@iterator", | ||
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", | ||
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; | ||
function define(obj, key, value) { | ||
return Object.defineProperty(obj, key, { | ||
value: value, | ||
i = "function" == typeof Symbol ? Symbol : {}, | ||
a = i.iterator || "@@iterator", | ||
c = i.asyncIterator || "@@asyncIterator", | ||
u = i.toStringTag || "@@toStringTag"; | ||
function define(t, e, r) { | ||
return Object.defineProperty(t, e, { | ||
value: r, | ||
enumerable: !0, | ||
configurable: !0, | ||
writable: !0 | ||
}), obj[key]; | ||
}), t[e]; | ||
} | ||
try { | ||
define({}, ""); | ||
} catch (err) { | ||
define = function (obj, key, value) { | ||
return obj[key] = value; | ||
} catch (t) { | ||
define = function (t, e, r) { | ||
return t[e] = r; | ||
}; | ||
} | ||
function wrap(innerFn, outerFn, self, tryLocsList) { | ||
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, | ||
generator = Object.create(protoGenerator.prototype), | ||
context = new Context(tryLocsList || []); | ||
return defineProperty(generator, "_invoke", { | ||
value: makeInvokeMethod(innerFn, self, context) | ||
}), generator; | ||
function wrap(t, e, r, n) { | ||
var i = e && e.prototype instanceof Generator ? e : Generator, | ||
a = Object.create(i.prototype), | ||
c = new Context(n || []); | ||
return o(a, "_invoke", { | ||
value: makeInvokeMethod(t, r, c) | ||
}), a; | ||
} | ||
function tryCatch(fn, obj, arg) { | ||
function tryCatch(t, e, r) { | ||
try { | ||
return { | ||
type: "normal", | ||
arg: fn.call(obj, arg) | ||
arg: t.call(e, r) | ||
}; | ||
} catch (err) { | ||
} catch (t) { | ||
return { | ||
type: "throw", | ||
arg: err | ||
arg: t | ||
}; | ||
} | ||
} | ||
exports.wrap = wrap; | ||
var ContinueSentinel = {}; | ||
e.wrap = wrap; | ||
var h = "suspendedStart", | ||
l = "suspendedYield", | ||
f = "executing", | ||
s = "completed", | ||
y = {}; | ||
function Generator() {} | ||
function GeneratorFunction() {} | ||
function GeneratorFunctionPrototype() {} | ||
var IteratorPrototype = {}; | ||
define(IteratorPrototype, iteratorSymbol, function () { | ||
var p = {}; | ||
define(p, a, function () { | ||
return this; | ||
}); | ||
var getProto = Object.getPrototypeOf, | ||
NativeIteratorPrototype = getProto && getProto(getProto(values([]))); | ||
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); | ||
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); | ||
function defineIteratorMethods(prototype) { | ||
["next", "throw", "return"].forEach(function (method) { | ||
define(prototype, method, function (arg) { | ||
return this._invoke(method, arg); | ||
var d = Object.getPrototypeOf, | ||
v = d && d(d(values([]))); | ||
v && v !== r && n.call(v, a) && (p = v); | ||
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); | ||
function defineIteratorMethods(t) { | ||
["next", "throw", "return"].forEach(function (e) { | ||
define(t, e, function (t) { | ||
return this._invoke(e, t); | ||
}); | ||
}); | ||
} | ||
function AsyncIterator(generator, PromiseImpl) { | ||
function invoke(method, arg, resolve, reject) { | ||
var record = tryCatch(generator[method], generator, arg); | ||
if ("throw" !== record.type) { | ||
var result = record.arg, | ||
value = result.value; | ||
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { | ||
invoke("next", value, resolve, reject); | ||
}, function (err) { | ||
invoke("throw", err, resolve, reject); | ||
}) : PromiseImpl.resolve(value).then(function (unwrapped) { | ||
result.value = unwrapped, resolve(result); | ||
}, function (error) { | ||
return invoke("throw", error, resolve, reject); | ||
function AsyncIterator(t, e) { | ||
function invoke(r, o, i, a) { | ||
var c = tryCatch(t[r], t, o); | ||
if ("throw" !== c.type) { | ||
var u = c.arg, | ||
h = u.value; | ||
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { | ||
invoke("next", t, i, a); | ||
}, function (t) { | ||
invoke("throw", t, i, a); | ||
}) : e.resolve(h).then(function (t) { | ||
u.value = t, i(u); | ||
}, function (t) { | ||
return invoke("throw", t, i, a); | ||
}); | ||
} | ||
reject(record.arg); | ||
a(c.arg); | ||
} | ||
var previousPromise; | ||
defineProperty(this, "_invoke", { | ||
value: function (method, arg) { | ||
var r; | ||
o(this, "_invoke", { | ||
value: function (t, n) { | ||
function callInvokeWithMethodAndArg() { | ||
return new PromiseImpl(function (resolve, reject) { | ||
invoke(method, arg, resolve, reject); | ||
return new e(function (e, r) { | ||
invoke(t, n, e, r); | ||
}); | ||
} | ||
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); | ||
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); | ||
} | ||
}); | ||
} | ||
function makeInvokeMethod(innerFn, self, context) { | ||
var state = "suspendedStart"; | ||
return function (method, arg) { | ||
if ("executing" === state) throw new Error("Generator is already running"); | ||
if ("completed" === state) { | ||
if ("throw" === method) throw arg; | ||
function makeInvokeMethod(e, r, n) { | ||
var o = h; | ||
return function (i, a) { | ||
if (o === f) throw new Error("Generator is already running"); | ||
if (o === s) { | ||
if ("throw" === i) throw a; | ||
return { | ||
value: void 0, | ||
value: t, | ||
done: !0 | ||
}; | ||
} | ||
for (context.method = method, context.arg = arg;;) { | ||
var delegate = context.delegate; | ||
if (delegate) { | ||
var delegateResult = maybeInvokeDelegate(delegate, context); | ||
if (delegateResult) { | ||
if (delegateResult === ContinueSentinel) continue; | ||
return delegateResult; | ||
for (n.method = i, n.arg = a;;) { | ||
var c = n.delegate; | ||
if (c) { | ||
var u = maybeInvokeDelegate(c, n); | ||
if (u) { | ||
if (u === y) continue; | ||
return u; | ||
} | ||
} | ||
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { | ||
if ("suspendedStart" === state) throw state = "completed", context.arg; | ||
context.dispatchException(context.arg); | ||
} else "return" === context.method && context.abrupt("return", context.arg); | ||
state = "executing"; | ||
var record = tryCatch(innerFn, self, context); | ||
if ("normal" === record.type) { | ||
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; | ||
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { | ||
if (o === h) throw o = s, n.arg; | ||
n.dispatchException(n.arg); | ||
} else "return" === n.method && n.abrupt("return", n.arg); | ||
o = f; | ||
var p = tryCatch(e, r, n); | ||
if ("normal" === p.type) { | ||
if (o = n.done ? s : l, p.arg === y) continue; | ||
return { | ||
value: record.arg, | ||
done: context.done | ||
value: p.arg, | ||
done: n.done | ||
}; | ||
} | ||
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); | ||
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); | ||
} | ||
}; | ||
} | ||
function maybeInvokeDelegate(delegate, context) { | ||
var methodName = context.method, | ||
method = delegate.iterator[methodName]; | ||
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; | ||
var record = tryCatch(method, delegate.iterator, context.arg); | ||
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; | ||
var info = record.arg; | ||
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); | ||
function maybeInvokeDelegate(e, r) { | ||
var n = r.method, | ||
o = e.iterator[n]; | ||
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; | ||
var i = tryCatch(o, e.iterator, r.arg); | ||
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; | ||
var a = i.arg; | ||
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); | ||
} | ||
function pushTryEntry(locs) { | ||
var entry = { | ||
tryLoc: locs[0] | ||
function pushTryEntry(t) { | ||
var e = { | ||
tryLoc: t[0] | ||
}; | ||
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); | ||
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); | ||
} | ||
function resetTryEntry(entry) { | ||
var record = entry.completion || {}; | ||
record.type = "normal", delete record.arg, entry.completion = record; | ||
function resetTryEntry(t) { | ||
var e = t.completion || {}; | ||
e.type = "normal", delete e.arg, t.completion = e; | ||
} | ||
function Context(tryLocsList) { | ||
function Context(t) { | ||
this.tryEntries = [{ | ||
tryLoc: "root" | ||
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); | ||
}], t.forEach(pushTryEntry, this), this.reset(!0); | ||
} | ||
function values(iterable) { | ||
if (iterable || "" === iterable) { | ||
var iteratorMethod = iterable[iteratorSymbol]; | ||
if (iteratorMethod) return iteratorMethod.call(iterable); | ||
if ("function" == typeof iterable.next) return iterable; | ||
if (!isNaN(iterable.length)) { | ||
var i = -1, | ||
next = function next() { | ||
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; | ||
return next.value = undefined, next.done = !0, next; | ||
function values(e) { | ||
if (e || "" === e) { | ||
var r = e[a]; | ||
if (r) return r.call(e); | ||
if ("function" == typeof e.next) return e; | ||
if (!isNaN(e.length)) { | ||
var o = -1, | ||
i = function next() { | ||
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; | ||
return next.value = t, next.done = !0, next; | ||
}; | ||
return next.next = next; | ||
return i.next = i; | ||
} | ||
} | ||
throw new TypeError(typeof iterable + " is not iterable"); | ||
throw new TypeError(typeof e + " is not iterable"); | ||
} | ||
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { | ||
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { | ||
value: GeneratorFunctionPrototype, | ||
configurable: !0 | ||
}), defineProperty(GeneratorFunctionPrototype, "constructor", { | ||
}), o(GeneratorFunctionPrototype, "constructor", { | ||
value: GeneratorFunction, | ||
configurable: !0 | ||
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { | ||
var ctor = "function" == typeof genFun && genFun.constructor; | ||
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); | ||
}, exports.mark = function (genFun) { | ||
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; | ||
}, exports.awrap = function (arg) { | ||
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { | ||
var e = "function" == typeof t && t.constructor; | ||
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); | ||
}, e.mark = function (t) { | ||
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; | ||
}, e.awrap = function (t) { | ||
return { | ||
__await: arg | ||
__await: t | ||
}; | ||
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { | ||
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { | ||
return this; | ||
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { | ||
void 0 === PromiseImpl && (PromiseImpl = Promise); | ||
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); | ||
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { | ||
return result.done ? result.value : iter.next(); | ||
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { | ||
void 0 === i && (i = Promise); | ||
var a = new AsyncIterator(wrap(t, r, n, o), i); | ||
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { | ||
return t.done ? t.value : a.next(); | ||
}); | ||
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { | ||
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { | ||
return this; | ||
}), define(Gp, "toString", function () { | ||
}), define(g, "toString", function () { | ||
return "[object Generator]"; | ||
}), exports.keys = function (val) { | ||
var object = Object(val), | ||
keys = []; | ||
for (var key in object) keys.push(key); | ||
return keys.reverse(), function next() { | ||
for (; keys.length;) { | ||
var key = keys.pop(); | ||
if (key in object) return next.value = key, next.done = !1, next; | ||
}), e.keys = function (t) { | ||
var e = Object(t), | ||
r = []; | ||
for (var n in e) r.push(n); | ||
return r.reverse(), function next() { | ||
for (; r.length;) { | ||
var t = r.pop(); | ||
if (t in e) return next.value = t, next.done = !1, next; | ||
} | ||
return next.done = !0, next; | ||
}; | ||
}, exports.values = values, Context.prototype = { | ||
}, e.values = values, Context.prototype = { | ||
constructor: Context, | ||
reset: function (skipTempReset) { | ||
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); | ||
reset: function (e) { | ||
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); | ||
}, | ||
stop: function () { | ||
this.done = !0; | ||
var rootRecord = this.tryEntries[0].completion; | ||
if ("throw" === rootRecord.type) throw rootRecord.arg; | ||
var t = this.tryEntries[0].completion; | ||
if ("throw" === t.type) throw t.arg; | ||
return this.rval; | ||
}, | ||
dispatchException: function (exception) { | ||
if (this.done) throw exception; | ||
var context = this; | ||
function handle(loc, caught) { | ||
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; | ||
dispatchException: function (e) { | ||
if (this.done) throw e; | ||
var r = this; | ||
function handle(n, o) { | ||
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; | ||
} | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i], | ||
record = entry.completion; | ||
if ("root" === entry.tryLoc) return handle("end"); | ||
if (entry.tryLoc <= this.prev) { | ||
var hasCatch = hasOwn.call(entry, "catchLoc"), | ||
hasFinally = hasOwn.call(entry, "finallyLoc"); | ||
if (hasCatch && hasFinally) { | ||
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); | ||
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); | ||
} else if (hasCatch) { | ||
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); | ||
for (var o = this.tryEntries.length - 1; o >= 0; --o) { | ||
var i = this.tryEntries[o], | ||
a = i.completion; | ||
if ("root" === i.tryLoc) return handle("end"); | ||
if (i.tryLoc <= this.prev) { | ||
var c = n.call(i, "catchLoc"), | ||
u = n.call(i, "finallyLoc"); | ||
if (c && u) { | ||
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); | ||
if (this.prev < i.finallyLoc) return handle(i.finallyLoc); | ||
} else if (c) { | ||
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); | ||
} else { | ||
if (!hasFinally) throw new Error("try statement without catch or finally"); | ||
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); | ||
if (!u) throw new Error("try statement without catch or finally"); | ||
if (this.prev < i.finallyLoc) return handle(i.finallyLoc); | ||
} | ||
@@ -261,34 +266,34 @@ } | ||
}, | ||
abrupt: function (type, arg) { | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i]; | ||
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { | ||
var finallyEntry = entry; | ||
abrupt: function (t, e) { | ||
for (var r = this.tryEntries.length - 1; r >= 0; --r) { | ||
var o = this.tryEntries[r]; | ||
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { | ||
var i = o; | ||
break; | ||
} | ||
} | ||
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); | ||
var record = finallyEntry ? finallyEntry.completion : {}; | ||
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); | ||
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); | ||
var a = i ? i.completion : {}; | ||
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); | ||
}, | ||
complete: function (record, afterLoc) { | ||
if ("throw" === record.type) throw record.arg; | ||
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; | ||
complete: function (t, e) { | ||
if ("throw" === t.type) throw t.arg; | ||
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; | ||
}, | ||
finish: function (finallyLoc) { | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i]; | ||
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; | ||
finish: function (t) { | ||
for (var e = this.tryEntries.length - 1; e >= 0; --e) { | ||
var r = this.tryEntries[e]; | ||
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; | ||
} | ||
}, | ||
catch: function (tryLoc) { | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i]; | ||
if (entry.tryLoc === tryLoc) { | ||
var record = entry.completion; | ||
if ("throw" === record.type) { | ||
var thrown = record.arg; | ||
resetTryEntry(entry); | ||
catch: function (t) { | ||
for (var e = this.tryEntries.length - 1; e >= 0; --e) { | ||
var r = this.tryEntries[e]; | ||
if (r.tryLoc === t) { | ||
var n = r.completion; | ||
if ("throw" === n.type) { | ||
var o = n.arg; | ||
resetTryEntry(r); | ||
} | ||
return thrown; | ||
return o; | ||
} | ||
@@ -298,10 +303,10 @@ } | ||
}, | ||
delegateYield: function (iterable, resultName, nextLoc) { | ||
delegateYield: function (e, r, n) { | ||
return this.delegate = { | ||
iterator: values(iterable), | ||
resultName: resultName, | ||
nextLoc: nextLoc | ||
}, "next" === this.method && (this.arg = undefined), ContinueSentinel; | ||
iterator: values(e), | ||
resultName: r, | ||
nextLoc: n | ||
}, "next" === this.method && (this.arg = t), y; | ||
} | ||
}, exports; | ||
}, e; | ||
} | ||
@@ -308,0 +313,0 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r,e=(r=require("pino"))&&"object"==typeof r&&"default"in r?r.default:r;function t(){t=function(){return r};var r={},e=Object.prototype,n=e.hasOwnProperty,o=Object.defineProperty||function(r,e,t){r[e]=t.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(r,e,t){return Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}),r[e]}try{s({},"")}catch(r){s=function(r,e,t){return r[e]=t}}function l(r,e,t,n){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),a=new N(n||[]);return o(i,"_invoke",{value:P(r,t,a)}),i}function v(r,e,t){try{return{type:"normal",arg:r.call(e,t)}}catch(r){return{type:"throw",arg:r}}}r.wrap=l;var f={};function h(){}function d(){}function p(){}var g={};s(g,a,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(I([])));m&&m!==e&&n.call(m,a)&&(g=m);var w=p.prototype=h.prototype=Object.create(g);function b(r){["next","throw","return"].forEach((function(e){s(r,e,(function(r){return this._invoke(e,r)}))}))}function x(r,e){var t;o(this,"_invoke",{value:function(o,i){function a(){return new e((function(t,a){!function t(o,i,a,u){var c=v(r[o],r,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(r){t("next",r,a,u)}),(function(r){t("throw",r,a,u)})):e.resolve(l).then((function(r){s.value=r,a(s)}),(function(r){return t("throw",r,a,u)}))}u(c.arg)}(o,i,t,a)}))}return t=t?t.then(a,a):a()}})}function P(r,e,t){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(t.method=o,t.arg=i;;){var a=t.delegate;if(a){var u=L(a,t);if(u){if(u===f)continue;return u}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if("suspendedStart"===n)throw n="completed",t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);n="executing";var c=v(r,e,t);if("normal"===c.type){if(n=t.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:t.done}}"throw"===c.type&&(n="completed",t.method="throw",t.arg=c.arg)}}}function L(r,e){var t=e.method,n=r.iterator[t];if(void 0===n)return e.delegate=null,"throw"===t&&r.iterator.return&&(e.method="return",e.arg=void 0,L(r,e),"throw"===e.method)||"return"!==t&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+t+"' method")),f;var o=v(n,r.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[r.resultName]=i.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(r){var e={tryLoc:r[0]};1 in r&&(e.catchLoc=r[1]),2 in r&&(e.finallyLoc=r[2],e.afterLoc=r[3]),this.tryEntries.push(e)}function E(r){var e=r.completion||{};e.type="normal",delete e.arg,r.completion=e}function N(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(k,this),this.reset(!0)}function I(r){if(r||""===r){var e=r[a];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var t=-1,o=function e(){for(;++t<r.length;)if(n.call(r,t))return e.value=r[t],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}throw new TypeError(typeof r+" is not iterable")}return d.prototype=p,o(w,"constructor",{value:p,configurable:!0}),o(p,"constructor",{value:d,configurable:!0}),d.displayName=s(p,c,"GeneratorFunction"),r.isGeneratorFunction=function(r){var e="function"==typeof r&&r.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,p):(r.__proto__=p,s(r,c,"GeneratorFunction")),r.prototype=Object.create(w),r},r.awrap=function(r){return{__await:r}},b(x.prototype),s(x.prototype,u,(function(){return this})),r.AsyncIterator=x,r.async=function(e,t,n,o,i){void 0===i&&(i=Promise);var a=new x(l(e,t,n,o),i);return r.isGeneratorFunction(t)?a:a.next().then((function(r){return r.done?r.value:a.next()}))},b(w),s(w,c,"Generator"),s(w,a,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),r.keys=function(r){var e=Object(r),t=[];for(var n in e)t.push(n);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},r.values=I,N.prototype={constructor:N,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!r)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var r=this.tryEntries[0].completion;if("throw"===r.type)throw r.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function t(t,n){return a.type="throw",a.arg=r,e.next=t,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(r,e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===r||"continue"===r)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=r,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(r,e){if("throw"===r.type)throw r.arg;return"break"===r.type||"continue"===r.type?this.next=r.arg:"return"===r.type?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):"normal"===r.type&&e&&(this.next=e),f},finish:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.finallyLoc===r)return this.complete(t.completion,t.afterLoc),E(t),f}},catch:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.tryLoc===r){var n=t.completion;if("throw"===n.type){var o=n.arg;E(t)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(r,e,t){return this.delegate={iterator:I(r),resultName:e,nextLoc:t},"next"===this.method&&(this.arg=void 0),f}},r}function n(r,e,t,n,o,i,a){try{var u=r[i](a),c=u.value}catch(r){return void t(r)}u.done?e(c):Promise.resolve(c).then(n,o)}function o(r){return function(){var e=this,t=arguments;return new Promise((function(o,i){var a=r.apply(e,t);function u(r){n(a,o,i,u,c,"next",r)}function c(r){n(a,o,i,u,c,"throw",r)}u(void 0)}))}}exports.Savim=function(){function r(r){var t=this;this.log=r,this.providers={},this.getInvolvedProvider=function(r){var e=Object.keys(t.providers),n=void 0;return r&&t.providers[r]?n=t.providers[r]:(null==e?void 0:e.length)>0&&(n=t.providers[e[0]]),n},this.logger=e({level:r||"info"})}var n=r.prototype;return n.addProvider=function(){var r=o(t().mark((function r(e,n,o){var i;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=new e(n),r.next=3,i.isHealthy();case 3:if(r.sent){r.next=6;break}throw this.logger.error("[SAVIM] Provider "+i.name+" is not healthy !"),"Provider is not healthy !";case 6:if(!this.providers[o||i.name]){r.next=9;break}throw this.logger.error("[SAVIM] Provider "+(o||i.name)+" is not healthy !"),"Provider already exist !";case 9:this.providers[o||i.name]=i;case 10:case"end":return r.stop()}}),r,this)})));return function(e,t,n){return r.apply(this,arguments)}}(),n.removeProvider=function(){var r=o(t().mark((function r(e){return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:this.providers[e]&&delete this.providers[e];case 1:case"end":return r.stop()}}),r,this)})));return function(e){return r.apply(this,arguments)}}(),n.uploadFile=function(){var r=o(t().mark((function r(e,n,o,i){var a;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===o&&(o={}),a=this.getInvolvedProvider(i),this.logger.debug("[SAVIM] Upload file "+(a?"(Provider: "+a.name+")":"(No provider)")+" "+(a?"(Provider: "+a.name+")":"(No provider)")+" "+e),this.logger.debug(o),!a){r.next=6;break}return r.abrupt("return",a.uploadFile(e,n,o));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(e,t,n,o){return r.apply(this,arguments)}}(),n.getFile=function(){var r=o(t().mark((function r(e,n,o){var i;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Get file "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+e),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.getFile(e,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(e,t,n){return r.apply(this,arguments)}}(),n.deleteFile=function(){var r=o(t().mark((function r(e,n,o){var i;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Delete file "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.deleteFile(e,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(e,t,n){return r.apply(this,arguments)}}(),n.createFolder=function(){var r=o(t().mark((function r(e,n,o){var i;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Create folder "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+e),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.createFolder(e,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(e,t,n){return r.apply(this,arguments)}}(),n.deleteFolder=function(){var r=o(t().mark((function r(e,n,o){var i;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Delete folder "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.deleteFolder(e,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(e,t,n){return r.apply(this,arguments)}}(),n.getFolders=function(){var r=o(t().mark((function r(e,n,o){var i;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Get folders "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+e),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.getFolders(e,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(e,t,n){return r.apply(this,arguments)}}(),n.getFiles=function(){var r=o(t().mark((function r(e,n,o){var i;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Get files "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+e),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.getFiles(e,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(e,t,n){return r.apply(this,arguments)}}(),r}(),exports.SavimProviderInterface=function(r){}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r,e=(r=require("pino"))&&"object"==typeof r&&"default"in r?r.default:r;function t(){t=function(){return e};var r,e={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(r,e,t){r[e]=t.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(r,e,t){return Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}),r[e]}try{l({},"")}catch(r){l=function(r,e,t){return r[e]=t}}function f(r,e,t,n){var o=Object.create((e&&e.prototype instanceof y?e:y).prototype),a=new _(n||[]);return i(o,"_invoke",{value:N(r,t,a)}),o}function h(r,e,t){try{return{type:"normal",arg:r.call(e,t)}}catch(r){return{type:"throw",arg:r}}}e.wrap=f;var v="suspendedStart",d="executing",p="completed",g={};function y(){}function m(){}function w(){}var b={};l(b,u,(function(){return this}));var x=Object.getPrototypeOf,P=x&&x(x(j([])));P&&P!==n&&o.call(P,u)&&(b=P);var L=w.prototype=y.prototype=Object.create(b);function k(r){["next","throw","return"].forEach((function(e){l(r,e,(function(r){return this._invoke(e,r)}))}))}function E(r,e){function t(n,i,a,u){var c=h(r[n],r,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&o.call(l,"__await")?e.resolve(l.__await).then((function(r){t("next",r,a,u)}),(function(r){t("throw",r,a,u)})):e.resolve(l).then((function(r){s.value=r,a(s)}),(function(r){return t("throw",r,a,u)}))}u(c.arg)}var n;i(this,"_invoke",{value:function(r,o){function i(){return new e((function(e,n){t(r,o,e,n)}))}return n=n?n.then(i,i):i()}})}function N(e,t,n){var o=v;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===p){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=I(u,n);if(c){if(c===g)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=h(e,t,n);if("normal"===s.type){if(o=n.done?p:"suspendedYield",s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=p,n.method="throw",n.arg=s.arg)}}}function I(e,t){var n=t.method,o=e.iterator[n];if(o===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,I(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,g;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,g):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function F(r){var e={tryLoc:r[0]};1 in r&&(e.catchLoc=r[1]),2 in r&&(e.finallyLoc=r[2],e.afterLoc=r[3]),this.tryEntries.push(e)}function S(r){var e=r.completion||{};e.type="normal",delete e.arg,r.completion=e}function _(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(F,this),this.reset(!0)}function j(e){if(e||""===e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=r,t.done=!0,t};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return m.prototype=w,i(L,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:m,configurable:!0}),m.displayName=l(w,s,"GeneratorFunction"),e.isGeneratorFunction=function(r){var e="function"==typeof r&&r.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,w):(r.__proto__=w,l(r,s,"GeneratorFunction")),r.prototype=Object.create(L),r},e.awrap=function(r){return{__await:r}},k(E.prototype),l(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(r,t,n,o,i){void 0===i&&(i=Promise);var a=new E(f(r,t,n,o),i);return e.isGeneratorFunction(t)?a:a.next().then((function(r){return r.done?r.value:a.next()}))},k(L),l(L,s,"Generator"),l(L,u,(function(){return this})),l(L,"toString",(function(){return"[object Generator]"})),e.keys=function(r){var e=Object(r),t=[];for(var n in e)t.push(n);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=j,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var r=this.tryEntries[0].completion;if("throw"===r.type)throw r.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return u.type="throw",u.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(r,e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===r||"continue"===r)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=r,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(r,e){if("throw"===r.type)throw r.arg;return"break"===r.type||"continue"===r.type?this.next=r.arg:"return"===r.type?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):"normal"===r.type&&e&&(this.next=e),g},finish:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.finallyLoc===r)return this.complete(t.completion,t.afterLoc),S(t),g}},catch:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.tryLoc===r){var n=t.completion;if("throw"===n.type){var o=n.arg;S(t)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:j(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),g}},e}function n(r,e,t,n,o,i,a){try{var u=r[i](a),c=u.value}catch(r){return void t(r)}u.done?e(c):Promise.resolve(c).then(n,o)}function o(r){return function(){var e=this,t=arguments;return new Promise((function(o,i){var a=r.apply(e,t);function u(r){n(a,o,i,u,c,"next",r)}function c(r){n(a,o,i,u,c,"throw",r)}u(void 0)}))}}exports.Savim=function(){function r(r){var t=this;this.log=r,this.providers={},this.getInvolvedProvider=function(r){var e=Object.keys(t.providers),n=void 0;return r&&t.providers[r]?n=t.providers[r]:(null==e?void 0:e.length)>0&&(n=t.providers[e[0]]),n},this.logger=e({level:r||"info"})}var n=r.prototype;return n.addProvider=function(){var r=o(t().mark((function r(e,n,o){var i;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=new e(n),r.next=3,i.isHealthy();case 3:if(r.sent){r.next=6;break}throw this.logger.error("[SAVIM] Provider "+i.name+" is not healthy !"),"Provider is not healthy !";case 6:if(!this.providers[o||i.name]){r.next=9;break}throw this.logger.error("[SAVIM] Provider "+(o||i.name)+" is not healthy !"),"Provider already exist !";case 9:this.providers[o||i.name]=i;case 10:case"end":return r.stop()}}),r,this)})));return function(e,t,n){return r.apply(this,arguments)}}(),n.removeProvider=function(){var r=o(t().mark((function r(e){return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:this.providers[e]&&delete this.providers[e];case 1:case"end":return r.stop()}}),r,this)})));return function(e){return r.apply(this,arguments)}}(),n.uploadFile=function(){var r=o(t().mark((function r(e,n,o,i){var a;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===o&&(o={}),a=this.getInvolvedProvider(i),this.logger.debug("[SAVIM] Upload file "+(a?"(Provider: "+a.name+")":"(No provider)")+" "+(a?"(Provider: "+a.name+")":"(No provider)")+" "+e),this.logger.debug(o),!a){r.next=6;break}return r.abrupt("return",a.uploadFile(e,n,o));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(e,t,n,o){return r.apply(this,arguments)}}(),n.getFile=function(){var r=o(t().mark((function r(e,n,o){var i;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Get file "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+e),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.getFile(e,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(e,t,n){return r.apply(this,arguments)}}(),n.deleteFile=function(){var r=o(t().mark((function r(e,n,o){var i;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Delete file "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.deleteFile(e,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(e,t,n){return r.apply(this,arguments)}}(),n.createFolder=function(){var r=o(t().mark((function r(e,n,o){var i;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Create folder "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+e),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.createFolder(e,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(e,t,n){return r.apply(this,arguments)}}(),n.deleteFolder=function(){var r=o(t().mark((function r(e,n,o){var i;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Delete folder "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.deleteFolder(e,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(e,t,n){return r.apply(this,arguments)}}(),n.getFolders=function(){var r=o(t().mark((function r(e,n,o){var i;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Get folders "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+e),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.getFolders(e,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(e,t,n){return r.apply(this,arguments)}}(),n.getFiles=function(){var r=o(t().mark((function r(e,n,o){var i;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===n&&(n={}),i=this.getInvolvedProvider(o),this.logger.debug("[SAVIM] Get files "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+(i?"(Provider: "+i.name+")":"(No provider)")+" "+e),this.logger.debug(n),!i){r.next=6;break}return r.abrupt("return",i.getFiles(e,n));case 6:return r.abrupt("return",void 0);case 7:case"end":return r.stop()}}),r,this)})));return function(e,t,n){return r.apply(this,arguments)}}(),r}(),exports.SavimProviderInterface=function(r){}; | ||
//# sourceMappingURL=savim.cjs.production.min.js.map |
@@ -5,247 +5,252 @@ import Pino from 'pino'; | ||
_regeneratorRuntime = function () { | ||
return exports; | ||
return e; | ||
}; | ||
var exports = {}, | ||
Op = Object.prototype, | ||
hasOwn = Op.hasOwnProperty, | ||
defineProperty = Object.defineProperty || function (obj, key, desc) { | ||
obj[key] = desc.value; | ||
var t, | ||
e = {}, | ||
r = Object.prototype, | ||
n = r.hasOwnProperty, | ||
o = Object.defineProperty || function (t, e, r) { | ||
t[e] = r.value; | ||
}, | ||
$Symbol = "function" == typeof Symbol ? Symbol : {}, | ||
iteratorSymbol = $Symbol.iterator || "@@iterator", | ||
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", | ||
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; | ||
function define(obj, key, value) { | ||
return Object.defineProperty(obj, key, { | ||
value: value, | ||
i = "function" == typeof Symbol ? Symbol : {}, | ||
a = i.iterator || "@@iterator", | ||
c = i.asyncIterator || "@@asyncIterator", | ||
u = i.toStringTag || "@@toStringTag"; | ||
function define(t, e, r) { | ||
return Object.defineProperty(t, e, { | ||
value: r, | ||
enumerable: !0, | ||
configurable: !0, | ||
writable: !0 | ||
}), obj[key]; | ||
}), t[e]; | ||
} | ||
try { | ||
define({}, ""); | ||
} catch (err) { | ||
define = function (obj, key, value) { | ||
return obj[key] = value; | ||
} catch (t) { | ||
define = function (t, e, r) { | ||
return t[e] = r; | ||
}; | ||
} | ||
function wrap(innerFn, outerFn, self, tryLocsList) { | ||
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, | ||
generator = Object.create(protoGenerator.prototype), | ||
context = new Context(tryLocsList || []); | ||
return defineProperty(generator, "_invoke", { | ||
value: makeInvokeMethod(innerFn, self, context) | ||
}), generator; | ||
function wrap(t, e, r, n) { | ||
var i = e && e.prototype instanceof Generator ? e : Generator, | ||
a = Object.create(i.prototype), | ||
c = new Context(n || []); | ||
return o(a, "_invoke", { | ||
value: makeInvokeMethod(t, r, c) | ||
}), a; | ||
} | ||
function tryCatch(fn, obj, arg) { | ||
function tryCatch(t, e, r) { | ||
try { | ||
return { | ||
type: "normal", | ||
arg: fn.call(obj, arg) | ||
arg: t.call(e, r) | ||
}; | ||
} catch (err) { | ||
} catch (t) { | ||
return { | ||
type: "throw", | ||
arg: err | ||
arg: t | ||
}; | ||
} | ||
} | ||
exports.wrap = wrap; | ||
var ContinueSentinel = {}; | ||
e.wrap = wrap; | ||
var h = "suspendedStart", | ||
l = "suspendedYield", | ||
f = "executing", | ||
s = "completed", | ||
y = {}; | ||
function Generator() {} | ||
function GeneratorFunction() {} | ||
function GeneratorFunctionPrototype() {} | ||
var IteratorPrototype = {}; | ||
define(IteratorPrototype, iteratorSymbol, function () { | ||
var p = {}; | ||
define(p, a, function () { | ||
return this; | ||
}); | ||
var getProto = Object.getPrototypeOf, | ||
NativeIteratorPrototype = getProto && getProto(getProto(values([]))); | ||
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); | ||
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); | ||
function defineIteratorMethods(prototype) { | ||
["next", "throw", "return"].forEach(function (method) { | ||
define(prototype, method, function (arg) { | ||
return this._invoke(method, arg); | ||
var d = Object.getPrototypeOf, | ||
v = d && d(d(values([]))); | ||
v && v !== r && n.call(v, a) && (p = v); | ||
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); | ||
function defineIteratorMethods(t) { | ||
["next", "throw", "return"].forEach(function (e) { | ||
define(t, e, function (t) { | ||
return this._invoke(e, t); | ||
}); | ||
}); | ||
} | ||
function AsyncIterator(generator, PromiseImpl) { | ||
function invoke(method, arg, resolve, reject) { | ||
var record = tryCatch(generator[method], generator, arg); | ||
if ("throw" !== record.type) { | ||
var result = record.arg, | ||
value = result.value; | ||
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { | ||
invoke("next", value, resolve, reject); | ||
}, function (err) { | ||
invoke("throw", err, resolve, reject); | ||
}) : PromiseImpl.resolve(value).then(function (unwrapped) { | ||
result.value = unwrapped, resolve(result); | ||
}, function (error) { | ||
return invoke("throw", error, resolve, reject); | ||
function AsyncIterator(t, e) { | ||
function invoke(r, o, i, a) { | ||
var c = tryCatch(t[r], t, o); | ||
if ("throw" !== c.type) { | ||
var u = c.arg, | ||
h = u.value; | ||
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { | ||
invoke("next", t, i, a); | ||
}, function (t) { | ||
invoke("throw", t, i, a); | ||
}) : e.resolve(h).then(function (t) { | ||
u.value = t, i(u); | ||
}, function (t) { | ||
return invoke("throw", t, i, a); | ||
}); | ||
} | ||
reject(record.arg); | ||
a(c.arg); | ||
} | ||
var previousPromise; | ||
defineProperty(this, "_invoke", { | ||
value: function (method, arg) { | ||
var r; | ||
o(this, "_invoke", { | ||
value: function (t, n) { | ||
function callInvokeWithMethodAndArg() { | ||
return new PromiseImpl(function (resolve, reject) { | ||
invoke(method, arg, resolve, reject); | ||
return new e(function (e, r) { | ||
invoke(t, n, e, r); | ||
}); | ||
} | ||
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); | ||
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); | ||
} | ||
}); | ||
} | ||
function makeInvokeMethod(innerFn, self, context) { | ||
var state = "suspendedStart"; | ||
return function (method, arg) { | ||
if ("executing" === state) throw new Error("Generator is already running"); | ||
if ("completed" === state) { | ||
if ("throw" === method) throw arg; | ||
function makeInvokeMethod(e, r, n) { | ||
var o = h; | ||
return function (i, a) { | ||
if (o === f) throw new Error("Generator is already running"); | ||
if (o === s) { | ||
if ("throw" === i) throw a; | ||
return { | ||
value: void 0, | ||
value: t, | ||
done: !0 | ||
}; | ||
} | ||
for (context.method = method, context.arg = arg;;) { | ||
var delegate = context.delegate; | ||
if (delegate) { | ||
var delegateResult = maybeInvokeDelegate(delegate, context); | ||
if (delegateResult) { | ||
if (delegateResult === ContinueSentinel) continue; | ||
return delegateResult; | ||
for (n.method = i, n.arg = a;;) { | ||
var c = n.delegate; | ||
if (c) { | ||
var u = maybeInvokeDelegate(c, n); | ||
if (u) { | ||
if (u === y) continue; | ||
return u; | ||
} | ||
} | ||
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { | ||
if ("suspendedStart" === state) throw state = "completed", context.arg; | ||
context.dispatchException(context.arg); | ||
} else "return" === context.method && context.abrupt("return", context.arg); | ||
state = "executing"; | ||
var record = tryCatch(innerFn, self, context); | ||
if ("normal" === record.type) { | ||
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; | ||
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { | ||
if (o === h) throw o = s, n.arg; | ||
n.dispatchException(n.arg); | ||
} else "return" === n.method && n.abrupt("return", n.arg); | ||
o = f; | ||
var p = tryCatch(e, r, n); | ||
if ("normal" === p.type) { | ||
if (o = n.done ? s : l, p.arg === y) continue; | ||
return { | ||
value: record.arg, | ||
done: context.done | ||
value: p.arg, | ||
done: n.done | ||
}; | ||
} | ||
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); | ||
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); | ||
} | ||
}; | ||
} | ||
function maybeInvokeDelegate(delegate, context) { | ||
var methodName = context.method, | ||
method = delegate.iterator[methodName]; | ||
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; | ||
var record = tryCatch(method, delegate.iterator, context.arg); | ||
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; | ||
var info = record.arg; | ||
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); | ||
function maybeInvokeDelegate(e, r) { | ||
var n = r.method, | ||
o = e.iterator[n]; | ||
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; | ||
var i = tryCatch(o, e.iterator, r.arg); | ||
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; | ||
var a = i.arg; | ||
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); | ||
} | ||
function pushTryEntry(locs) { | ||
var entry = { | ||
tryLoc: locs[0] | ||
function pushTryEntry(t) { | ||
var e = { | ||
tryLoc: t[0] | ||
}; | ||
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); | ||
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); | ||
} | ||
function resetTryEntry(entry) { | ||
var record = entry.completion || {}; | ||
record.type = "normal", delete record.arg, entry.completion = record; | ||
function resetTryEntry(t) { | ||
var e = t.completion || {}; | ||
e.type = "normal", delete e.arg, t.completion = e; | ||
} | ||
function Context(tryLocsList) { | ||
function Context(t) { | ||
this.tryEntries = [{ | ||
tryLoc: "root" | ||
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); | ||
}], t.forEach(pushTryEntry, this), this.reset(!0); | ||
} | ||
function values(iterable) { | ||
if (iterable || "" === iterable) { | ||
var iteratorMethod = iterable[iteratorSymbol]; | ||
if (iteratorMethod) return iteratorMethod.call(iterable); | ||
if ("function" == typeof iterable.next) return iterable; | ||
if (!isNaN(iterable.length)) { | ||
var i = -1, | ||
next = function next() { | ||
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; | ||
return next.value = undefined, next.done = !0, next; | ||
function values(e) { | ||
if (e || "" === e) { | ||
var r = e[a]; | ||
if (r) return r.call(e); | ||
if ("function" == typeof e.next) return e; | ||
if (!isNaN(e.length)) { | ||
var o = -1, | ||
i = function next() { | ||
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; | ||
return next.value = t, next.done = !0, next; | ||
}; | ||
return next.next = next; | ||
return i.next = i; | ||
} | ||
} | ||
throw new TypeError(typeof iterable + " is not iterable"); | ||
throw new TypeError(typeof e + " is not iterable"); | ||
} | ||
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { | ||
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { | ||
value: GeneratorFunctionPrototype, | ||
configurable: !0 | ||
}), defineProperty(GeneratorFunctionPrototype, "constructor", { | ||
}), o(GeneratorFunctionPrototype, "constructor", { | ||
value: GeneratorFunction, | ||
configurable: !0 | ||
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { | ||
var ctor = "function" == typeof genFun && genFun.constructor; | ||
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); | ||
}, exports.mark = function (genFun) { | ||
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; | ||
}, exports.awrap = function (arg) { | ||
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { | ||
var e = "function" == typeof t && t.constructor; | ||
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); | ||
}, e.mark = function (t) { | ||
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; | ||
}, e.awrap = function (t) { | ||
return { | ||
__await: arg | ||
__await: t | ||
}; | ||
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { | ||
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { | ||
return this; | ||
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { | ||
void 0 === PromiseImpl && (PromiseImpl = Promise); | ||
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); | ||
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { | ||
return result.done ? result.value : iter.next(); | ||
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { | ||
void 0 === i && (i = Promise); | ||
var a = new AsyncIterator(wrap(t, r, n, o), i); | ||
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { | ||
return t.done ? t.value : a.next(); | ||
}); | ||
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { | ||
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { | ||
return this; | ||
}), define(Gp, "toString", function () { | ||
}), define(g, "toString", function () { | ||
return "[object Generator]"; | ||
}), exports.keys = function (val) { | ||
var object = Object(val), | ||
keys = []; | ||
for (var key in object) keys.push(key); | ||
return keys.reverse(), function next() { | ||
for (; keys.length;) { | ||
var key = keys.pop(); | ||
if (key in object) return next.value = key, next.done = !1, next; | ||
}), e.keys = function (t) { | ||
var e = Object(t), | ||
r = []; | ||
for (var n in e) r.push(n); | ||
return r.reverse(), function next() { | ||
for (; r.length;) { | ||
var t = r.pop(); | ||
if (t in e) return next.value = t, next.done = !1, next; | ||
} | ||
return next.done = !0, next; | ||
}; | ||
}, exports.values = values, Context.prototype = { | ||
}, e.values = values, Context.prototype = { | ||
constructor: Context, | ||
reset: function (skipTempReset) { | ||
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); | ||
reset: function (e) { | ||
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); | ||
}, | ||
stop: function () { | ||
this.done = !0; | ||
var rootRecord = this.tryEntries[0].completion; | ||
if ("throw" === rootRecord.type) throw rootRecord.arg; | ||
var t = this.tryEntries[0].completion; | ||
if ("throw" === t.type) throw t.arg; | ||
return this.rval; | ||
}, | ||
dispatchException: function (exception) { | ||
if (this.done) throw exception; | ||
var context = this; | ||
function handle(loc, caught) { | ||
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; | ||
dispatchException: function (e) { | ||
if (this.done) throw e; | ||
var r = this; | ||
function handle(n, o) { | ||
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; | ||
} | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i], | ||
record = entry.completion; | ||
if ("root" === entry.tryLoc) return handle("end"); | ||
if (entry.tryLoc <= this.prev) { | ||
var hasCatch = hasOwn.call(entry, "catchLoc"), | ||
hasFinally = hasOwn.call(entry, "finallyLoc"); | ||
if (hasCatch && hasFinally) { | ||
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); | ||
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); | ||
} else if (hasCatch) { | ||
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); | ||
for (var o = this.tryEntries.length - 1; o >= 0; --o) { | ||
var i = this.tryEntries[o], | ||
a = i.completion; | ||
if ("root" === i.tryLoc) return handle("end"); | ||
if (i.tryLoc <= this.prev) { | ||
var c = n.call(i, "catchLoc"), | ||
u = n.call(i, "finallyLoc"); | ||
if (c && u) { | ||
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); | ||
if (this.prev < i.finallyLoc) return handle(i.finallyLoc); | ||
} else if (c) { | ||
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); | ||
} else { | ||
if (!hasFinally) throw new Error("try statement without catch or finally"); | ||
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); | ||
if (!u) throw new Error("try statement without catch or finally"); | ||
if (this.prev < i.finallyLoc) return handle(i.finallyLoc); | ||
} | ||
@@ -255,34 +260,34 @@ } | ||
}, | ||
abrupt: function (type, arg) { | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i]; | ||
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { | ||
var finallyEntry = entry; | ||
abrupt: function (t, e) { | ||
for (var r = this.tryEntries.length - 1; r >= 0; --r) { | ||
var o = this.tryEntries[r]; | ||
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { | ||
var i = o; | ||
break; | ||
} | ||
} | ||
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); | ||
var record = finallyEntry ? finallyEntry.completion : {}; | ||
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); | ||
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); | ||
var a = i ? i.completion : {}; | ||
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); | ||
}, | ||
complete: function (record, afterLoc) { | ||
if ("throw" === record.type) throw record.arg; | ||
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; | ||
complete: function (t, e) { | ||
if ("throw" === t.type) throw t.arg; | ||
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; | ||
}, | ||
finish: function (finallyLoc) { | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i]; | ||
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; | ||
finish: function (t) { | ||
for (var e = this.tryEntries.length - 1; e >= 0; --e) { | ||
var r = this.tryEntries[e]; | ||
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; | ||
} | ||
}, | ||
catch: function (tryLoc) { | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i]; | ||
if (entry.tryLoc === tryLoc) { | ||
var record = entry.completion; | ||
if ("throw" === record.type) { | ||
var thrown = record.arg; | ||
resetTryEntry(entry); | ||
catch: function (t) { | ||
for (var e = this.tryEntries.length - 1; e >= 0; --e) { | ||
var r = this.tryEntries[e]; | ||
if (r.tryLoc === t) { | ||
var n = r.completion; | ||
if ("throw" === n.type) { | ||
var o = n.arg; | ||
resetTryEntry(r); | ||
} | ||
return thrown; | ||
return o; | ||
} | ||
@@ -292,10 +297,10 @@ } | ||
}, | ||
delegateYield: function (iterable, resultName, nextLoc) { | ||
delegateYield: function (e, r, n) { | ||
return this.delegate = { | ||
iterator: values(iterable), | ||
resultName: resultName, | ||
nextLoc: nextLoc | ||
}, "next" === this.method && (this.arg = undefined), ContinueSentinel; | ||
iterator: values(e), | ||
resultName: r, | ||
nextLoc: n | ||
}, "next" === this.method && (this.arg = t), y; | ||
} | ||
}, exports; | ||
}, e; | ||
} | ||
@@ -302,0 +307,0 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { |
{ | ||
"version": "1.2.58", | ||
"version": "1.2.59", | ||
"license": "MIT", | ||
@@ -64,3 +64,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@jest/globals": "29.6.3", | ||
"@jest/globals": "29.6.4", | ||
"@size-limit/preset-small-lib": "8.2.6", | ||
@@ -67,0 +67,0 @@ "@types/jest": "^29.5.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1511
118870