UNPKG

@caspingus/lt

Version:

A utility library of helpers and extensions useful when working with Learnosity APIs.

81 lines (80 loc) 2.31 kB
import { r as e } from "./isObjectLike--jMIiz6U.js"; import { t } from "./isSymbol-Bt-81A1s.js"; import { t as n } from "./isObject-BMjug7c_.js"; //#region node_modules/lodash-es/_trimmedEndIndex.js var r = /\s/; function i(e) { for (var t = e.length; t-- && r.test(e.charAt(t));); return t; } //#endregion //#region node_modules/lodash-es/_baseTrim.js var a = /^\s+/; function o(e) { return e && e.slice(0, i(e) + 1).replace(a, ""); } //#endregion //#region node_modules/lodash-es/toNumber.js var s = NaN, c = /^[-+]0x[0-9a-f]+$/i, l = /^0b[01]+$/i, u = /^0o[0-7]+$/i, d = parseInt; function f(e) { if (typeof e == "number") return e; if (t(e)) return s; if (n(e)) { var r = typeof e.valueOf == "function" ? e.valueOf() : e; e = n(r) ? r + "" : r; } if (typeof e != "string") return e === 0 ? e : +e; e = o(e); var i = l.test(e); return i || u.test(e) ? d(e.slice(2), i ? 2 : 8) : c.test(e) ? s : +e; } //#endregion //#region node_modules/lodash-es/now.js var p = function() { return e.Date.now(); }, m = "Expected a function", h = Math.max, g = Math.min; function _(e, t, r) { var i, a, o, s, c, l, u = 0, d = !1, _ = !1, v = !0; if (typeof e != "function") throw TypeError(m); t = f(t) || 0, n(r) && (d = !!r.leading, _ = "maxWait" in r, o = _ ? h(f(r.maxWait) || 0, t) : o, v = "trailing" in r ? !!r.trailing : v); function y(t) { var n = i, r = a; return i = a = void 0, u = t, s = e.apply(r, n), s; } function b(e) { return u = e, c = setTimeout(C, t), d ? y(e) : s; } function x(e) { var n = e - l, r = e - u, i = t - n; return _ ? g(i, o - r) : i; } function S(e) { var n = e - l, r = e - u; return l === void 0 || n >= t || n < 0 || _ && r >= o; } function C() { var e = p(); if (S(e)) return w(e); c = setTimeout(C, x(e)); } function w(e) { return c = void 0, v && i ? y(e) : (i = a = void 0, s); } function T() { c !== void 0 && clearTimeout(c), u = 0, i = l = a = c = void 0; } function E() { return c === void 0 ? s : w(p()); } function D() { var e = p(), n = S(e); if (i = arguments, a = this, l = e, n) { if (c === void 0) return b(l); if (_) return clearTimeout(c), c = setTimeout(C, t), y(l); } return c === void 0 && (c = setTimeout(C, t)), s; } return D.cancel = T, D.flush = E, D; } //#endregion export { _ as t };