@nhtio/lucid-resourceful 1.20250718.2 → 1.20250724.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.
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-DDaZ2qr2.js","sources":["../node_modules/.pnpm/big.js@7.0.1/node_modules/big.js/big.mjs","../src/private/joi/bigint.ts","../src/private/joi/index.ts"],"sourcesContent":["/*\r\n * big.js v7.0.1\r\n * A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.\r\n * Copyright (c) 2025 Michael Mclaughlin\r\n * https://github.com/MikeMcl/big.js/LICENCE.md\r\n */\r\n\r\n\r\n/************************************** EDITABLE DEFAULTS *****************************************/\r\n\r\n\r\n // The default values below must be integers within the stated ranges.\r\n\r\n /*\r\n * The maximum number of decimal places (DP) of the results of operations involving division:\r\n * div and sqrt, and pow with negative exponents.\r\n */\r\nvar DP = 20, // 0 to MAX_DP\r\n\r\n /*\r\n * The rounding mode (RM) used when rounding to the above decimal places.\r\n *\r\n * 0 Towards zero (i.e. truncate, no rounding). (ROUND_DOWN)\r\n * 1 To nearest neighbour. If equidistant, round up. (ROUND_HALF_UP)\r\n * 2 To nearest neighbour. If equidistant, to even. (ROUND_HALF_EVEN)\r\n * 3 Away from zero. (ROUND_UP)\r\n */\r\n RM = 1, // 0, 1, 2 or 3\r\n\r\n // The maximum value of DP and Big.DP.\r\n MAX_DP = 1E6, // 0 to 1000000\r\n\r\n // The maximum magnitude of the exponent argument to the pow method.\r\n MAX_POWER = 1E6, // 1 to 1000000\r\n\r\n /*\r\n * The negative exponent (NE) at and beneath which toString returns exponential notation.\r\n * (JavaScript numbers: -7)\r\n * -1000000 is the minimum recommended exponent value of a Big.\r\n */\r\n NE = -7, // 0 to -1000000\r\n\r\n /*\r\n * The positive exponent (PE) at and above which toString returns exponential notation.\r\n * (JavaScript numbers: 21)\r\n * 1000000 is the maximum recommended exponent value of a Big, but this limit is not enforced.\r\n */\r\n PE = 21, // 0 to 1000000\r\n\r\n /*\r\n * When true, an error will be thrown if a primitive number is passed to the Big constructor,\r\n * or if valueOf is called, or if toNumber is called on a Big which cannot be converted to a\r\n * primitive number without a loss of precision.\r\n */\r\n STRICT = false, // true or false\r\n\r\n\r\n/**************************************************************************************************/\r\n\r\n\r\n // Error messages.\r\n NAME = '[big.js] ',\r\n INVALID = NAME + 'Invalid ',\r\n INVALID_DP = INVALID + 'decimal places',\r\n INVALID_RM = INVALID + 'rounding mode',\r\n DIV_BY_ZERO = NAME + 'Division by zero',\r\n\r\n // The shared prototype object.\r\n P = {},\r\n UNDEFINED = void 0,\r\n NUMERIC = /^-?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i;\r\n\r\n\r\n/*\r\n * Create and return a Big constructor.\r\n */\r\nfunction _Big_() {\r\n\r\n /*\r\n * The Big constructor and exported function.\r\n * Create and return a new instance of a Big number object.\r\n *\r\n * n {number|string|Big} A numeric value.\r\n */\r\n function Big(n) {\r\n var x = this;\r\n\r\n // Enable constructor usage without new.\r\n if (!(x instanceof Big)) {\r\n return n === UNDEFINED && arguments.length === 0 ? _Big_() : new Big(n);\r\n }\r\n\r\n\r\n // Duplicate.\r\n if (n instanceof Big) {\r\n x.s = n.s;\r\n x.e = n.e;\r\n x.c = n.c.slice();\r\n } else {\r\n if (typeof n !== 'string') {\r\n if (Big.strict === true && typeof n !== 'bigint') {\r\n throw TypeError(INVALID + 'value');\r\n }\r\n\r\n // Minus zero?\r\n n = n === 0 && 1 / n < 0 ? '-0' : String(n);\r\n }\r\n\r\n parse(x, n);\r\n }\r\n\r\n // Retain a reference to this Big constructor.\r\n // Shadow Big.prototype.constructor which points to Object.\r\n x.constructor = Big;\r\n }\r\n\r\n Big.prototype = P;\r\n Big.DP = DP;\r\n Big.RM = RM;\r\n Big.NE = NE;\r\n Big.PE = PE;\r\n Big.strict = STRICT;\r\n Big.roundDown = 0;\r\n Big.roundHalfUp = 1;\r\n Big.roundHalfEven = 2;\r\n Big.roundUp = 3;\r\n\r\n return Big;\r\n}\r\n\r\n\r\n/*\r\n * Parse the number or string value passed to a Big constructor.\r\n *\r\n * x {Big} A Big number instance.\r\n * n {number|string} A numeric value.\r\n */\r\nfunction parse(x, n) {\r\n var e, i, nl;\r\n\r\n if (!NUMERIC.test(n)) {\r\n throw Error(INVALID + 'number');\r\n }\r\n\r\n // Determine sign.\r\n x.s = n.charAt(0) == '-' ? (n = n.slice(1), -1) : 1;\r\n\r\n // Decimal point?\r\n if ((e = n.indexOf('.')) > -1) n = n.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = n.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +n.slice(i + 1);\r\n n = n.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = n.length;\r\n }\r\n\r\n nl = n.length;\r\n\r\n // Determine leading zeros.\r\n for (i = 0; i < nl && n.charAt(i) == '0';) ++i;\r\n\r\n if (i == nl) {\r\n\r\n // Zero.\r\n x.c = [x.e = 0];\r\n } else {\r\n\r\n // Determine trailing zeros.\r\n for (; nl > 0 && n.charAt(--nl) == '0';);\r\n x.e = e - i - 1;\r\n x.c = [];\r\n\r\n // Convert string to array of digits without leading/trailing zeros.\r\n for (e = 0; i <= nl;) x.c[e++] = +n.charAt(i++);\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Round Big x to a maximum of sd significant digits using rounding mode rm.\r\n *\r\n * x {Big} The Big to round.\r\n * sd {number} Significant digits: integer, 0 to MAX_DP inclusive.\r\n * rm {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\r\n * [more] {boolean} Whether the result of division was truncated.\r\n */\r\nfunction round(x, sd, rm, more) {\r\n var xc = x.c;\r\n\r\n if (rm === UNDEFINED) rm = x.constructor.RM;\r\n if (rm !== 0 && rm !== 1 && rm !== 2 && rm !== 3) {\r\n throw Error(INVALID_RM);\r\n }\r\n\r\n if (sd < 1) {\r\n more =\r\n rm === 3 && (more || !!xc[0]) || sd === 0 && (\r\n rm === 1 && xc[0] >= 5 ||\r\n rm === 2 && (xc[0] > 5 || xc[0] === 5 && (more || xc[1] !== UNDEFINED))\r\n );\r\n\r\n xc.length = 1;\r\n\r\n if (more) {\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n x.e = x.e - sd + 1;\r\n xc[0] = 1;\r\n } else {\r\n\r\n // Zero.\r\n xc[0] = x.e = 0;\r\n }\r\n } else if (sd < xc.length) {\r\n\r\n // xc[sd] is the digit after the digit that may be rounded up.\r\n more =\r\n rm === 1 && xc[sd] >= 5 ||\r\n rm === 2 && (xc[sd] > 5 || xc[sd] === 5 &&\r\n (more || xc[sd + 1] !== UNDEFINED || xc[sd - 1] & 1)) ||\r\n rm === 3 && (more || !!xc[0]);\r\n\r\n // Remove any digits after the required precision.\r\n xc.length = sd;\r\n\r\n // Round up?\r\n if (more) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up.\r\n for (; ++xc[--sd] > 9;) {\r\n xc[sd] = 0;\r\n if (sd === 0) {\r\n ++x.e;\r\n xc.unshift(1);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (sd = xc.length; !xc[--sd];) xc.pop();\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Return a string representing the value of Big x in normal or exponential notation.\r\n * Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.\r\n */\r\nfunction stringify(x, doExponential, isNonzero) {\r\n var e = x.e,\r\n s = x.c.join(''),\r\n n = s.length;\r\n\r\n // Exponential notation?\r\n if (doExponential) {\r\n s = s.charAt(0) + (n > 1 ? '.' + s.slice(1) : '') + (e < 0 ? 'e' : 'e+') + e;\r\n\r\n // Normal notation.\r\n } else if (e < 0) {\r\n for (; ++e;) s = '0' + s;\r\n s = '0.' + s;\r\n } else if (e > 0) {\r\n if (++e > n) {\r\n for (e -= n; e--;) s += '0';\r\n } else if (e < n) {\r\n s = s.slice(0, e) + '.' + s.slice(e);\r\n }\r\n } else if (n > 1) {\r\n s = s.charAt(0) + '.' + s.slice(1);\r\n }\r\n\r\n return x.s < 0 && isNonzero ? '-' + s : s;\r\n}\r\n\r\n\r\n// Prototype/instance methods\r\n\r\n\r\n/*\r\n * Return a new Big whose value is the absolute value of this Big.\r\n */\r\nP.abs = function () {\r\n var x = new this.constructor(this);\r\n x.s = 1;\r\n return x;\r\n};\r\n\r\n\r\n/*\r\n * Return 1 if the value of this Big is greater than the value of Big y,\r\n * -1 if the value of this Big is less than the value of Big y, or\r\n * 0 if they have the same value.\r\n */\r\nP.cmp = function (y) {\r\n var isneg,\r\n x = this,\r\n xc = x.c,\r\n yc = (y = new x.constructor(y)).c,\r\n i = x.s,\r\n j = y.s,\r\n k = x.e,\r\n l = y.e;\r\n\r\n // Either zero?\r\n if (!xc[0] || !yc[0]) return !xc[0] ? !yc[0] ? 0 : -j : i;\r\n\r\n // Signs differ?\r\n if (i != j) return i;\r\n\r\n isneg = i < 0;\r\n\r\n // Compare exponents.\r\n if (k != l) return k > l ^ isneg ? 1 : -1;\r\n\r\n j = (k = xc.length) < (l = yc.length) ? k : l;\r\n\r\n // Compare digit by digit.\r\n for (i = -1; ++i < j;) {\r\n if (xc[i] != yc[i]) return xc[i] > yc[i] ^ isneg ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return k == l ? 0 : k > l ^ isneg ? 1 : -1;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,\r\n * if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\r\n */\r\nP.div = function (y) {\r\n var x = this,\r\n Big = x.constructor,\r\n a = x.c, // dividend\r\n b = (y = new Big(y)).c, // divisor\r\n k = x.s == y.s ? 1 : -1,\r\n dp = Big.DP;\r\n\r\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\r\n throw Error(INVALID_DP);\r\n }\r\n\r\n // Divisor is zero?\r\n if (!b[0]) {\r\n throw Error(DIV_BY_ZERO);\r\n }\r\n\r\n // Dividend is 0? Return +-0.\r\n if (!a[0]) {\r\n y.s = k;\r\n y.c = [y.e = 0];\r\n return y;\r\n }\r\n\r\n var bl, bt, n, cmp, ri,\r\n bz = b.slice(),\r\n ai = bl = b.length,\r\n al = a.length,\r\n r = a.slice(0, bl), // remainder\r\n rl = r.length,\r\n q = y, // quotient\r\n qc = q.c = [],\r\n qi = 0,\r\n p = dp + (q.e = x.e - y.e) + 1; // precision of the result\r\n\r\n q.s = k;\r\n k = p < 0 ? 0 : p;\r\n\r\n // Create version of divisor with leading zero.\r\n bz.unshift(0);\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; rl++ < bl;) r.push(0);\r\n\r\n do {\r\n\r\n // n is how many times the divisor goes into current remainder.\r\n for (n = 0; n < 10; n++) {\r\n\r\n // Compare divisor and remainder.\r\n if (bl != (rl = r.length)) {\r\n cmp = bl > rl ? 1 : -1;\r\n } else {\r\n for (ri = -1, cmp = 0; ++ri < bl;) {\r\n if (b[ri] != r[ri]) {\r\n cmp = b[ri] > r[ri] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // If divisor < remainder, subtract divisor from remainder.\r\n if (cmp < 0) {\r\n\r\n // Remainder can't be more than 1 digit longer than divisor.\r\n // Equalise lengths using divisor with extra leading zero?\r\n for (bt = rl == bl ? b : bz; rl;) {\r\n if (r[--rl] < bt[rl]) {\r\n ri = rl;\r\n for (; ri && !r[--ri];) r[ri] = 9;\r\n --r[ri];\r\n r[rl] += 10;\r\n }\r\n r[rl] -= bt[rl];\r\n }\r\n\r\n for (; !r[0];) r.shift();\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n // Add the digit n to the result array.\r\n qc[qi++] = cmp ? n : ++n;\r\n\r\n // Update the remainder.\r\n if (r[0] && cmp) r[rl] = a[ai] || 0;\r\n else r = [a[ai]];\r\n\r\n } while ((ai++ < al || r[0] !== UNDEFINED) && k--);\r\n\r\n // Leading zero? Do not remove if result is simply zero (qi == 1).\r\n if (!qc[0] && qi != 1) {\r\n\r\n // There can't be more than one zero.\r\n qc.shift();\r\n q.e--;\r\n p--;\r\n }\r\n\r\n // Round?\r\n if (qi > p) round(q, p, Big.RM, r[0] !== UNDEFINED);\r\n\r\n return q;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Big is equal to the value of Big y, otherwise return false.\r\n */\r\nP.eq = function (y) {\r\n return this.cmp(y) === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Big is greater than the value of Big y, otherwise return\r\n * false.\r\n */\r\nP.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Big is greater than or equal to the value of Big y, otherwise\r\n * return false.\r\n */\r\nP.gte = function (y) {\r\n return this.cmp(y) > -1;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Big is less than the value of Big y, otherwise return false.\r\n */\r\nP.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Big is less than or equal to the value of Big y, otherwise\r\n * return false.\r\n */\r\nP.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Big whose value is the value of this Big minus the value of Big y.\r\n */\r\nP.minus = P.sub = function (y) {\r\n var i, j, t, xlty,\r\n x = this,\r\n Big = x.constructor,\r\n a = x.s,\r\n b = (y = new Big(y)).s;\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.plus(y);\r\n }\r\n\r\n var xc = x.c.slice(),\r\n xe = x.e,\r\n yc = y.c,\r\n ye = y.e;\r\n\r\n // Either zero?\r\n if (!xc[0] || !yc[0]) {\r\n if (yc[0]) {\r\n y.s = -b;\r\n } else if (xc[0]) {\r\n y = new Big(x);\r\n } else {\r\n y.s = 1;\r\n }\r\n return y;\r\n }\r\n\r\n // Determine which is the bigger number. Prepend zeros to equalise exponents.\r\n if (a = xe - ye) {\r\n\r\n if (xlty = a < 0) {\r\n a = -a;\r\n t = xc;\r\n } else {\r\n ye = xe;\r\n t = yc;\r\n }\r\n\r\n t.reverse();\r\n for (b = a; b--;) t.push(0);\r\n t.reverse();\r\n } else {\r\n\r\n // Exponents equal. Check digit by digit.\r\n j = ((xlty = xc.length < yc.length) ? xc : yc).length;\r\n\r\n for (a = b = 0; b < j; b++) {\r\n if (xc[b] != yc[b]) {\r\n xlty = xc[b] < yc[b];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // x < y? Point xc to the array of the bigger number.\r\n if (xlty) {\r\n t = xc;\r\n xc = yc;\r\n yc = t;\r\n y.s = -y.s;\r\n }\r\n\r\n /*\r\n * Append zeros to xc if shorter. No need to add zeros to yc if shorter as subtraction only\r\n * needs to start at yc.length.\r\n */\r\n if ((b = (j = yc.length) - (i = xc.length)) > 0) for (; b--;) xc[i++] = 0;\r\n\r\n // Subtract yc from xc.\r\n for (b = i; j > a;) {\r\n if (xc[--j] < yc[j]) {\r\n for (i = j; i && !xc[--i];) xc[i] = 9;\r\n --xc[i];\r\n xc[j] += 10;\r\n }\r\n\r\n xc[j] -= yc[j];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xc[--b] === 0;) xc.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xc[0] === 0;) {\r\n xc.shift();\r\n --ye;\r\n }\r\n\r\n if (!xc[0]) {\r\n\r\n // n - n = +0\r\n y.s = 1;\r\n\r\n // Result must be zero.\r\n xc = [ye = 0];\r\n }\r\n\r\n y.c = xc;\r\n y.e = ye;\r\n\r\n return y;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Big whose value is the value of this Big modulo the value of Big y.\r\n */\r\nP.mod = function (y) {\r\n var ygtx,\r\n x = this,\r\n Big = x.constructor,\r\n a = x.s,\r\n b = (y = new Big(y)).s;\r\n\r\n if (!y.c[0]) {\r\n throw Error(DIV_BY_ZERO);\r\n }\r\n\r\n x.s = y.s = 1;\r\n ygtx = y.cmp(x) == 1;\r\n x.s = a;\r\n y.s = b;\r\n\r\n if (ygtx) return new Big(x);\r\n\r\n a = Big.DP;\r\n b = Big.RM;\r\n Big.DP = Big.RM = 0;\r\n x = x.div(y);\r\n Big.DP = a;\r\n Big.RM = b;\r\n\r\n return this.minus(x.times(y));\r\n};\r\n\r\n\r\n/*\r\n * Return a new Big whose value is the value of this Big negated.\r\n */\r\nP.neg = function () {\r\n var x = new this.constructor(this);\r\n x.s = -x.s;\r\n return x;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Big whose value is the value of this Big plus the value of Big y.\r\n */\r\nP.plus = P.add = function (y) {\r\n var e, k, t,\r\n x = this,\r\n Big = x.constructor;\r\n\r\n y = new Big(y);\r\n\r\n // Signs differ?\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.minus(y);\r\n }\r\n\r\n var xe = x.e,\r\n xc = x.c,\r\n ye = y.e,\r\n yc = y.c;\r\n\r\n // Either zero?\r\n if (!xc[0] || !yc[0]) {\r\n if (!yc[0]) {\r\n if (xc[0]) {\r\n y = new Big(x);\r\n } else {\r\n y.s = x.s;\r\n }\r\n }\r\n return y;\r\n }\r\n\r\n xc = xc.slice();\r\n\r\n // Prepend zeros to equalise exponents.\r\n // Note: reverse faster than unshifts.\r\n if (e = xe - ye) {\r\n if (e > 0) {\r\n ye = xe;\r\n t = yc;\r\n } else {\r\n e = -e;\r\n t = xc;\r\n }\r\n\r\n t.reverse();\r\n for (; e--;) t.push(0);\r\n t.reverse();\r\n }\r\n\r\n // Point xc to the longer array.\r\n if (xc.length - yc.length < 0) {\r\n t = yc;\r\n yc = xc;\r\n xc = t;\r\n }\r\n\r\n e = yc.length;\r\n\r\n // Only start adding at yc.length - 1 as the further digits of xc can be left as they are.\r\n for (k = 0; e; xc[e] %= 10) k = (xc[--e] = xc[e] + yc[e] + k) / 10 | 0;\r\n\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n\r\n if (k) {\r\n xc.unshift(k);\r\n ++ye;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (e = xc.length; xc[--e] === 0;) xc.pop();\r\n\r\n y.c = xc;\r\n y.e = ye;\r\n\r\n return y;\r\n};\r\n\r\n\r\n/*\r\n * Return a Big whose value is the value of this Big raised to the power n.\r\n * If n is negative, round to a maximum of Big.DP decimal places using rounding\r\n * mode Big.RM.\r\n *\r\n * n {number} Integer, -MAX_POWER to MAX_POWER inclusive.\r\n */\r\nP.pow = function (n) {\r\n var x = this,\r\n one = new x.constructor('1'),\r\n y = one,\r\n isneg = n < 0;\r\n\r\n if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) {\r\n throw Error(INVALID + 'exponent');\r\n }\r\n\r\n if (isneg) n = -n;\r\n\r\n for (;;) {\r\n if (n & 1) y = y.times(x);\r\n n >>= 1;\r\n if (!n) break;\r\n x = x.times(x);\r\n }\r\n\r\n return isneg ? one.div(y) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Big whose value is the value of this Big rounded to a maximum precision of sd\r\n * significant digits using rounding mode rm, or Big.RM if rm is not specified.\r\n *\r\n * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.\r\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\r\n */\r\nP.prec = function (sd, rm) {\r\n if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {\r\n throw Error(INVALID + 'precision');\r\n }\r\n return round(new this.constructor(this), sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Big whose value is the value of this Big rounded to a maximum of dp decimal places\r\n * using rounding mode rm, or Big.RM if rm is not specified.\r\n * If dp is negative, round to an integer which is a multiple of 10**-dp.\r\n * If dp is not specified, round to 0 decimal places.\r\n *\r\n * dp? {number} Integer, -MAX_DP to MAX_DP inclusive.\r\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\r\n */\r\nP.round = function (dp, rm) {\r\n if (dp === UNDEFINED) dp = 0;\r\n else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) {\r\n throw Error(INVALID_DP);\r\n }\r\n return round(new this.constructor(this), dp + this.e + 1, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Big whose value is the square root of the value of this Big, rounded, if\r\n * necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\r\n */\r\nP.sqrt = function () {\r\n var r, c, t,\r\n x = this,\r\n Big = x.constructor,\r\n s = x.s,\r\n e = x.e,\r\n half = new Big('0.5');\r\n\r\n // Zero?\r\n if (!x.c[0]) return new Big(x);\r\n\r\n // Negative?\r\n if (s < 0) {\r\n throw Error(NAME + 'No square root');\r\n }\r\n\r\n // Estimate.\r\n s = Math.sqrt(+stringify(x, true, true));\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.\r\n if (s === 0 || s === 1 / 0) {\r\n c = x.c.join('');\r\n if (!(c.length + e & 1)) c += '0';\r\n s = Math.sqrt(c);\r\n e = ((e + 1) / 2 | 0) - (e < 0 || e & 1);\r\n r = new Big((s == 1 / 0 ? '5e' : (s = s.toExponential()).slice(0, s.indexOf('e') + 1)) + e);\r\n } else {\r\n r = new Big(s + '');\r\n }\r\n\r\n e = r.e + (Big.DP += 4);\r\n\r\n // Newton-Raphson iteration.\r\n do {\r\n t = r;\r\n r = half.times(t.plus(x.div(t)));\r\n } while (t.c.slice(0, e).join('') !== r.c.slice(0, e).join(''));\r\n\r\n return round(r, (Big.DP -= 4) + r.e + 1, Big.RM);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Big whose value is the value of this Big times the value of Big y.\r\n */\r\nP.times = P.mul = function (y) {\r\n var c,\r\n x = this,\r\n Big = x.constructor,\r\n xc = x.c,\r\n yc = (y = new Big(y)).c,\r\n a = xc.length,\r\n b = yc.length,\r\n i = x.e,\r\n j = y.e;\r\n\r\n // Determine sign of result.\r\n y.s = x.s == y.s ? 1 : -1;\r\n\r\n // Return signed 0 if either 0.\r\n if (!xc[0] || !yc[0]) {\r\n y.c = [y.e = 0];\r\n return y;\r\n }\r\n\r\n // Initialise exponent of result as x.e + y.e.\r\n y.e = i + j;\r\n\r\n // If array xc has fewer digits than yc, swap xc and yc, and lengths.\r\n if (a < b) {\r\n c = xc;\r\n xc = yc;\r\n yc = c;\r\n j = a;\r\n a = b;\r\n b = j;\r\n }\r\n\r\n // Initialise coefficient array of result with zeros.\r\n for (c = new Array(j = a + b); j--;) c[j] = 0;\r\n\r\n // Multiply.\r\n\r\n // i is initially xc.length.\r\n for (i = b; i--;) {\r\n b = 0;\r\n\r\n // a is yc.length.\r\n for (j = a + i; j > i;) {\r\n\r\n // Current sum of products at this digit position, plus carry.\r\n b = c[j] + yc[i] * xc[j - i - 1] + b;\r\n c[j--] = b % 10;\r\n\r\n // carry\r\n b = b / 10 | 0;\r\n }\r\n\r\n c[j] = b;\r\n }\r\n\r\n // Increment result exponent if there is a final carry, otherwise remove leading zero.\r\n if (b) ++y.e;\r\n else c.shift();\r\n\r\n // Remove trailing zeros.\r\n for (i = c.length; !c[--i];) c.pop();\r\n y.c = c;\r\n\r\n return y;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Big in exponential notation rounded to dp fixed\r\n * decimal places using rounding mode rm, or Big.RM if rm is not specified.\r\n *\r\n * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.\r\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\r\n */\r\nP.toExponential = function (dp, rm) {\r\n var x = this,\r\n n = x.c[0];\r\n\r\n if (dp !== UNDEFINED) {\r\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\r\n throw Error(INVALID_DP);\r\n }\r\n x = round(new x.constructor(x), ++dp, rm);\r\n for (; x.c.length < dp;) x.c.push(0);\r\n }\r\n\r\n return stringify(x, true, !!n);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Big in normal notation rounded to dp fixed\r\n * decimal places using rounding mode rm, or Big.RM if rm is not specified.\r\n *\r\n * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.\r\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n */\r\nP.toFixed = function (dp, rm) {\r\n var x = this,\r\n n = x.c[0];\r\n\r\n if (dp !== UNDEFINED) {\r\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\r\n throw Error(INVALID_DP);\r\n }\r\n x = round(new x.constructor(x), dp + x.e + 1, rm);\r\n\r\n // x.e may have changed if the value is rounded up.\r\n for (dp = dp + x.e + 1; x.c.length < dp;) x.c.push(0);\r\n }\r\n\r\n return stringify(x, false, !!n);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Big.\r\n * Return exponential notation if this Big has a positive exponent equal to or greater than\r\n * Big.PE, or a negative exponent equal to or less than Big.NE.\r\n * Omit the sign for negative zero.\r\n */\r\nP.toJSON = P.toString = function () {\r\n var x = this,\r\n Big = x.constructor;\r\n return stringify(x, x.e <= Big.NE || x.e >= Big.PE, !!x.c[0]);\r\n};\r\n\r\nif (typeof Symbol !== \"undefined\") {\r\n P[Symbol.for('nodejs.util.inspect.custom')] = P.toJSON;\r\n}\r\n\r\n\r\n/*\r\n * Return the value of this Big as a primitive number.\r\n */\r\nP.toNumber = function () {\r\n var n = +stringify(this, true, true);\r\n if (this.constructor.strict === true && !this.eq(n.toString())) {\r\n throw Error(NAME + 'Imprecise conversion');\r\n }\r\n return n;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Big rounded to sd significant digits using\r\n * rounding mode rm, or Big.RM if rm is not specified.\r\n * Use exponential notation if sd is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.\r\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\r\n */\r\nP.toPrecision = function (sd, rm) {\r\n var x = this,\r\n Big = x.constructor,\r\n n = x.c[0];\r\n\r\n if (sd !== UNDEFINED) {\r\n if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {\r\n throw Error(INVALID + 'precision');\r\n }\r\n x = round(new Big(x), sd, rm);\r\n for (; x.c.length < sd;) x.c.push(0);\r\n }\r\n\r\n return stringify(x, sd <= x.e || x.e <= Big.NE || x.e >= Big.PE, !!n);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Big.\r\n * Return exponential notation if this Big has a positive exponent equal to or greater than\r\n * Big.PE, or a negative exponent equal to or less than Big.NE.\r\n * Include the sign for negative zero.\r\n */\r\nP.valueOf = function () {\r\n var x = this,\r\n Big = x.constructor;\r\n if (Big.strict === true) {\r\n throw Error(NAME + 'valueOf disallowed');\r\n }\r\n return stringify(x, x.e <= Big.NE || x.e >= Big.PE, true);\r\n};\r\n\r\n\r\n// Export\r\n\r\n\r\nexport var Big = _Big_();\r\n\r\n/// <reference types=\"https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/types/big.js/index.d.ts\" />\r\nexport default Big;\r\n","import { default as Big } from 'big.js'\nimport type { AnySchema } from '../schema_types'\nimport type { Root, ExtensionFactory, Reference } from 'joi'\n\n/**\n * Internal comparison function for BigInt validation operations using Big.js.\n *\n * @param value - The value to compare\n * @param limit - The limit to compare against\n * @param operator - The comparison operator to use\n * @returns True if the comparison passes, false otherwise\n *\n * @internal\n */\nconst compare = (value: Big, limit: Big, operator: '>' | '<' | '>=' | '<=' | 'multiple') => {\n switch (operator) {\n case '>':\n return value.gt(limit)\n case '<':\n return value.lt(limit)\n case '>=':\n return value.gte(limit)\n case '<=':\n return value.lte(limit)\n case 'multiple':\n return value.mod(limit).eq(0)\n /* v8 ignore next 2 */\n default:\n return false\n }\n}\n\n/**\n * A Joi extension that adds support for BigInt validation with comprehensive\n * comparison operations and type coercion.\n *\n * @example\n * ```typescript\n * import { joi } from '@nhtio/lucid-resourceful/joi'\n *\n * const schema = joi.bigint()\n * .min(0n)\n * .max(1000n)\n * .required()\n *\n * // Validates and converts to BigInt\n * const result = schema.validate(\"123\") // Returns { value: 123n }\n * ```\n *\n * @example\n * ```typescript\n * // Works with all standard Joi methods\n * const optionalSchema = joi.bigint()\n * .positive()\n * .optional()\n * .allow(null)\n * .default(0n)\n * ```\n *\n * @public\n */\nexport const bigint: ExtensionFactory = function (this: Root, joi: Root) {\n return {\n type: 'bigint',\n base: joi.any(),\n coerce: {\n from: ['string', 'number'],\n method(value, helpers) {\n /* v8 ignore next 3 */\n if ('bigint' === typeof value) {\n return { value }\n }\n\n try {\n // Use Big.js to handle the conversion properly\n const asBig = Big(value.toString())\n\n // Check if it's an integer (no decimal places)\n if (asBig.eq(asBig.round(0))) {\n return { value: BigInt(asBig.toString()) }\n } else {\n // Has decimal places, not valid for BigInt\n return {\n value,\n errors: [\n helpers.error('bigint.base', {\n value: String(value),\n }),\n ],\n }\n }\n } catch {\n /* v8 ignore next 5 */\n return {\n value,\n errors: [\n helpers.error('bigint.base', {\n value: String(value),\n }),\n ],\n }\n }\n },\n },\n messages: {\n 'bigint.base': '\"{{#label}}\" must be a valid bigint',\n 'bigint.greater': '\"{{#label}}\" must be greater than {{#limit}}',\n 'bigint.less': '\"{{#label}}\" must be less than {{#limit}}',\n 'bigint.max': '\"{{#label}}\" must be less than or equal to {{#limit}}',\n 'bigint.min': '\"{{#label}}\" must be greater than or equal to {{#limit}}',\n 'bigint.multiple': '\"{{#label}}\" must be a multiple of {{#limit}}',\n 'bigint.negative': '\"{{#label}}\" must be a negative bigint',\n 'bigint.positive': '\"{{#label}}\" must be a positive bigint',\n },\n validate(value, { error }) {\n // Accept native BigInt values as-is\n if (typeof value === 'bigint') {\n return { value }\n }\n\n // Everything else should be handled by coerce, so if we get here, it's invalid\n /* v8 ignore next 5 */\n return {\n value,\n errors: error('bigint.base', {\n value: String(value),\n }),\n }\n },\n rules: {\n compare: {\n method: false,\n validate(value, helpers, { limit }, { name, operator }) {\n const big = Big(value.toString())\n const threshold = Big(limit.toString())\n const valid = compare(big, threshold, operator)\n if (valid) {\n return value\n }\n return helpers.error('bigint.' + name, {\n limit: limit.toString(),\n value: value.toString(),\n })\n },\n args: [\n {\n name: 'limit',\n ref: true,\n assert: (value) => typeof value === 'bigint',\n message: 'must be a bigint',\n },\n ],\n },\n /**\n * Validates that the BigInt is greater than the specified threshold\n * @param limit - The threshold value to compare against\n */\n greater: {\n method(limit) {\n // @ts-ignore\n return this.$_addRule({\n name: 'greater',\n // @ts-ignore\n method: 'compare',\n args: { limit },\n operator: '>',\n })\n },\n },\n /**\n * Validates that the BigInt is less than the specified threshold\n * @param limit - The threshold value to compare against\n */\n less: {\n method(limit) {\n // @ts-ignore\n return this.$_addRule({ name: 'less', method: 'compare', args: { limit }, operator: '<' })\n },\n },\n /**\n * Validates that the BigInt is less than or equal to the specified maximum\n * @param limit - The maximum allowed value\n */\n max: {\n method(limit) {\n // @ts-ignore\n return this.$_addRule({ name: 'max', method: 'compare', args: { limit }, operator: '<=' })\n },\n },\n /**\n * Validates that the BigInt is greater than or equal to the specified minimum\n * @param limit - The minimum allowed value\n */\n min: {\n method(limit) {\n // @ts-ignore\n return this.$_addRule({ name: 'min', method: 'compare', args: { limit }, operator: '>=' })\n },\n },\n /**\n * Validates that the BigInt is a multiple of the specified factor\n * @param limit - The factor that the value must be a multiple of\n */\n multiple: {\n method(limit) {\n // @ts-ignore\n return this.$_addRule({\n name: 'multiple',\n // @ts-ignore\n method: 'compare',\n args: { limit },\n operator: 'multiple',\n })\n },\n },\n /**\n * Validates that the BigInt is negative (less than zero)\n */\n negative: {\n method() {\n return this.$_addRule('negative')\n },\n validate(value, helpers) {\n if (value >= 0n) {\n return helpers.error('bigint.negative', { value: value.toString() })\n }\n return value\n },\n },\n /**\n * Validates that the BigInt is positive (greater than zero)\n */\n positive: {\n method() {\n return this.$_addRule('positive')\n },\n validate(value, helpers) {\n if (value <= 0n) {\n return helpers.error('bigint.positive', { value: value.toString() })\n }\n return value\n },\n },\n },\n cast: {\n string: {\n from: (value) => typeof value === 'bigint',\n to(value) {\n return value.toString()\n },\n },\n },\n }\n}\n\n/**\n * Joi schema type for BigInt validation with comprehensive comparison operations.\n *\n * This interface extends the base Joi AnySchema to provide BigInt-specific\n * validation methods including range checks, sign validation, and multiple checks.\n *\n * @example\n * ```typescript\n * import { joi } from '@nhtio/lucid-resourceful/joi'\n *\n * const schema: BigIntSchema = joi.bigint()\n * .min(0n)\n * .max(1000n)\n * .positive()\n * ```\n *\n * @public\n */\nexport interface BigIntSchema<TSchema = bigint> extends AnySchema<TSchema> {\n /**\n * Validates that the BigInt is greater than the specified threshold\n * @param limit - The threshold value to compare against\n */\n greater(limit: bigint | Reference): this\n\n /**\n * Validates that the BigInt is less than the specified threshold\n * @param limit - The threshold value to compare against\n */\n less(limit: bigint | Reference): this\n\n /**\n * Validates that the BigInt is less than or equal to the specified maximum\n * @param limit - The maximum allowed value\n */\n max(limit: bigint | Reference): this\n\n /**\n * Validates that the BigInt is greater than or equal to the specified minimum\n * @param limit - The minimum allowed value\n */\n min(limit: bigint | Reference): this\n\n /**\n * Validates that the BigInt is a multiple of the specified factor\n * @param limit - The factor that the value must be a multiple of\n */\n multiple(limit: bigint | Reference): this\n\n /**\n * Validates that the BigInt is negative (less than zero)\n */\n negative(): this\n\n /**\n * Validates that the BigInt is positive (greater than zero)\n */\n positive(): this\n}\n","import { bigint } from './bigint'\nimport { default as Joi } from 'joi'\nimport type { Root } from 'joi'\nimport type { BigIntSchema } from './bigint'\n\n/**\n * Extended Joi root interface that includes custom schema types for\n * lucid-resourceful validation scenarios.\n *\n * This interface extends the standard Joi Root interface to include\n * additional schema types specifically designed for AdonisJS Lucid\n * model validation requirements.\n *\n * @example\n * ```typescript\n * import { joi } from '@nhtio/lucid-resourceful/joi'\n *\n * const schema = joi.object({\n * id: joi.bigint().positive().required(),\n * balance: joi.bigint().min(0n).optional()\n * })\n * ```\n *\n * @public\n */\nexport interface ExtendedJoiRoot extends Root {\n /**\n * Creates a BigInt schema type for validation\n * @returns A new BigInt schema instance\n */\n bigint(): BigIntSchema\n}\n\n/**\n * Extended Joi instance with custom schema types for lucid-resourceful.\n *\n * This instance includes all standard Joi functionality plus additional\n * schema types optimized for AdonisJS Lucid model validation scenarios.\n *\n * @example\n * ```typescript\n * import { joi } from '@nhtio/lucid-resourceful/joi'\n *\n * // Standard Joi usage\n * const userSchema = joi.object({\n * name: joi.string().required(),\n * age: joi.number().min(0),\n * balance: joi.bigint().positive() // Custom BigInt type\n * })\n *\n * // Use in resourceful decorators\n * @resourceful({\n * type: 'bigint',\n * validate: {\n * create: joi.bigint().positive(),\n * update: joi.bigint().min(0n)\n * }\n * })\n * public balance: bigint\n * ```\n *\n * @public\n */\nexport const joi: ExtendedJoiRoot = Joi.extend(bigint) as ExtendedJoiRoot\n\n/**\n * Re-export of the BigIntSchema interface for external use\n * @public\n */\nexport type { BigIntSchema }\n"],"names":["Big","joi"],"mappings":";AAiBA,IAAI,KAAK,IAUP,KAAK,GAGL,SAAS,KAGT,YAAY,KAOZ,KAAK,IAOL,KAAK,IAOL,SAAS,OAOT,OAAO,aACP,UAAU,OAAO,YACjB,aAAa,UAAU,kBACvB,aAAa,UAAU,iBACvB,cAAc,OAAO,oBAGrB,IAAI,CAAA,GACJ,YAAY,QACZ,UAAU;AAMZ,SAAS,QAAQ;AAQf,WAASA,KAAI,GAAG;AACd,QAAI,IAAI;AAGR,QAAI,EAAE,aAAaA,OAAM;AACvB,aAAO,MAAM,aAAa,UAAU,WAAW,IAAI,UAAU,IAAIA,KAAI,CAAC;AAAA,IACxE;AAIA,QAAI,aAAaA,MAAK;AACpB,QAAE,IAAI,EAAE;AACR,QAAE,IAAI,EAAE;AACR,QAAE,IAAI,EAAE,EAAE,MAAK;AAAA,IACjB,OAAO;AACL,UAAI,OAA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AY;AAAA,UACrE;AACA,iBAAO;AAAA,QACT;AAAA,MAAA;AAAA;AAAA;AAAA;AAAA,MAKF,UAAU;AAAA,QACR,SAAS;AACP,iBAAO,KAAK,UAAU,UAAU;AAAA,QAClC;AAAA,QACA,SAAS,OAAO,SAAS;AACvB,cAAI,SAAS,IAAI;AACf,mBAAO,QAAQ,MAAM,mBAAmB,EAAE,OAAO,MAAM,SAAA,GAAY;AAAA,UACrE;AACA,iBAAO;AAAA,QACT;AAAA,MAAA;AAAA,IACF;AAAA,IAEF,MAAM;AAAA,MACJ,QAAQ;AAAA,QACN,MAAM,CAAC,UAAU,OAAO,UAAU;AAAA,QAClC,GAAG,OAAO;AACR,iBAAO,MAAM,SAAA;AAAA,QACf;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ;AC9LO,MAAM,MAAuB,IAAI,OAAO,MAAM;","x_google_ignoreList":[0]}
@@ -1,85 +0,0 @@
1
- import type { AnySchema } from '../schema_types';
2
- import type { ExtensionFactory, Reference } from 'joi';
3
- /**
4
- * A Joi extension that adds support for BigInt validation with comprehensive
5
- * comparison operations and type coercion.
6
- *
7
- * @example
8
- * ```typescript
9
- * import { joi } from '@nhtio/lucid-resourceful/joi'
10
- *
11
- * const schema = joi.bigint()
12
- * .min(0n)
13
- * .max(1000n)
14
- * .required()
15
- *
16
- * // Validates and converts to BigInt
17
- * const result = schema.validate("123") // Returns { value: 123n }
18
- * ```
19
- *
20
- * @example
21
- * ```typescript
22
- * // Works with all standard Joi methods
23
- * const optionalSchema = joi.bigint()
24
- * .positive()
25
- * .optional()
26
- * .allow(null)
27
- * .default(0n)
28
- * ```
29
- *
30
- * @public
31
- */
32
- export declare const bigint: ExtensionFactory;
33
- /**
34
- * Joi schema type for BigInt validation with comprehensive comparison operations.
35
- *
36
- * This interface extends the base Joi AnySchema to provide BigInt-specific
37
- * validation methods including range checks, sign validation, and multiple checks.
38
- *
39
- * @example
40
- * ```typescript
41
- * import { joi } from '@nhtio/lucid-resourceful/joi'
42
- *
43
- * const schema: BigIntSchema = joi.bigint()
44
- * .min(0n)
45
- * .max(1000n)
46
- * .positive()
47
- * ```
48
- *
49
- * @public
50
- */
51
- export interface BigIntSchema<TSchema = bigint> extends AnySchema<TSchema> {
52
- /**
53
- * Validates that the BigInt is greater than the specified threshold
54
- * @param limit - The threshold value to compare against
55
- */
56
- greater(limit: bigint | Reference): this;
57
- /**
58
- * Validates that the BigInt is less than the specified threshold
59
- * @param limit - The threshold value to compare against
60
- */
61
- less(limit: bigint | Reference): this;
62
- /**
63
- * Validates that the BigInt is less than or equal to the specified maximum
64
- * @param limit - The maximum allowed value
65
- */
66
- max(limit: bigint | Reference): this;
67
- /**
68
- * Validates that the BigInt is greater than or equal to the specified minimum
69
- * @param limit - The minimum allowed value
70
- */
71
- min(limit: bigint | Reference): this;
72
- /**
73
- * Validates that the BigInt is a multiple of the specified factor
74
- * @param limit - The factor that the value must be a multiple of
75
- */
76
- multiple(limit: bigint | Reference): this;
77
- /**
78
- * Validates that the BigInt is negative (less than zero)
79
- */
80
- negative(): this;
81
- /**
82
- * Validates that the BigInt is positive (greater than zero)
83
- */
84
- positive(): this;
85
- }