@difizen/libro-common 0.0.2-alpha.0 → 0.1.0

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/es/iter.js CHANGED
@@ -1,4 +1,4 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
3
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
4
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -1,24 +1,22 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  var _Symbol$asyncIterator;
3
3
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
4
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.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, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } 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 tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, 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); }); }); } 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); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.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; return doneResult(); } 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; } } 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; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.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 pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (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; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(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) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, 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(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "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; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(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); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(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; } 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); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(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; 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); }, complete: function complete(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; }, finish: function finish(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; } }, catch: function _catch(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); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
6
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.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 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } 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(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); 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(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); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } 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: t, done: !0 }; } 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" === 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: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } 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(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } 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 i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), 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: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), 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(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), 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; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(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 stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(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 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 (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(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; } } 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 complete(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 finish(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 _catch(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 o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
6
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
8
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
9
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
10
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
11
11
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
12
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
13
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
- function _awaitAsyncGenerator(value) { return new _OverloadYield(value, 0); }
14
+ function _awaitAsyncGenerator(e) { return new _OverloadYield(e, 0); }
15
15
  function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; }
16
- function _AsyncGenerator(gen) { var front, back; function resume(key, arg) { try { var result = gen[key](arg), value = result.value, overloaded = value instanceof _OverloadYield; Promise.resolve(overloaded ? value.v : value).then(function (arg) { if (overloaded) { var nextKey = "return" === key ? "return" : "next"; if (!value.k || arg.done) return resume(nextKey, arg); arg = gen[nextKey](arg).value; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: !0 }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: !1 }); } (front = front.next) ? resume(front.key, front.arg) : back = null; } this._invoke = function (key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; back ? back = back.next = request : (front = back = request, resume(key, arg)); }); }, "function" != typeof gen.return && (this.return = void 0); }
17
- _AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { return this; }, _AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); }, _AsyncGenerator.prototype.throw = function (arg) { return this._invoke("throw", arg); }, _AsyncGenerator.prototype.return = function (arg) { return this._invoke("return", arg); };
18
- function _OverloadYield(value, kind) { this.v = value, this.k = kind; }
19
- /* eslint-disable @typescript-eslint/no-use-before-define */
20
- /* eslint-disable no-param-reassign */
21
- /* eslint-disable @typescript-eslint/no-namespace */
16
+ function _AsyncGenerator(e) { var r, t; function resume(r, t) { try { var n = e[r](t), o = n.value, u = o instanceof _OverloadYield; Promise.resolve(u ? o.v : o).then(function (t) { if (u) { var i = "return" === r ? "return" : "next"; if (!o.k || t.done) return resume(i, t); t = e[i](t).value; } settle(n.done ? "return" : "normal", t); }, function (e) { resume("throw", e); }); } catch (e) { settle("throw", e); } } function settle(e, n) { switch (e) { case "return": r.resolve({ value: n, done: !0 }); break; case "throw": r.reject(n); break; default: r.resolve({ value: n, done: !1 }); } (r = r.next) ? resume(r.key, r.arg) : t = null; } this._invoke = function (e, n) { return new Promise(function (o, u) { var i = { key: e, arg: n, resolve: o, reject: u, next: null }; t ? t = t.next = i : (r = t = i, resume(e, n)); }); }, "function" != typeof e.return && (this.return = void 0); }
17
+ _AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { return this; }, _AsyncGenerator.prototype.next = function (e) { return this._invoke("next", e); }, _AsyncGenerator.prototype.throw = function (e) { return this._invoke("throw", e); }, _AsyncGenerator.prototype.return = function (e) { return this._invoke("return", e); };
18
+ function _OverloadYield(t, e) { this.v = t, this.k = e; }
19
+ /* eslint-disable @typescript-eslint/no-explicit-any */
22
20
 
23
21
  import { Emitter, Deferred } from '@difizen/mana-common';
24
22
  import { deepEqual } from "../json.js";
@@ -378,7 +376,16 @@ export var Poll = /*#__PURE__*/function () {
378
376
  value: function _execute() {
379
377
  var _this4 = this;
380
378
  var standby = typeof this.standby === 'function' ? this.standby() : this.standby;
381
- standby = standby === 'never' ? false : standby === 'when-hidden' ? !!(typeof document !== 'undefined' && document && document.hidden) : standby;
379
+ switch (standby) {
380
+ case 'never':
381
+ standby = false;
382
+ break;
383
+ case 'when-hidden':
384
+ standby = !!(typeof document !== 'undefined' && document && document.hidden);
385
+ break;
386
+ default:
387
+ break;
388
+ }
382
389
 
383
390
  // If in standby mode schedule next tick without calling the factory.
384
391
  if (standby) {
package/es/sanitizer.js CHANGED
@@ -1,8 +1,8 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  var _class, _templateObject, _templateObject2, _templateObject3, _templateObject4;
3
3
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
4
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
6
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
7
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
8
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
package/es/url.js CHANGED
@@ -1,4 +1,4 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
3
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
4
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-common",
3
- "version": "0.0.2-alpha.0",
3
+ "version": "0.1.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro",
@@ -32,7 +32,7 @@
32
32
  "src"
33
33
  ],
34
34
  "dependencies": {
35
- "@difizen/mana-common": "alpha",
35
+ "@difizen/mana-common": "latest",
36
36
  "path-browserify": "^1.0.0",
37
37
  "sanitize-html": "^2.7.2",
38
38
  "url-parse": "^1.5.10"
@@ -0,0 +1,12 @@
1
+ import assert from 'assert';
2
+
3
+ import { defaultSanitizer, concatMultilineString, Poll } from './index.js';
4
+ import 'reflect-metadata';
5
+
6
+ describe('libro-common', () => {
7
+ it('#import', () => {
8
+ assert(defaultSanitizer);
9
+ assert(concatMultilineString);
10
+ assert(Poll);
11
+ });
12
+ });
@@ -1,7 +1,4 @@
1
- /* eslint-disable @typescript-eslint/no-use-before-define */
2
- /* eslint-disable no-param-reassign */
3
- /* eslint-disable @typescript-eslint/no-namespace */
4
-
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
5
2
  import type { Event } from '@difizen/mana-common';
6
3
  import { Emitter, Deferred } from '@difizen/mana-common';
7
4
 
@@ -294,12 +291,16 @@ export class Poll<T = any, U = any, V extends string = 'standby'>
294
291
  */
295
292
  protected _execute(): void {
296
293
  let standby = typeof this.standby === 'function' ? this.standby() : this.standby;
297
- standby =
298
- standby === 'never'
299
- ? false
300
- : standby === 'when-hidden'
301
- ? !!(typeof document !== 'undefined' && document && document.hidden)
302
- : standby;
294
+ switch (standby) {
295
+ case 'never':
296
+ standby = false;
297
+ break;
298
+ case 'when-hidden':
299
+ standby = !!(typeof document !== 'undefined' && document && document.hidden);
300
+ break;
301
+ default:
302
+ break;
303
+ }
303
304
 
304
305
  // If in standby mode schedule next tick without calling the factory.
305
306
  if (standby) {
package/es/array.d.ts DELETED
@@ -1,368 +0,0 @@
1
- /**
2
- * Find the index of the first occurrence of a value in an array.
3
- *
4
- * @param array - The array-like object to search.
5
- *
6
- * @param value - The value to locate in the array. Values are
7
- * compared using strict `===` equality.
8
- *
9
- * @param start - The index of the first element in the range to be
10
- * searched, inclusive. The default value is `0`. Negative values
11
- * are taken as an offset from the end of the array.
12
- *
13
- * @param stop - The index of the last element in the range to be
14
- * searched, inclusive. The default value is `-1`. Negative values
15
- * are taken as an offset from the end of the array.
16
- *
17
- * @returns The index of the first occurrence of the value, or `-1`
18
- * if the value is not found.
19
- *
20
- * #### Notes
21
- * If `stop < start` the search will wrap at the end of the array.
22
- *
23
- * #### Complexity
24
- * Linear.
25
- *
26
- * #### Undefined Behavior
27
- * A `start` or `stop` which is non-integral.
28
- *
29
- * #### Example
30
- * ```typescript
31
- *
32
- * let data = ['one', 'two', 'three', 'four', 'one'];
33
- * firstIndexOfArray(data, 'red'); // -1
34
- * firstIndexOfArray(data, 'one'); // 0
35
- * firstIndexOfArray(data, 'one', 1); // 4
36
- * firstIndexOfArray(data, 'two', 2); // -1
37
- * firstIndexOfArray(data, 'two', 2, 1); // 1
38
- * ```
39
- */
40
- export declare function firstIndexOfArray<T>(array: ArrayLike<T>, value: T, start?: number, stop?: number): number;
41
- /**
42
- * Find the index of the first value which matches a predicate.
43
- *
44
- * @param array - The array-like object to search.
45
- *
46
- * @param fn - The predicate function to apply to the values.
47
- *
48
- * @param start - The index of the first element in the range to be
49
- * searched, inclusive. The default value is `0`. Negative values
50
- * are taken as an offset from the end of the array.
51
- *
52
- * @param stop - The index of the last element in the range to be
53
- * searched, inclusive. The default value is `-1`. Negative values
54
- * are taken as an offset from the end of the array.
55
- *
56
- * @returns The index of the first matching value, or `-1` if no
57
- * matching value is found.
58
- *
59
- * #### Notes
60
- * If `stop < start` the search will wrap at the end of the array.
61
- *
62
- * #### Complexity
63
- * Linear.
64
- *
65
- * #### Undefined Behavior
66
- * A `start` or `stop` which is non-integral.
67
- *
68
- * Modifying the length of the array while searching.
69
- *
70
- * #### Example
71
- * ```typescript
72
- *
73
- * function isEven(value: number): boolean {
74
- * return value % 2 === 0;
75
- * }
76
- *
77
- * let data = [1, 2, 3, 4, 3, 2, 1];
78
- * findFirstArrayIndex(data, isEven); // 1
79
- * findFirstArrayIndex(data, isEven, 4); // 5
80
- * findFirstArrayIndex(data, isEven, 6); // -1
81
- * findFirstArrayIndex(data, isEven, 6, 5); // 1
82
- * ```
83
- */
84
- export declare function findFirstArrayIndex<T>(array: ArrayLike<T>, fn: (value: T, index: number) => boolean, start?: number, stop?: number): number;
85
- /**
86
- * Find the index of the last value which matches a predicate.
87
- *
88
- * @param object - The array-like object to search.
89
- *
90
- * @param fn - The predicate function to apply to the values.
91
- *
92
- * @param start - The index of the first element in the range to be
93
- * searched, inclusive. The default value is `-1`. Negative values
94
- * are taken as an offset from the end of the array.
95
- *
96
- * @param stop - The index of the last element in the range to be
97
- * searched, inclusive. The default value is `0`. Negative values
98
- * are taken as an offset from the end of the array.
99
- *
100
- * @returns The index of the last matching value, or `-1` if no
101
- * matching value is found.
102
- *
103
- * #### Notes
104
- * If `start < stop` the search will wrap at the front of the array.
105
- *
106
- * #### Complexity
107
- * Linear.
108
- *
109
- * #### Undefined Behavior
110
- * A `start` or `stop` which is non-integral.
111
- *
112
- * Modifying the length of the array while searching.
113
- *
114
- * #### Example
115
- * ```typescript
116
- *
117
- * function isEven(value: number): boolean {
118
- * return value % 2 === 0;
119
- * }
120
- *
121
- * let data = [1, 2, 3, 4, 3, 2, 1];
122
- * findLastArrayIndex(data, isEven); // 5
123
- * findLastArrayIndex(data, isEven, 4); // 3
124
- * findLastArrayIndex(data, isEven, 0); // -1
125
- * findLastArrayIndex(data, isEven, 0, 1); // 5
126
- * ```
127
- */
128
- export declare function findLastArrayIndex<T>(array: ArrayLike<T>, fn: (value: T, index: number) => boolean, start?: number, stop?: number): number;
129
- /**
130
- * Find the first value which matches a predicate.
131
- *
132
- * @param array - The array-like object to search.
133
- *
134
- * @param fn - The predicate function to apply to the values.
135
- *
136
- * @param start - The index of the first element in the range to be
137
- * searched, inclusive. The default value is `0`. Negative values
138
- * are taken as an offset from the end of the array.
139
- *
140
- * @param stop - The index of the last element in the range to be
141
- * searched, inclusive. The default value is `-1`. Negative values
142
- * are taken as an offset from the end of the array.
143
- *
144
- * @returns The first matching value, or `undefined` if no matching
145
- * value is found.
146
- *
147
- * #### Notes
148
- * If `stop < start` the search will wrap at the end of the array.
149
- *
150
- * #### Complexity
151
- * Linear.
152
- *
153
- * #### Undefined Behavior
154
- * A `start` or `stop` which is non-integral.
155
- *
156
- * Modifying the length of the array while searching.
157
- *
158
- * #### Example
159
- * ```typescript
160
- *
161
- * function isEven(value: number): boolean {
162
- * return value % 2 === 0;
163
- * }
164
- *
165
- * let data = [1, 2, 3, 4, 3, 2, 1];
166
- * findFirstArrayValue(data, isEven); // 2
167
- * findFirstArrayValue(data, isEven, 2); // 4
168
- * findFirstArrayValue(data, isEven, 6); // undefined
169
- * findFirstArrayValue(data, isEven, 6, 5); // 2
170
- * ```
171
- */
172
- export declare function findFirstArrayValue<T>(array: ArrayLike<T>, fn: (value: T, index: number) => boolean, start?: number, stop?: number): T | undefined;
173
- /**
174
- * Find the last value which matches a predicate.
175
- *
176
- * @param object - The array-like object to search.
177
- *
178
- * @param fn - The predicate function to apply to the values.
179
- *
180
- * @param start - The index of the first element in the range to be
181
- * searched, inclusive. The default value is `-1`. Negative values
182
- * are taken as an offset from the end of the array.
183
- *
184
- * @param stop - The index of the last element in the range to be
185
- * searched, inclusive. The default value is `0`. Negative values
186
- * are taken as an offset from the end of the array.
187
- *
188
- * @returns The last matching value, or `undefined` if no matching
189
- * value is found.
190
- *
191
- * #### Notes
192
- * If `start < stop` the search will wrap at the front of the array.
193
- *
194
- * #### Complexity
195
- * Linear.
196
- *
197
- * #### Undefined Behavior
198
- * A `start` or `stop` which is non-integral.
199
- *
200
- * Modifying the length of the array while searching.
201
- *
202
- * #### Example
203
- * ```typescript
204
- *
205
- * function isEven(value: number): boolean {
206
- * return value % 2 === 0;
207
- * }
208
- *
209
- * let data = [1, 2, 3, 4, 3, 2, 1];
210
- * findLastArrayValue(data, isEven); // 2
211
- * findLastArrayValue(data, isEven, 4); // 4
212
- * findLastArrayValue(data, isEven, 0); // undefined
213
- * findLastArrayValue(data, isEven, 0, 1); // 2
214
- * ```
215
- */
216
- export declare function findLastArrayValue<T>(array: ArrayLike<T>, fn: (value: T, index: number) => boolean, start?: number, stop?: number): T | undefined;
217
- /**
218
- * Find the index of the first element which compares `>=` to a value.
219
- *
220
- * @param array - The sorted array-like object to search.
221
- *
222
- * @param value - The value to locate in the array.
223
- *
224
- * @param fn - The 3-way comparison function to apply to the values.
225
- * It should return `< 0` if an element is less than a value, `0` if
226
- * an element is equal to a value, or `> 0` if an element is greater
227
- * than a value.
228
- *
229
- * @param start - The index of the first element in the range to be
230
- * searched, inclusive. The default value is `0`. Negative values
231
- * are taken as an offset from the end of the array.
232
- *
233
- * @param stop - The index of the last element in the range to be
234
- * searched, inclusive. The default value is `-1`. Negative values
235
- * are taken as an offset from the end of the array.
236
- *
237
- * @returns The index of the first element which compares `>=` to the
238
- * value, or `length` if there is no such element. If the computed
239
- * index for `stop` is less than `start`, then the computed index
240
- * for `start` is returned.
241
- *
242
- * #### Notes
243
- * The array must already be sorted in ascending order according to
244
- * the comparison function.
245
- *
246
- * #### Complexity
247
- * Logarithmic.
248
- *
249
- * #### Undefined Behavior
250
- * Searching a range which is not sorted in ascending order.
251
- *
252
- * A `start` or `stop` which is non-integral.
253
- *
254
- * Modifying the length of the array while searching.
255
- *
256
- * #### Example
257
- * ```typescript
258
- *
259
- * function numberCmp(a: number, b: number): number {
260
- * return a - b;
261
- * }
262
- *
263
- * let data = [0, 3, 4, 7, 7, 9];
264
- * lowerArrayBound(data, 0, numberCmp); // 0
265
- * lowerArrayBound(data, 6, numberCmp); // 3
266
- * lowerArrayBound(data, 7, numberCmp); // 3
267
- * lowerArrayBound(data, -1, numberCmp); // 0
268
- * lowerArrayBound(data, 10, numberCmp); // 6
269
- * ```
270
- */
271
- export declare function lowerArrayBound<T, U>(array: ArrayLike<T>, value: U, fn: (element: T, value: U) => number, start?: number, stop?: number): number;
272
- /**
273
- * Find the index of the first element which compares `>` than a value.
274
- *
275
- * @param array - The sorted array-like object to search.
276
- *
277
- * @param value - The value to locate in the array.
278
- *
279
- * @param fn - The 3-way comparison function to apply to the values.
280
- * It should return `< 0` if an element is less than a value, `0` if
281
- * an element is equal to a value, or `> 0` if an element is greater
282
- * than a value.
283
- *
284
- * @param start - The index of the first element in the range to be
285
- * searched, inclusive. The default value is `0`. Negative values
286
- * are taken as an offset from the end of the array.
287
- *
288
- * @param stop - The index of the last element in the range to be
289
- * searched, inclusive. The default value is `-1`. Negative values
290
- * are taken as an offset from the end of the array.
291
- *
292
- * @returns The index of the first element which compares `>` than the
293
- * value, or `length` if there is no such element. If the computed
294
- * index for `stop` is less than `start`, then the computed index
295
- * for `start` is returned.
296
- *
297
- * #### Notes
298
- * The array must already be sorted in ascending order according to
299
- * the comparison function.
300
- *
301
- * #### Complexity
302
- * Logarithmic.
303
- *
304
- * #### Undefined Behavior
305
- * Searching a range which is not sorted in ascending order.
306
- *
307
- * A `start` or `stop` which is non-integral.
308
- *
309
- * Modifying the length of the array while searching.
310
- *
311
- * #### Example
312
- * ```typescript
313
- *
314
- * function numberCmp(a: number, b: number): number {
315
- * return a - b;
316
- * }
317
- *
318
- * let data = [0, 3, 4, 7, 7, 9];
319
- * upperArrayBound(data, 0, numberCmp); // 1
320
- * upperArrayBound(data, 6, numberCmp); // 3
321
- * upperArrayBound(data, 7, numberCmp); // 5
322
- * upperArrayBound(data, -1, numberCmp); // 0
323
- * upperArrayBound(data, 10, numberCmp); // 6
324
- * ```
325
- */
326
- export declare function upperArrayBound<T, U>(array: ArrayLike<T>, value: U, fn: (element: T, value: U) => number, start?: number, stop?: number): number;
327
- /**
328
- * Remove all occurrences of values which match a predicate.
329
- *
330
- * @param array - The array of interest.
331
- *
332
- * @param fn - The predicate function to apply to the values.
333
- *
334
- * @param start - The index of the first element in the range to be
335
- * searched, inclusive. The default value is `0`. Negative values
336
- * are taken as an offset from the end of the array.
337
- *
338
- * @param stop - The index of the last element in the range to be
339
- * searched, inclusive. The default value is `-1`. Negative values
340
- * are taken as an offset from the end of the array.
341
- *
342
- * @returns The number of elements removed from the array.
343
- *
344
- * #### Notes
345
- * If `stop < start` the search will conceptually wrap at the end of
346
- * the array, however the array will be traversed front-to-back.
347
- *
348
- * #### Complexity
349
- * Linear.
350
- *
351
- * #### Example
352
- * ```typescript
353
- *
354
- * function isEven(value: number): boolean {
355
- * return value % 2 === 0;
356
- * }
357
- *
358
- * function isNegative(value: number): boolean {
359
- * return value < 0;
360
- * }
361
- *
362
- * let data = [0, 12, -13, -9, 23, 39, 14, -15, 12, 75];
363
- * removeAllWhereFromArray(data, isEven); // 4
364
- * removeAllWhereFromArray(data, isNegative, 0, 3); // 2
365
- * ```
366
- */
367
- export declare function removeAllWhereFromArray<T>(array: T[], fn: (value: T, index: number) => boolean, start?: number, stop?: number): number;
368
- //# sourceMappingURL=array.d.ts.map
package/es/array.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../src/array.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EACnB,KAAK,EAAE,CAAC,EACR,KAAK,SAAI,EACT,IAAI,SAAK,GACR,MAAM,CA8BR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EACnB,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,EACxC,KAAK,SAAI,EACT,IAAI,SAAK,GACR,MAAM,CA8BR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EACnB,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,EACxC,KAAK,SAAK,EACV,IAAI,SAAI,GACP,MAAM,CA+BR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EACnB,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,EACxC,KAAK,SAAI,EACT,IAAI,SAAK,GACR,CAAC,GAAG,SAAS,CAGf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EACnB,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,EACxC,KAAK,SAAK,EACV,IAAI,SAAI,GACP,CAAC,GAAG,SAAS,CAGf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,EAClC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EACnB,KAAK,EAAE,CAAC,EACR,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,MAAM,EACpC,KAAK,SAAI,EACT,IAAI,SAAK,GACR,MAAM,CA8BR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,EAClC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EACnB,KAAK,EAAE,CAAC,EACR,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,MAAM,EACpC,KAAK,SAAI,EACT,IAAI,SAAK,GACR,MAAM,CA8BR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EACvC,KAAK,EAAE,CAAC,EAAE,EACV,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,EACxC,KAAK,SAAI,EACT,IAAI,SAAK,GACR,MAAM,CAmCR"}
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- export declare const DisplayWrapComponent: React.FC<{
3
- children: any;
4
- mode: boolean | undefined;
5
- }>;
6
- //# sourceMappingURL=display-wrapper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"display-wrapper.d.ts","sourceRoot":"","sources":["../src/display-wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC;IAC1C,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;CAC3B,CAKA,CAAC"}
package/es/index.d.ts DELETED
@@ -1,11 +0,0 @@
1
- export * from './array.js';
2
- export * from './iter.js';
3
- export * from './json.js';
4
- export * from './utils.js';
5
- export * from './sanitizer.js';
6
- export * from './url.js';
7
- export * from './path.js';
8
- export * from './polling/index.js';
9
- export * from './display-wrapper.js';
10
- export * from './protocol/index.js';
11
- //# sourceMappingURL=index.d.ts.map
package/es/index.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}