feat:node-modules
This commit is contained in:
24
node_modules/mathjs/lib/esm/error/ArgumentsError.js
generated
vendored
Normal file
24
node_modules/mathjs/lib/esm/error/ArgumentsError.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Create a syntax error with the message:
|
||||
* 'Wrong number of arguments in function <fn> (<count> provided, <min>-<max> expected)'
|
||||
* @param {string} fn Function name
|
||||
* @param {number} count Actual argument count
|
||||
* @param {number} min Minimum required argument count
|
||||
* @param {number} [max] Maximum required argument count
|
||||
* @extends Error
|
||||
*/
|
||||
export function ArgumentsError(fn, count, min, max) {
|
||||
if (!(this instanceof ArgumentsError)) {
|
||||
throw new SyntaxError('Constructor must be called with the new operator');
|
||||
}
|
||||
this.fn = fn;
|
||||
this.count = count;
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
this.message = 'Wrong number of arguments in function ' + fn + ' (' + count + ' provided, ' + min + (max !== undefined && max !== null ? '-' + max : '') + ' expected)';
|
||||
this.stack = new Error().stack;
|
||||
}
|
||||
ArgumentsError.prototype = new Error();
|
||||
ArgumentsError.prototype.constructor = Error;
|
||||
ArgumentsError.prototype.name = 'ArgumentsError';
|
||||
ArgumentsError.prototype.isArgumentsError = true;
|
||||
23
node_modules/mathjs/lib/esm/error/DimensionError.js
generated
vendored
Normal file
23
node_modules/mathjs/lib/esm/error/DimensionError.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Create a range error with the message:
|
||||
* 'Dimension mismatch (<actual size> != <expected size>)'
|
||||
* @param {number | number[]} actual The actual size
|
||||
* @param {number | number[]} expected The expected size
|
||||
* @param {string} [relation='!='] Optional relation between actual
|
||||
* and expected size: '!=', '<', etc.
|
||||
* @extends RangeError
|
||||
*/
|
||||
export function DimensionError(actual, expected, relation) {
|
||||
if (!(this instanceof DimensionError)) {
|
||||
throw new SyntaxError('Constructor must be called with the new operator');
|
||||
}
|
||||
this.actual = actual;
|
||||
this.expected = expected;
|
||||
this.relation = relation;
|
||||
this.message = 'Dimension mismatch (' + (Array.isArray(actual) ? '[' + actual.join(', ') + ']' : actual) + ' ' + (this.relation || '!=') + ' ' + (Array.isArray(expected) ? '[' + expected.join(', ') + ']' : expected) + ')';
|
||||
this.stack = new Error().stack;
|
||||
}
|
||||
DimensionError.prototype = new RangeError();
|
||||
DimensionError.prototype.constructor = RangeError;
|
||||
DimensionError.prototype.name = 'DimensionError';
|
||||
DimensionError.prototype.isDimensionError = true;
|
||||
35
node_modules/mathjs/lib/esm/error/IndexError.js
generated
vendored
Normal file
35
node_modules/mathjs/lib/esm/error/IndexError.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Create a range error with the message:
|
||||
* 'Index out of range (index < min)'
|
||||
* 'Index out of range (index < max)'
|
||||
*
|
||||
* @param {number} index The actual index
|
||||
* @param {number} [min=0] Minimum index (included)
|
||||
* @param {number} [max] Maximum index (excluded)
|
||||
* @extends RangeError
|
||||
*/
|
||||
export function IndexError(index, min, max) {
|
||||
if (!(this instanceof IndexError)) {
|
||||
throw new SyntaxError('Constructor must be called with the new operator');
|
||||
}
|
||||
this.index = index;
|
||||
if (arguments.length < 3) {
|
||||
this.min = 0;
|
||||
this.max = min;
|
||||
} else {
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
if (this.min !== undefined && this.index < this.min) {
|
||||
this.message = 'Index out of range (' + this.index + ' < ' + this.min + ')';
|
||||
} else if (this.max !== undefined && this.index >= this.max) {
|
||||
this.message = 'Index out of range (' + this.index + ' > ' + (this.max - 1) + ')';
|
||||
} else {
|
||||
this.message = 'Index out of range (' + this.index + ')';
|
||||
}
|
||||
this.stack = new Error().stack;
|
||||
}
|
||||
IndexError.prototype = new RangeError();
|
||||
IndexError.prototype.constructor = RangeError;
|
||||
IndexError.prototype.name = 'IndexError';
|
||||
IndexError.prototype.isIndexError = true;
|
||||
Reference in New Issue
Block a user