mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-04 04:40:05 +02:00
update packages to latest version
This commit is contained in:
103
node_modules/decimal.js/decimal.mjs
generated
vendored
103
node_modules/decimal.js/decimal.mjs
generated
vendored
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* decimal.js v10.2.1
|
||||
/*!
|
||||
* decimal.js v10.4.0
|
||||
* An arbitrary-precision Decimal type for JavaScript.
|
||||
* https://github.com/MikeMcl/decimal.js
|
||||
* Copyright (c) 2020 Michael Mclaughlin <M8ch88l@gmail.com>
|
||||
* Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
|
||||
* MIT Licence
|
||||
*/
|
||||
|
||||
@@ -101,6 +101,7 @@ var EXP_LIMIT = 9e15, // 0 to 9e15
|
||||
invalidArgument = decimalError + 'Invalid argument: ',
|
||||
precisionLimitExceeded = decimalError + 'Precision limit exceeded',
|
||||
cryptoUnavailable = decimalError + 'crypto unavailable',
|
||||
tag = '[object Decimal]',
|
||||
|
||||
mathfloor = Math.floor,
|
||||
mathpow = Math.pow,
|
||||
@@ -118,7 +119,7 @@ var EXP_LIMIT = 9e15, // 0 to 9e15
|
||||
PI_PRECISION = PI.length - 1,
|
||||
|
||||
// Decimal.prototype object
|
||||
P = { name: '[object Decimal]' };
|
||||
P = { toStringTag: tag };
|
||||
|
||||
|
||||
// Decimal prototype methods
|
||||
@@ -127,6 +128,7 @@ var EXP_LIMIT = 9e15, // 0 to 9e15
|
||||
/*
|
||||
* absoluteValue abs
|
||||
* ceil
|
||||
* clampedTo clamp
|
||||
* comparedTo cmp
|
||||
* cosine cos
|
||||
* cubeRoot cbrt
|
||||
@@ -208,6 +210,27 @@ P.ceil = function () {
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Return a new Decimal whose value is the value of this Decimal clamped to the range
|
||||
* delineated by `min` and `max`.
|
||||
*
|
||||
* min {number|string|Decimal}
|
||||
* max {number|string|Decimal}
|
||||
*
|
||||
*/
|
||||
P.clampedTo = P.clamp = function (min, max) {
|
||||
var k,
|
||||
x = this,
|
||||
Ctor = x.constructor;
|
||||
min = new Ctor(min);
|
||||
max = new Ctor(max);
|
||||
if (!min.s || !max.s) return new Ctor(NaN);
|
||||
if (min.gt(max)) throw Error(invalidArgument + max);
|
||||
k = x.cmp(min);
|
||||
return k < 0 ? min : x.cmp(max) > 0 ? max : new Ctor(x);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Return
|
||||
* 1 if the value of this Decimal is greater than the value of `y`,
|
||||
@@ -2441,18 +2464,6 @@ P.valueOf = P.toJSON = function () {
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
// Add aliases to match BigDecimal method names.
|
||||
// P.add = P.plus;
|
||||
P.subtract = P.minus;
|
||||
P.multiply = P.times;
|
||||
P.divide = P.div;
|
||||
P.remainder = P.mod;
|
||||
P.compareTo = P.cmp;
|
||||
P.negate = P.neg;
|
||||
*/
|
||||
|
||||
|
||||
// Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.
|
||||
|
||||
|
||||
@@ -2624,13 +2635,15 @@ function convertBase(str, baseIn, baseOut) {
|
||||
*
|
||||
*/
|
||||
function cosine(Ctor, x) {
|
||||
var k, y,
|
||||
len = x.d.length;
|
||||
var k, len, y;
|
||||
|
||||
if (x.isZero()) return x;
|
||||
|
||||
// Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1
|
||||
// i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1
|
||||
|
||||
// Estimate the optimum number of times to use the argument reduction.
|
||||
len = x.d.length;
|
||||
if (len < 32) {
|
||||
k = Math.ceil(len / 3);
|
||||
y = (1 / tinyPow(4, k)).toString();
|
||||
@@ -3582,7 +3595,10 @@ function parseDecimal(x, str) {
|
||||
function parseOther(x, str) {
|
||||
var base, Ctor, divisor, i, isFloat, len, p, xd, xe;
|
||||
|
||||
if (str === 'Infinity' || str === 'NaN') {
|
||||
if (str.indexOf('_') > -1) {
|
||||
str = str.replace(/(\d)_(?=\d)/g, '$1');
|
||||
if (isDecimal.test(str)) return parseDecimal(x, str);
|
||||
} else if (str === 'Infinity' || str === 'NaN') {
|
||||
if (!+str) x.s = NaN;
|
||||
x.e = NaN;
|
||||
x.d = null;
|
||||
@@ -3660,7 +3676,9 @@ function sine(Ctor, x) {
|
||||
var k,
|
||||
len = x.d.length;
|
||||
|
||||
if (len < 3) return taylorSeries(Ctor, 2, x, x);
|
||||
if (len < 3) {
|
||||
return x.isZero() ? x : taylorSeries(Ctor, 2, x, x);
|
||||
}
|
||||
|
||||
// Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x)
|
||||
// i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5)
|
||||
@@ -3926,6 +3944,7 @@ function truncate(arr, len) {
|
||||
* atan2
|
||||
* cbrt
|
||||
* ceil
|
||||
* clamp
|
||||
* clone
|
||||
* config
|
||||
* cos
|
||||
@@ -3951,6 +3970,7 @@ function truncate(arr, len) {
|
||||
* sinh
|
||||
* sqrt
|
||||
* sub
|
||||
* sum
|
||||
* tan
|
||||
* tanh
|
||||
* trunc
|
||||
@@ -4144,6 +4164,19 @@ function ceil(x) {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return a new Decimal whose value is `x` clamped to the range delineated by `min` and `max`.
|
||||
*
|
||||
* x {number|string|Decimal}
|
||||
* min {number|string|Decimal}
|
||||
* max {number|string|Decimal}
|
||||
*
|
||||
*/
|
||||
function clamp(x, min, max) {
|
||||
return new this(x).clamp(min, max);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Configure global settings for a Decimal constructor.
|
||||
*
|
||||
@@ -4257,7 +4290,7 @@ function clone(obj) {
|
||||
x.constructor = Decimal;
|
||||
|
||||
// Duplicate.
|
||||
if (v instanceof Decimal) {
|
||||
if (isDecimalInstance(v)) {
|
||||
x.s = v.s;
|
||||
|
||||
if (external) {
|
||||
@@ -4377,6 +4410,7 @@ function clone(obj) {
|
||||
Decimal.atan2 = atan2;
|
||||
Decimal.cbrt = cbrt; // ES6
|
||||
Decimal.ceil = ceil;
|
||||
Decimal.clamp = clamp;
|
||||
Decimal.cos = cos;
|
||||
Decimal.cosh = cosh; // ES6
|
||||
Decimal.div = div;
|
||||
@@ -4399,6 +4433,7 @@ function clone(obj) {
|
||||
Decimal.sinh = sinh; // ES6
|
||||
Decimal.sqrt = sqrt;
|
||||
Decimal.sub = sub;
|
||||
Decimal.sum = sum;
|
||||
Decimal.tan = tan;
|
||||
Decimal.tanh = tanh; // ES6
|
||||
Decimal.trunc = trunc; // ES6
|
||||
@@ -4493,7 +4528,7 @@ function hypot() {
|
||||
*
|
||||
*/
|
||||
function isDecimalInstance(obj) {
|
||||
return obj instanceof Decimal || obj && obj.name === '[object Decimal]' || false;
|
||||
return obj instanceof Decimal || obj && obj.toStringTag === tag || false;
|
||||
}
|
||||
|
||||
|
||||
@@ -4793,6 +4828,28 @@ function sub(x, y) {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return a new Decimal whose value is the sum of the arguments, rounded to `precision`
|
||||
* significant digits using rounding mode `rounding`.
|
||||
*
|
||||
* Only the result is rounded, not the intermediate calculations.
|
||||
*
|
||||
* arguments {number|string|Decimal}
|
||||
*
|
||||
*/
|
||||
function sum() {
|
||||
var i = 0,
|
||||
args = arguments,
|
||||
x = new this(args[i]);
|
||||
|
||||
external = false;
|
||||
for (; x.s && ++i < args.length;) x = x.plus(args[i]);
|
||||
external = true;
|
||||
|
||||
return finalise(x, this.precision, this.rounding);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant
|
||||
* digits using rounding mode `rounding`.
|
||||
@@ -4832,7 +4889,7 @@ P[Symbol.for('nodejs.util.inspect.custom')] = P.toString;
|
||||
P[Symbol.toStringTag] = 'Decimal';
|
||||
|
||||
// Create and configure initial Decimal constructor.
|
||||
export var Decimal = clone(DEFAULTS);
|
||||
export var Decimal = P.constructor = clone(DEFAULTS);
|
||||
|
||||
// Create the internal constants from their string values.
|
||||
LN10 = new Decimal(LN10);
|
||||
|
Reference in New Issue
Block a user