@danielsimonjr/mathts-core 0.9.0 → 0.11.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/dist/internal.js CHANGED
@@ -1,13 +1,16 @@
1
1
  import {
2
+ MathjsError,
2
3
  Unit,
3
4
  acosh,
4
5
  asinh,
6
+ assertDependencies,
5
7
  atanh,
6
8
  canDefineProperty,
7
9
  cbrt,
8
10
  clone,
9
11
  copysign,
10
12
  cosh,
13
+ create,
11
14
  createUnitClass,
12
15
  deepExtend,
13
16
  deepFlatten,
@@ -16,6 +19,7 @@ import {
16
19
  endsWith,
17
20
  expm1,
18
21
  extend,
22
+ factory,
19
23
  format,
20
24
  get,
21
25
  hasOwnProperty,
@@ -27,6 +31,7 @@ import {
27
31
  isComplex2 as isComplex,
28
32
  isDate,
29
33
  isDenseMatrix,
34
+ isFactory,
30
35
  isFraction,
31
36
  isFunction,
32
37
  isIndex,
@@ -37,6 +42,7 @@ import {
37
42
  isNull,
38
43
  isNumber,
39
44
  isObject,
45
+ isOptionalDependency,
40
46
  isPowZeroAtInfinity,
41
47
  isRange,
42
48
  isRegExp,
@@ -59,7 +65,9 @@ import {
59
65
  set,
60
66
  sign,
61
67
  sinh,
68
+ sortFactories,
62
69
  splitNumber,
70
+ stripOptionalNotation,
63
71
  tanh,
64
72
  toEngineering,
65
73
  toExponential,
@@ -69,28 +77,1338 @@ import {
69
77
  typeOf,
70
78
  unitDependencies,
71
79
  warnOnce
72
- } from "./chunk-2WW76EEF.js";
80
+ } from "./chunk-PALIR4V6.js";
81
+
82
+ // src/error/DimensionError.ts
83
+ var DimensionError = class _DimensionError extends RangeError {
84
+ actual;
85
+ expected;
86
+ relation;
87
+ isDimensionError = true;
88
+ /**
89
+ * @param actual - The actual size or custom error message
90
+ * @param expected - The expected size (optional if actual is a custom message)
91
+ * @param relation - Optional relation between actual and expected size: '!=', '<', etc.
92
+ */
93
+ constructor(actual, expected, relation) {
94
+ let message;
95
+ if (typeof actual === "string" && expected === void 0) {
96
+ message = actual;
97
+ } else {
98
+ message = "Dimension mismatch (" + (Array.isArray(actual) ? "[" + actual.join(", ") + "]" : actual) + " " + (relation || "!=") + " " + (Array.isArray(expected) ? "[" + expected.join(", ") + "]" : expected) + ")";
99
+ }
100
+ super(message);
101
+ this.name = "DimensionError";
102
+ if (typeof actual === "string" && expected === void 0) {
103
+ this.actual = void 0;
104
+ this.expected = void 0;
105
+ this.relation = void 0;
106
+ } else {
107
+ this.actual = actual;
108
+ this.expected = expected;
109
+ this.relation = relation;
110
+ }
111
+ const ErrorWithCapture = Error;
112
+ if (ErrorWithCapture.captureStackTrace) {
113
+ ErrorWithCapture.captureStackTrace(this, _DimensionError);
114
+ }
115
+ }
116
+ };
117
+
118
+ // src/error/IndexError.ts
119
+ var IndexError = class _IndexError extends RangeError {
120
+ index;
121
+ min;
122
+ max;
123
+ isIndexError = true;
124
+ /**
125
+ * Create an IndexError
126
+ *
127
+ * Can be called in two ways:
128
+ * - IndexError(index, max) - assumes min=0
129
+ * - IndexError(index, min, max)
130
+ *
131
+ * @param index The actual index
132
+ * @param min Minimum index (included), or max if only 2 args provided
133
+ * @param max Maximum index (excluded)
134
+ */
135
+ constructor(index, min, max) {
136
+ let actualMin;
137
+ let actualMax;
138
+ if (max === void 0) {
139
+ actualMin = 0;
140
+ actualMax = min;
141
+ } else {
142
+ actualMin = min;
143
+ actualMax = max;
144
+ }
145
+ let message;
146
+ if (actualMin !== void 0 && index < actualMin) {
147
+ message = "Index out of range (" + index + " < " + actualMin + ")";
148
+ } else if (actualMax !== void 0 && index >= actualMax) {
149
+ message = "Index out of range (" + index + " > " + (actualMax - 1) + ")";
150
+ } else {
151
+ message = "Index out of range (" + index + ")";
152
+ }
153
+ super(message);
154
+ this.index = index;
155
+ this.min = actualMin;
156
+ this.max = actualMax;
157
+ this.name = "IndexError";
158
+ const ErrorWithCapture = Error;
159
+ if (ErrorWithCapture.captureStackTrace) {
160
+ ErrorWithCapture.captureStackTrace(this, _IndexError);
161
+ }
162
+ }
163
+ };
164
+ function createIndexError(index, min, max) {
165
+ return new IndexError(index, min, max);
166
+ }
167
+
168
+ // src/bignumber-formatter.ts
169
+ function formatBigNumberToBase(n, base, size) {
170
+ const BigNumberCtor = n.constructor;
171
+ const big2 = new BigNumberCtor(2);
172
+ let suffix = "";
173
+ if (size) {
174
+ if (size < 1) {
175
+ throw new Error("size must be in greater than 0");
176
+ }
177
+ if (!isInteger(size)) {
178
+ throw new Error("size must be an integer");
179
+ }
180
+ if (n.greaterThan(big2.pow(size - 1).sub(1)) || n.lessThan(big2.pow(size - 1).mul(-1))) {
181
+ throw new Error(`Value must be in range [-2^${size - 1}, 2^${size - 1}-1]`);
182
+ }
183
+ if (!n.isInteger()) {
184
+ throw new Error("Value must be an integer");
185
+ }
186
+ if (n.lessThan(0)) {
187
+ n = n.add(big2.pow(size));
188
+ }
189
+ suffix = `i${size}`;
190
+ }
191
+ switch (base) {
192
+ case 2:
193
+ return `${n.toBinary()}${suffix}`;
194
+ case 8:
195
+ return `${n.toOctal()}${suffix}`;
196
+ case 16:
197
+ return `${n.toHexadecimal()}${suffix}`;
198
+ default:
199
+ throw new Error(`Base ${base} not supported `);
200
+ }
201
+ }
202
+ function format2(value, options) {
203
+ const v = value;
204
+ if (typeof options === "function") {
205
+ return options(value);
206
+ }
207
+ if (!v.isFinite()) {
208
+ return v.isNaN() ? "NaN" : v.gt(0) ? "Infinity" : "-Infinity";
209
+ }
210
+ const { notation, precision, wordSize } = normalizeFormatOptions(
211
+ options
212
+ );
213
+ switch (notation) {
214
+ case "fixed":
215
+ return toFixed2(v, precision);
216
+ case "exponential":
217
+ return toExponential2(v, precision);
218
+ case "engineering":
219
+ return toEngineering2(v, precision);
220
+ case "bin":
221
+ return formatBigNumberToBase(v, 2, wordSize);
222
+ case "oct":
223
+ return formatBigNumberToBase(v, 8, wordSize);
224
+ case "hex":
225
+ return formatBigNumberToBase(v, 16, wordSize);
226
+ case "auto": {
227
+ const optionsObj = options;
228
+ const lowerExp = _toNumberOrDefault(optionsObj?.lowerExp, -3);
229
+ const upperExp = _toNumberOrDefault(optionsObj?.upperExp, 5);
230
+ if (v.isZero()) return "0";
231
+ let str;
232
+ const rounded = v.toSignificantDigits(precision);
233
+ const exp = rounded.e;
234
+ if (exp >= lowerExp && exp < upperExp) {
235
+ str = rounded.toFixed();
236
+ } else {
237
+ str = toExponential2(v, precision);
238
+ }
239
+ return str.replace(
240
+ /((\.\d*?)(0+))($|e)/,
241
+ function(_match, _g1, digits2, _g3, e) {
242
+ return digits2 !== "." ? digits2 + e : e;
243
+ }
244
+ );
245
+ }
246
+ default:
247
+ throw new Error(
248
+ 'Unknown notation "' + notation + '". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.'
249
+ );
250
+ }
251
+ }
252
+ function toEngineering2(value, precision) {
253
+ const e = value.e;
254
+ const newExp = e % 3 === 0 ? e : e < 0 ? e - 3 - e % 3 : e - e % 3;
255
+ const valueWithoutExp = value.mul(Math.pow(10, -newExp));
256
+ let valueStr = valueWithoutExp.toPrecision(precision);
257
+ if (valueStr.includes("e")) {
258
+ const BigNumberCtor = value.constructor;
259
+ valueStr = new BigNumberCtor(valueStr).toFixed();
260
+ }
261
+ return valueStr + "e" + (e >= 0 ? "+" : "") + newExp.toString();
262
+ }
263
+ function toExponential2(value, precision) {
264
+ if (precision !== void 0) {
265
+ return value.toExponential(precision - 1);
266
+ } else {
267
+ return value.toExponential();
268
+ }
269
+ }
270
+ function toFixed2(value, precision) {
271
+ return value.toFixed(precision);
272
+ }
273
+ function _toNumberOrDefault(value, defaultValue) {
274
+ if (isNumber(value)) {
275
+ return value;
276
+ } else if (isBigNumber(value)) {
277
+ return value.toNumber();
278
+ } else {
279
+ return defaultValue;
280
+ }
281
+ }
282
+
283
+ // src/string.ts
284
+ function format3(value, options) {
285
+ const result = _format(value, options);
286
+ if (options && typeof options === "object" && "truncate" in options) {
287
+ const truncate = options.truncate;
288
+ if (typeof truncate === "number" && result.length > truncate) {
289
+ return result.substring(0, truncate - 3) + "...";
290
+ }
291
+ }
292
+ return result;
293
+ }
294
+ function _format(value, options) {
295
+ if (typeof value === "number") {
296
+ return format(value, options);
297
+ }
298
+ if (isBigNumber(value)) {
299
+ return format2(value, options);
300
+ }
301
+ if (looksLikeFraction(value)) {
302
+ if (!options || options.fraction !== "decimal") {
303
+ const signedNumerator = typeof value.n === "bigint" ? BigInt(value.s) * value.n : value.s * value.n;
304
+ return `${signedNumerator}/${value.d}`;
305
+ } else {
306
+ return value.toString();
307
+ }
308
+ }
309
+ if (Array.isArray(value)) {
310
+ return formatArray(value, options);
311
+ }
312
+ if (isString(value)) {
313
+ return stringify(value);
314
+ }
315
+ if (typeof value === "function") {
316
+ const syntax = value.syntax;
317
+ return syntax ? String(syntax) : "function";
318
+ }
319
+ if (value && typeof value === "object") {
320
+ const obj = value;
321
+ if (typeof obj.format === "function") {
322
+ return obj.format(options);
323
+ } else if (obj.toString(options) !== {}.toString()) {
324
+ return obj.toString(options);
325
+ } else {
326
+ const entries = Object.keys(obj).map((key) => {
327
+ return stringify(key) + ": " + format3(obj[key], options);
328
+ });
329
+ return "{" + entries.join(", ") + "}";
330
+ }
331
+ }
332
+ return String(value);
333
+ }
334
+ function stringify(value) {
335
+ const text = String(value);
336
+ let escaped = "";
337
+ let i = 0;
338
+ while (i < text.length) {
339
+ const c = text.charAt(i);
340
+ escaped += c in controlCharacters ? controlCharacters[c] : c;
341
+ i++;
342
+ }
343
+ return '"' + escaped + '"';
344
+ }
345
+ var controlCharacters = {
346
+ '"': '\\"',
347
+ "\\": "\\\\",
348
+ "\b": "\\b",
349
+ "\f": "\\f",
350
+ "\n": "\\n",
351
+ "\r": "\\r",
352
+ " ": "\\t"
353
+ };
354
+ function escape(value) {
355
+ let text = String(value);
356
+ text = text.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
357
+ return text;
358
+ }
359
+ function formatArray(array, options) {
360
+ if (Array.isArray(array)) {
361
+ let str = "[";
362
+ const len = array.length;
363
+ for (let i = 0; i < len; i++) {
364
+ if (i !== 0) {
365
+ str += ", ";
366
+ }
367
+ str += formatArray(array[i], options);
368
+ }
369
+ str += "]";
370
+ return str;
371
+ } else {
372
+ return format3(array, options);
373
+ }
374
+ }
375
+ function looksLikeFraction(value) {
376
+ const frac = value;
377
+ return !!frac && typeof frac === "object" && typeof frac.s === "bigint" && typeof frac.n === "bigint" && typeof frac.d === "bigint" || false;
378
+ }
379
+ function compareText(x, y) {
380
+ if (!isString(x)) {
381
+ throw new TypeError(
382
+ "Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: " + typeOf(x) + ", index: 0)"
383
+ );
384
+ }
385
+ if (!isString(y)) {
386
+ throw new TypeError(
387
+ "Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: " + typeOf(y) + ", index: 1)"
388
+ );
389
+ }
390
+ return x === y ? 0 : x > y ? 1 : -1;
391
+ }
392
+
393
+ // src/array.ts
394
+ function arraySize(x) {
395
+ const s = [];
396
+ let current = x;
397
+ while (Array.isArray(current)) {
398
+ s.push(current.length);
399
+ current = current[0];
400
+ }
401
+ return s;
402
+ }
403
+ function _validate(array, size, dim) {
404
+ let i;
405
+ const len = array.length;
406
+ if (len !== size[dim]) {
407
+ throw new DimensionError(len, size[dim]);
408
+ }
409
+ if (dim < size.length - 1) {
410
+ const dimNext = dim + 1;
411
+ for (i = 0; i < len; i++) {
412
+ const child = array[i];
413
+ if (!Array.isArray(child)) {
414
+ throw new DimensionError(size.length - 1, size.length, "<");
415
+ }
416
+ _validate(array[i], size, dimNext);
417
+ }
418
+ } else {
419
+ for (i = 0; i < len; i++) {
420
+ if (Array.isArray(array[i])) {
421
+ throw new DimensionError(size.length + 1, size.length, ">");
422
+ }
423
+ }
424
+ }
425
+ }
426
+ function validate(array, size) {
427
+ const isScalar = size.length === 0;
428
+ if (isScalar) {
429
+ if (Array.isArray(array)) {
430
+ throw new DimensionError(array.length, 0);
431
+ }
432
+ } else {
433
+ _validate(array, size, 0);
434
+ }
435
+ }
436
+ function validateIndexSourceSize(value, index) {
437
+ const valueSize = value.isMatrix ? value._size : arraySize(value);
438
+ const sourceSize = index._sourceSize;
439
+ sourceSize.forEach((sourceDim, i) => {
440
+ if (sourceDim !== null && sourceDim !== valueSize[i]) {
441
+ throw new DimensionError(sourceDim, valueSize[i]);
442
+ }
443
+ });
444
+ }
445
+ function validateIndex(index, length) {
446
+ if (index !== void 0) {
447
+ if (!isNumber(index) || !isInteger(index)) {
448
+ throw new TypeError("Index must be an integer (value: " + index + ")");
449
+ }
450
+ if (index < 0 || typeof length === "number" && index >= length) {
451
+ throw new IndexError(index, length);
452
+ }
453
+ }
454
+ }
455
+ function isEmptyIndex(index) {
456
+ for (let i = 0; i < index._dimensions.length; ++i) {
457
+ const dimension = index._dimensions[i];
458
+ if (isString(dimension)) {
459
+ if (dimension.length === 0) {
460
+ return true;
461
+ }
462
+ } else {
463
+ const dim = dimension;
464
+ if (dim._data && isArray(dim._data)) {
465
+ if (dim._size[0] === 0) {
466
+ return true;
467
+ }
468
+ } else if (dim.isRange) {
469
+ if (dim.start === dim.end) {
470
+ return true;
471
+ }
472
+ }
473
+ }
474
+ }
475
+ return false;
476
+ }
477
+ function resize(array, size, defaultValue) {
478
+ if (!Array.isArray(size)) {
479
+ throw new TypeError("Array expected");
480
+ }
481
+ if (size.length === 0) {
482
+ throw new Error("Resizing to scalar is not supported");
483
+ }
484
+ size.forEach(function(value) {
485
+ if (!isNumber(value) || !isInteger(value) || value < 0) {
486
+ throw new TypeError(
487
+ "Invalid size, must contain positive integers (size: " + format3(size, {}) + ")"
488
+ );
489
+ }
490
+ });
491
+ let arr = array;
492
+ if (isNumber(array) || isBigNumber(array)) {
493
+ arr = [array];
494
+ }
495
+ const _defaultValue = defaultValue !== void 0 ? defaultValue : 0;
496
+ _resize(arr, size, 0, _defaultValue);
497
+ return arr;
498
+ }
499
+ function _resize(array, size, dim, defaultValue) {
500
+ let i;
501
+ let elem;
502
+ const oldLen = array.length;
503
+ const newLen = size[dim];
504
+ const minLen = Math.min(oldLen, newLen);
505
+ array.length = newLen;
506
+ if (dim < size.length - 1) {
507
+ const dimNext = dim + 1;
508
+ for (i = 0; i < minLen; i++) {
509
+ let current = array[i];
510
+ if (!Array.isArray(current)) {
511
+ current = [current];
512
+ array[i] = current;
513
+ }
514
+ _resize(current, size, dimNext, defaultValue);
515
+ }
516
+ for (i = minLen; i < newLen; i++) {
517
+ elem = [];
518
+ array[i] = elem;
519
+ _resize(elem, size, dimNext, defaultValue);
520
+ }
521
+ } else {
522
+ for (i = 0; i < minLen; i++) {
523
+ let value = array[i];
524
+ while (Array.isArray(value)) {
525
+ value = value[0];
526
+ }
527
+ array[i] = value;
528
+ }
529
+ for (i = minLen; i < newLen; i++) {
530
+ array[i] = defaultValue;
531
+ }
532
+ }
533
+ }
534
+ function reshape(array, sizes) {
535
+ const flatArray = flatten(array, true);
536
+ const currentLength = flatArray.length;
537
+ if (!Array.isArray(array) || !Array.isArray(sizes)) {
538
+ throw new TypeError("Array expected");
539
+ }
540
+ if (sizes.length === 0) {
541
+ throw new DimensionError(0, currentLength, "!=");
542
+ }
543
+ const processedSizes = processSizesWildcard(sizes, currentLength);
544
+ const newLength = product(processedSizes);
545
+ if (currentLength !== newLength) {
546
+ throw new DimensionError(newLength, currentLength, "!=");
547
+ }
548
+ try {
549
+ return _reshape(flatArray, processedSizes);
550
+ } catch (e) {
551
+ if (e instanceof DimensionError) {
552
+ throw new DimensionError(newLength, currentLength, "!=");
553
+ }
554
+ throw e;
555
+ }
556
+ }
557
+ function processSizesWildcard(sizes, currentLength) {
558
+ const newLength = product(sizes);
559
+ const processedSizes = sizes.slice();
560
+ const WILDCARD = -1;
561
+ const wildCardIndex = sizes.indexOf(WILDCARD);
562
+ const isMoreThanOneWildcard = sizes.indexOf(WILDCARD, wildCardIndex + 1) >= 0;
563
+ if (isMoreThanOneWildcard) {
564
+ throw new Error("More than one wildcard in sizes");
565
+ }
566
+ const hasWildcard = wildCardIndex >= 0;
567
+ const canReplaceWildcard = currentLength % newLength === 0;
568
+ if (hasWildcard) {
569
+ if (canReplaceWildcard) {
570
+ processedSizes[wildCardIndex] = -currentLength / newLength;
571
+ } else {
572
+ throw new Error(
573
+ "Could not replace wildcard, since " + currentLength + " is no multiple of " + -newLength
574
+ );
575
+ }
576
+ }
577
+ return processedSizes;
578
+ }
579
+ function product(array) {
580
+ return array.reduce((prev, curr) => prev * curr, 1);
581
+ }
582
+ function _reshape(array, sizes) {
583
+ let tmpArray = array;
584
+ let tmpArray2;
585
+ for (let sizeIndex = sizes.length - 1; sizeIndex > 0; sizeIndex--) {
586
+ const size = sizes[sizeIndex];
587
+ tmpArray2 = [];
588
+ const length = tmpArray.length / size;
589
+ for (let i = 0; i < length; i++) {
590
+ tmpArray2.push(tmpArray.slice(i * size, (i + 1) * size));
591
+ }
592
+ tmpArray = tmpArray2;
593
+ }
594
+ return tmpArray;
595
+ }
596
+ function squeeze(array, size) {
597
+ const s = size || arraySize(array);
598
+ let arr = array;
599
+ while (Array.isArray(arr) && arr.length === 1) {
600
+ arr = arr[0];
601
+ s.shift();
602
+ }
603
+ let dims = s.length;
604
+ while (s[dims - 1] === 1) {
605
+ dims--;
606
+ }
607
+ if (dims < s.length) {
608
+ arr = _squeeze(arr, dims, 0);
609
+ s.length = dims;
610
+ }
611
+ return arr;
612
+ }
613
+ function _squeeze(array, dims, dim) {
614
+ if (dim < dims) {
615
+ const next = dim + 1;
616
+ const arr = array;
617
+ for (let i = 0, ii = arr.length; i < ii; i++) {
618
+ arr[i] = _squeeze(arr[i], dims, next);
619
+ }
620
+ return arr;
621
+ } else {
622
+ let result = array;
623
+ while (Array.isArray(result)) {
624
+ result = result[0];
625
+ }
626
+ return result;
627
+ }
628
+ }
629
+ function unsqueeze(array, dims, outer, size) {
630
+ const s = size || arraySize(array);
631
+ let arr = array;
632
+ if (outer) {
633
+ for (let i = 0; i < outer; i++) {
634
+ arr = [arr];
635
+ s.unshift(1);
636
+ }
637
+ }
638
+ arr = _unsqueeze(arr, dims, 0);
639
+ while (s.length < dims) {
640
+ s.push(1);
641
+ }
642
+ return arr;
643
+ }
644
+ function _unsqueeze(array, dims, dim) {
645
+ if (Array.isArray(array)) {
646
+ const next = dim + 1;
647
+ const arr = array;
648
+ for (let i = 0, ii = arr.length; i < ii; i++) {
649
+ arr[i] = _unsqueeze(arr[i], dims, next);
650
+ }
651
+ return arr;
652
+ } else {
653
+ let result = array;
654
+ for (let d = dim; d < dims; d++) {
655
+ result = [result];
656
+ }
657
+ return result;
658
+ }
659
+ }
660
+ function flatten(array, isRectangular = false) {
661
+ if (!Array.isArray(array)) {
662
+ return array;
663
+ }
664
+ if (typeof isRectangular !== "boolean") {
665
+ throw new TypeError("Boolean expected for second argument of flatten");
666
+ }
667
+ const flat = [];
668
+ if (isRectangular) {
669
+ _flattenRectangular(array);
670
+ } else {
671
+ _flatten(array);
672
+ }
673
+ return flat;
674
+ function _flatten(arr) {
675
+ for (let i = 0; i < arr.length; i++) {
676
+ const item = arr[i];
677
+ if (Array.isArray(item)) {
678
+ _flatten(item);
679
+ } else {
680
+ flat.push(item);
681
+ }
682
+ }
683
+ }
684
+ function _flattenRectangular(arr) {
685
+ if (Array.isArray(arr[0])) {
686
+ for (let i = 0; i < arr.length; i++) {
687
+ _flattenRectangular(arr[i]);
688
+ }
689
+ } else {
690
+ for (let i = 0; i < arr.length; i++) {
691
+ flat.push(arr[i]);
692
+ }
693
+ }
694
+ }
695
+ }
696
+ function map(array, callback) {
697
+ return Array.prototype.map.call(array, callback);
698
+ }
699
+ function forEach(array, callback) {
700
+ Array.prototype.forEach.call(array, callback);
701
+ }
702
+ function filter(array, callback) {
703
+ if (arraySize(array).length !== 1) {
704
+ throw new Error("Only one dimensional matrices supported");
705
+ }
706
+ return Array.prototype.filter.call(array, callback);
707
+ }
708
+ function filterRegExp(array, regexp) {
709
+ if (arraySize(array).length !== 1) {
710
+ throw new Error("Only one dimensional matrices supported");
711
+ }
712
+ return Array.prototype.filter.call(array, (entry) => regexp.test(entry));
713
+ }
714
+ function join(array, separator) {
715
+ return Array.prototype.join.call(array, separator);
716
+ }
717
+ function identify(a) {
718
+ if (!Array.isArray(a)) {
719
+ throw new TypeError("Array input expected");
720
+ }
721
+ if (a.length === 0) {
722
+ return [];
723
+ }
724
+ const b = [];
725
+ let count = 0;
726
+ b[0] = { value: a[0], identifier: 0 };
727
+ for (let i = 1; i < a.length; i++) {
728
+ if (a[i] === a[i - 1]) {
729
+ count++;
730
+ } else {
731
+ count = 0;
732
+ }
733
+ b.push({ value: a[i], identifier: count });
734
+ }
735
+ return b;
736
+ }
737
+ function generalize(a) {
738
+ if (!Array.isArray(a)) {
739
+ throw new TypeError("Array input expected");
740
+ }
741
+ if (a.length === 0) {
742
+ return [];
743
+ }
744
+ const b = [];
745
+ for (let i = 0; i < a.length; i++) {
746
+ b.push(a[i].value);
747
+ }
748
+ return b;
749
+ }
750
+ function getArrayDataType(array, typeOf2) {
751
+ let type;
752
+ let length = 0;
753
+ for (let i = 0; i < array.length; i++) {
754
+ const item = array[i];
755
+ const isArray2 = Array.isArray(item);
756
+ if (i === 0 && isArray2) {
757
+ length = item.length;
758
+ }
759
+ if (isArray2 && item.length !== length) {
760
+ return void 0;
761
+ }
762
+ const itemType = isArray2 ? getArrayDataType(item, typeOf2) : typeOf2(item);
763
+ if (type === void 0) {
764
+ type = itemType;
765
+ } else if (type !== itemType) {
766
+ return "mixed";
767
+ } else {
768
+ }
769
+ }
770
+ return type;
771
+ }
772
+ function last(array) {
773
+ return array[array.length - 1];
774
+ }
775
+ function initial(array) {
776
+ return array.slice(0, array.length - 1);
777
+ }
778
+ function concatRecursive(a, b, concatDim, dim) {
779
+ if (dim < concatDim) {
780
+ if (a.length !== b.length) {
781
+ throw new DimensionError(a.length, b.length);
782
+ }
783
+ const c = [];
784
+ for (let i = 0; i < a.length; i++) {
785
+ c[i] = concatRecursive(
786
+ a[i],
787
+ b[i],
788
+ concatDim,
789
+ dim + 1
790
+ );
791
+ }
792
+ return c;
793
+ } else {
794
+ return a.concat(b);
795
+ }
796
+ }
797
+ function concat(...args) {
798
+ const arrays = Array.prototype.slice.call(args, 0, -1);
799
+ const concatDim = Array.prototype.slice.call(args, -1)[0];
800
+ if (arrays.length === 1) {
801
+ return arrays[0];
802
+ }
803
+ if (arrays.length > 1) {
804
+ return arrays.slice(1).reduce(function(A, B) {
805
+ return concatRecursive(A, B, concatDim, 0);
806
+ }, arrays[0]);
807
+ } else {
808
+ throw new Error("Wrong number of arguments in function concat");
809
+ }
810
+ }
811
+ function broadcastSizes(...sizes) {
812
+ const dimensions = sizes.map((s) => s.length);
813
+ const N = Math.max(...dimensions);
814
+ const sizeMax = new Array(N).fill(null);
815
+ for (let i = 0; i < sizes.length; i++) {
816
+ const size = sizes[i];
817
+ const dim = dimensions[i];
818
+ for (let j = 0; j < dim; j++) {
819
+ const n = N - dim + j;
820
+ if (size[j] > sizeMax[n]) {
821
+ sizeMax[n] = size[j];
822
+ }
823
+ }
824
+ }
825
+ for (let i = 0; i < sizes.length; i++) {
826
+ checkBroadcastingRules(sizes[i], sizeMax);
827
+ }
828
+ return sizeMax;
829
+ }
830
+ function checkBroadcastingRules(size, toSize) {
831
+ const N = toSize.length;
832
+ const dim = size.length;
833
+ for (let j = 0; j < dim; j++) {
834
+ const n = N - dim + j;
835
+ if (size[j] < toSize[n] && size[j] > 1 || size[j] > toSize[n]) {
836
+ throw new Error(
837
+ `shape mismatch: mismatch is found in arg with shape (${size}) not possible to broadcast dimension ${dim} with size ${size[j]} to size ${toSize[n]}`
838
+ );
839
+ }
840
+ }
841
+ }
842
+ function broadcastTo(array, toSize) {
843
+ let Asize = arraySize(array);
844
+ if (deepStrictEqual(Asize, toSize)) {
845
+ return array;
846
+ }
847
+ checkBroadcastingRules(Asize, toSize);
848
+ const broadcastedSize = broadcastSizes(Asize, toSize);
849
+ const N = broadcastedSize.length;
850
+ const paddedSize = [...Array(N - Asize.length).fill(1), ...Asize];
851
+ let A = clone2(array);
852
+ if (Asize.length < N) {
853
+ A = reshape(A, paddedSize);
854
+ Asize = arraySize(A);
855
+ }
856
+ for (let dim = 0; dim < N; dim++) {
857
+ if (Asize[dim] < broadcastedSize[dim]) {
858
+ A = stretch(A, broadcastedSize[dim], dim);
859
+ Asize = arraySize(A);
860
+ }
861
+ }
862
+ return A;
863
+ }
864
+ function broadcastArrays(...arrays) {
865
+ if (arrays.length === 0) {
866
+ throw new Error("Insufficient number of arguments in function broadcastArrays");
867
+ }
868
+ if (arrays.length === 1) {
869
+ return arrays[0];
870
+ }
871
+ const sizes = arrays.map(function(array) {
872
+ return arraySize(array);
873
+ });
874
+ const broadcastedSize = broadcastSizes(...sizes);
875
+ const broadcastedArrays = [];
876
+ arrays.forEach(function(array) {
877
+ broadcastedArrays.push(broadcastTo(array, broadcastedSize));
878
+ });
879
+ return broadcastedArrays;
880
+ }
881
+ function stretch(arrayToStretch, sizeToStretch, dimToStretch) {
882
+ return concat(...Array(sizeToStretch).fill(arrayToStretch), dimToStretch);
883
+ }
884
+ function get2(array, index) {
885
+ if (!Array.isArray(array)) {
886
+ throw new Error("Array expected");
887
+ }
888
+ const size = arraySize(array);
889
+ if (index.length !== size.length) {
890
+ throw new DimensionError(index.length, size.length);
891
+ }
892
+ for (let x = 0; x < index.length; x++) {
893
+ validateIndex(index[x], size[x]);
894
+ }
895
+ return index.reduce((acc, curr) => acc[curr], array);
896
+ }
897
+ function deepMap(array, callback, skipIndex = false) {
898
+ if (Array.isArray(array) && array.length === 0) {
899
+ return [];
900
+ }
901
+ if (skipIndex) {
902
+ return recursiveMap(array);
903
+ }
904
+ const index = [];
905
+ return recursiveMapWithIndex(array, 0);
906
+ function recursiveMapWithIndex(value, depth) {
907
+ if (Array.isArray(value)) {
908
+ const N = value.length;
909
+ const result = Array(N);
910
+ for (let i = 0; i < N; i++) {
911
+ index[depth] = i;
912
+ result[i] = recursiveMapWithIndex(value[i], depth + 1);
913
+ }
914
+ return result;
915
+ } else {
916
+ return callback(
917
+ value,
918
+ index.slice(0, depth),
919
+ array
920
+ );
921
+ }
922
+ }
923
+ function recursiveMap(value) {
924
+ if (Array.isArray(value)) {
925
+ const N = value.length;
926
+ const result = Array(N);
927
+ for (let i = 0; i < N; i++) {
928
+ result[i] = recursiveMap(value[i]);
929
+ }
930
+ return result;
931
+ } else {
932
+ return callback(value);
933
+ }
934
+ }
935
+ }
936
+ function deepForEach(array, callback, skipIndex = false) {
937
+ if (Array.isArray(array) && array.length === 0) {
938
+ return;
939
+ }
940
+ if (skipIndex) {
941
+ recursiveForEach(array);
942
+ return;
943
+ }
944
+ const index = [];
945
+ recursiveForEachWithIndex(array, 0);
946
+ function recursiveForEachWithIndex(value, depth) {
947
+ if (Array.isArray(value)) {
948
+ const N = value.length;
949
+ for (let i = 0; i < N; i++) {
950
+ index[depth] = i;
951
+ recursiveForEachWithIndex(value[i], depth + 1);
952
+ }
953
+ } else {
954
+ callback(
955
+ value,
956
+ index.slice(0, depth),
957
+ array
958
+ );
959
+ }
960
+ }
961
+ function recursiveForEach(value) {
962
+ if (Array.isArray(value)) {
963
+ const N = value.length;
964
+ for (let i = 0; i < N; i++) {
965
+ recursiveForEach(value[i]);
966
+ }
967
+ } else {
968
+ callback(value);
969
+ }
970
+ }
971
+ }
972
+ function clone2(array) {
973
+ return Object.assign([], array);
974
+ }
975
+
976
+ // src/switch.ts
977
+ function _switch(mat) {
978
+ const I = mat.length;
979
+ const J = mat[0].length;
980
+ let i, j;
981
+ const ret = [];
982
+ for (j = 0; j < J; j++) {
983
+ const tmp = [];
984
+ for (i = 0; i < I; i++) {
985
+ tmp.push(mat[i][j]);
986
+ }
987
+ ret.push(tmp);
988
+ }
989
+ return ret;
990
+ }
991
+
992
+ // src/collection.ts
993
+ function containsCollections(array) {
994
+ for (let i = 0; i < array.length; i++) {
995
+ if (isCollection(array[i])) {
996
+ return true;
997
+ }
998
+ }
999
+ return false;
1000
+ }
1001
+ function deepForEach2(array, callback) {
1002
+ if (isMatrix(array)) {
1003
+ array.forEach((x) => callback(x), false, true);
1004
+ } else {
1005
+ deepForEach(array, callback, true);
1006
+ }
1007
+ }
1008
+ function deepMap2(array, callback, skipZeros) {
1009
+ if (!skipZeros) {
1010
+ if (isMatrix(array)) {
1011
+ return array.map((x) => callback(x), false, true);
1012
+ } else {
1013
+ return deepMap(array, callback, true);
1014
+ }
1015
+ }
1016
+ const skipZerosCallback = (x) => x === 0 ? x : callback(x);
1017
+ if (isMatrix(array)) {
1018
+ return array.map((x) => skipZerosCallback(x), false, true);
1019
+ } else {
1020
+ return deepMap(array, skipZerosCallback, true);
1021
+ }
1022
+ }
1023
+ function reduce(mat, dim, callback) {
1024
+ const size = Array.isArray(mat) ? arraySize(mat) : mat.size();
1025
+ if (dim < 0 || dim >= size.length) {
1026
+ throw new IndexError(dim, 0, size.length);
1027
+ }
1028
+ if (isMatrix(mat)) {
1029
+ const reduced = _reduce(mat.valueOf(), dim, callback);
1030
+ return mat.create(
1031
+ reduced,
1032
+ mat.datatype()
1033
+ );
1034
+ } else {
1035
+ return _reduce(mat, dim, callback);
1036
+ }
1037
+ }
1038
+ function _reduce(mat, dim, callback) {
1039
+ let i;
1040
+ let ret;
1041
+ let val;
1042
+ let tran;
1043
+ if (dim <= 0) {
1044
+ if (!Array.isArray(mat[0])) {
1045
+ val = mat[0];
1046
+ for (i = 1; i < mat.length; i++) {
1047
+ val = callback(val, mat[i]);
1048
+ }
1049
+ return val;
1050
+ } else {
1051
+ tran = _switch(mat);
1052
+ ret = [];
1053
+ for (i = 0; i < tran.length; i++) {
1054
+ ret[i] = _reduce(tran[i], dim - 1, callback);
1055
+ }
1056
+ return ret;
1057
+ }
1058
+ } else {
1059
+ ret = [];
1060
+ for (i = 0; i < mat.length; i++) {
1061
+ ret[i] = _reduce(mat[i], dim - 1, callback);
1062
+ }
1063
+ return ret;
1064
+ }
1065
+ }
1066
+ function scatter(a, j, w, x, u, mark, cindex, f, inverse, update, value) {
1067
+ const avalues = a._values;
1068
+ const aindex = a._index;
1069
+ const aptr = a._ptr;
1070
+ let k;
1071
+ let k0;
1072
+ let k1;
1073
+ let i;
1074
+ if (x) {
1075
+ for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {
1076
+ i = aindex[k];
1077
+ if (w[i] !== mark) {
1078
+ w[i] = mark;
1079
+ cindex.push(i);
1080
+ if (update && f) {
1081
+ x[i] = inverse ? f(avalues[k], value) : f(value, avalues[k]);
1082
+ u[i] = mark;
1083
+ } else {
1084
+ x[i] = avalues[k];
1085
+ }
1086
+ } else {
1087
+ if (f) {
1088
+ x[i] = inverse ? f(avalues[k], x[i]) : f(x[i], avalues[k]);
1089
+ }
1090
+ u[i] = mark;
1091
+ }
1092
+ }
1093
+ } else {
1094
+ for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {
1095
+ i = aindex[k];
1096
+ if (w[i] !== mark) {
1097
+ w[i] = mark;
1098
+ cindex.push(i);
1099
+ } else {
1100
+ u[i] = mark;
1101
+ }
1102
+ }
1103
+ }
1104
+ }
1105
+
1106
+ // src/customs.ts
1107
+ function getSafeProperty(object, prop) {
1108
+ const obj = object;
1109
+ if (isSafeProperty(object, prop)) {
1110
+ return obj[prop];
1111
+ }
1112
+ if (typeof obj[prop] === "function" && isSafeMethod(object, prop)) {
1113
+ throw new Error('Cannot access method "' + prop + '" as a property');
1114
+ }
1115
+ throw new Error('No access to property "' + prop + '"');
1116
+ }
1117
+ function setSafeProperty(object, prop, value) {
1118
+ if (isSafeProperty(object, prop)) {
1119
+ object[prop] = value;
1120
+ return value;
1121
+ }
1122
+ throw new Error('No access to property "' + prop + '"');
1123
+ }
1124
+ function isSafeProperty(object, prop) {
1125
+ if (!isPlainObject(object) && !Array.isArray(object)) {
1126
+ return false;
1127
+ }
1128
+ if (hasOwnProperty(safeNativeProperties, prop)) {
1129
+ return true;
1130
+ }
1131
+ if (prop in Object.prototype) {
1132
+ return false;
1133
+ }
1134
+ if (prop in Function.prototype) {
1135
+ return false;
1136
+ }
1137
+ return true;
1138
+ }
1139
+ function isSafeMethod(object, method) {
1140
+ if (object === null || object === void 0 || typeof object[method] !== "function") {
1141
+ return false;
1142
+ }
1143
+ if (hasOwnProperty(object, method) && Object.getPrototypeOf && method in Object.getPrototypeOf(object)) {
1144
+ return false;
1145
+ }
1146
+ if (hasOwnProperty(safeNativeMethods, method)) {
1147
+ return true;
1148
+ }
1149
+ if (method in Object.prototype) {
1150
+ return false;
1151
+ }
1152
+ if (method in Function.prototype) {
1153
+ return false;
1154
+ }
1155
+ return true;
1156
+ }
1157
+ function isPlainObject(object) {
1158
+ return typeof object === "object" && !!object && object.constructor === Object;
1159
+ }
1160
+ var safeNativeProperties = {
1161
+ length: true,
1162
+ name: true
1163
+ };
1164
+ var safeNativeMethods = {
1165
+ toString: true,
1166
+ valueOf: true,
1167
+ toLocaleString: true
1168
+ };
1169
+
1170
+ // src/map.ts
1171
+ var ObjectWrappingMap = class {
1172
+ wrappedObject;
1173
+ [Symbol.toStringTag] = "ObjectWrappingMap";
1174
+ constructor(object) {
1175
+ this.wrappedObject = object;
1176
+ }
1177
+ /**
1178
+ * Declared as a real method rather than assigned in the constructor through a
1179
+ * cast. The old form satisfied the runtime but never appeared in the emitted
1180
+ * type, so `implements Map<K, V>` was a lie that only surfaced downstream:
1181
+ * consumers compiling with `skipLibCheck: false` got TS2420 ("incorrectly
1182
+ * implements interface 'Map'... '[Symbol.iterator]' is missing").
1183
+ */
1184
+ [Symbol.iterator]() {
1185
+ return this.entries();
1186
+ }
1187
+ // @ts-expect-error: Implementation is compatible but TS can't infer it
1188
+ keys() {
1189
+ return Object.keys(this.wrappedObject).filter((key) => this.has(key)).values();
1190
+ }
1191
+ get(key) {
1192
+ return getSafeProperty(this.wrappedObject, key);
1193
+ }
1194
+ set(key, value) {
1195
+ setSafeProperty(this.wrappedObject, key, value);
1196
+ return this;
1197
+ }
1198
+ has(key) {
1199
+ return isSafeProperty(this.wrappedObject, key) && key in this.wrappedObject;
1200
+ }
1201
+ // @ts-expect-error: Implementation is compatible but TS can't infer it
1202
+ entries() {
1203
+ return mapIterator(this.keys(), (key) => [key, this.get(key)]);
1204
+ }
1205
+ // @ts-expect-error: Implementation is compatible but TS can't infer it
1206
+ *values() {
1207
+ for (const key of this.keys()) {
1208
+ yield this.get(key);
1209
+ }
1210
+ }
1211
+ forEach(callback) {
1212
+ for (const key of this.keys()) {
1213
+ callback(this.get(key), key, this);
1214
+ }
1215
+ }
1216
+ delete(key) {
1217
+ if (isSafeProperty(this.wrappedObject, key)) {
1218
+ delete this.wrappedObject[key];
1219
+ return true;
1220
+ }
1221
+ return false;
1222
+ }
1223
+ clear() {
1224
+ for (const key of this.keys()) {
1225
+ this.delete(key);
1226
+ }
1227
+ }
1228
+ get size() {
1229
+ return Object.keys(this.wrappedObject).length;
1230
+ }
1231
+ };
1232
+ var PartitionedMap = class {
1233
+ a;
1234
+ b;
1235
+ bKeys;
1236
+ [Symbol.toStringTag] = "PartitionedMap";
1237
+ /**
1238
+ * @param a - Primary map
1239
+ * @param b - Secondary map
1240
+ * @param bKeys - Set of keys that should be read/written to map b
1241
+ */
1242
+ constructor(a, b, bKeys) {
1243
+ this.a = a;
1244
+ this.b = b;
1245
+ this.bKeys = bKeys;
1246
+ }
1247
+ /** See the note on `ObjectWrappingMap[Symbol.iterator]` — same fix. */
1248
+ [Symbol.iterator]() {
1249
+ return this.entries();
1250
+ }
1251
+ get(key) {
1252
+ return this.bKeys.has(key) ? this.b.get(key) : this.a.get(key);
1253
+ }
1254
+ set(key, value) {
1255
+ if (this.bKeys.has(key)) {
1256
+ this.b.set(key, value);
1257
+ } else {
1258
+ this.a.set(key, value);
1259
+ }
1260
+ return this;
1261
+ }
1262
+ has(key) {
1263
+ return this.b.has(key) || this.a.has(key);
1264
+ }
1265
+ // @ts-expect-error: Implementation is compatible but TS can't infer it
1266
+ keys() {
1267
+ return (/* @__PURE__ */ new Set([...this.a.keys(), ...this.b.keys()]))[Symbol.iterator]();
1268
+ }
1269
+ // @ts-expect-error: Implementation is compatible but TS can't infer it
1270
+ *values() {
1271
+ for (const key of this.keys()) {
1272
+ yield this.get(key);
1273
+ }
1274
+ }
1275
+ // @ts-expect-error: Implementation is compatible but TS can't infer it
1276
+ entries() {
1277
+ return mapIterator(this.keys(), (key) => [key, this.get(key)]);
1278
+ }
1279
+ forEach(callback) {
1280
+ for (const key of this.keys()) {
1281
+ callback(this.get(key), key, this);
1282
+ }
1283
+ }
1284
+ delete(key) {
1285
+ return this.bKeys.has(key) ? this.b.delete(key) : this.a.delete(key);
1286
+ }
1287
+ clear() {
1288
+ this.a.clear();
1289
+ this.b.clear();
1290
+ }
1291
+ get size() {
1292
+ return [...this.keys()].length;
1293
+ }
1294
+ };
1295
+ function mapIterator(it, callback) {
1296
+ return {
1297
+ next: () => {
1298
+ const n = it.next();
1299
+ return n.done ? n : {
1300
+ value: callback(n.value),
1301
+ done: false
1302
+ };
1303
+ }
1304
+ };
1305
+ }
1306
+ function createEmptyMap() {
1307
+ return /* @__PURE__ */ new Map();
1308
+ }
1309
+ function createMap(mapOrObject) {
1310
+ if (!mapOrObject) {
1311
+ return createEmptyMap();
1312
+ }
1313
+ if (isMap(mapOrObject)) {
1314
+ return mapOrObject;
1315
+ }
1316
+ if (isObject(mapOrObject)) {
1317
+ return new ObjectWrappingMap(mapOrObject);
1318
+ }
1319
+ throw new Error("createMap can create maps from objects or Maps");
1320
+ }
1321
+ function toObject(map2) {
1322
+ if (map2 instanceof ObjectWrappingMap) {
1323
+ return map2.wrappedObject;
1324
+ }
1325
+ const object = {};
1326
+ for (const key of map2.keys()) {
1327
+ const value = map2.get(key);
1328
+ setSafeProperty(object, key, value);
1329
+ }
1330
+ return object;
1331
+ }
1332
+ function assign(map2, ...objects) {
1333
+ for (const args of objects) {
1334
+ if (!args) {
1335
+ continue;
1336
+ }
1337
+ if (isMap(args)) {
1338
+ for (const key of args.keys()) {
1339
+ map2.set(key, args.get(key));
1340
+ }
1341
+ } else if (isObject(args)) {
1342
+ for (const key of Object.keys(args)) {
1343
+ map2.set(key, args[key]);
1344
+ }
1345
+ }
1346
+ }
1347
+ return map2;
1348
+ }
1349
+ function isObjectWrappingMap(object) {
1350
+ if (!isMap(object)) return false;
1351
+ const wrapper = object;
1352
+ return isObject(wrapper.wrappedObject);
1353
+ }
73
1354
  export {
74
1355
  Unit as CoreUnit,
1356
+ DimensionError,
1357
+ IndexError,
1358
+ MathjsError,
1359
+ ObjectWrappingMap,
1360
+ PartitionedMap,
75
1361
  acosh,
1362
+ arraySize,
76
1363
  asinh,
1364
+ assertDependencies,
1365
+ assign as assignMap,
77
1366
  atanh,
1367
+ broadcastArrays,
1368
+ broadcastSizes,
1369
+ broadcastTo,
78
1370
  canDefineProperty,
79
1371
  cbrt,
1372
+ checkBroadcastingRules,
80
1373
  clone,
1374
+ clone2 as cloneArray,
1375
+ compareText,
1376
+ concat,
1377
+ containsCollections,
81
1378
  copysign,
82
1379
  cosh,
1380
+ create,
1381
+ createEmptyMap,
1382
+ createIndexError,
1383
+ createMap,
83
1384
  createUnitClass,
84
1385
  deepExtend,
85
1386
  deepFlatten,
1387
+ deepForEach2 as deepForEach,
1388
+ deepForEach as deepForEachArray,
1389
+ deepMap2 as deepMap,
1390
+ deepMap as deepMapArray,
86
1391
  deepStrictEqual,
87
1392
  digits,
88
1393
  endsWith,
1394
+ escape,
89
1395
  expm1,
90
1396
  extend,
1397
+ factory,
1398
+ filter,
1399
+ filterRegExp,
1400
+ flatten,
1401
+ forEach,
91
1402
  format,
1403
+ format2 as formatBigNumber,
1404
+ format3 as formatGeneric,
1405
+ generalize,
92
1406
  get,
1407
+ getArrayDataType,
1408
+ get2 as getArrayElement,
93
1409
  hasOwnProperty,
1410
+ identify,
1411
+ initial,
94
1412
  isArray,
95
1413
  isBigInt,
96
1414
  isBigNumber,
@@ -99,6 +1417,8 @@ export {
99
1417
  isComplex,
100
1418
  isDate,
101
1419
  isDenseMatrix,
1420
+ isEmptyIndex,
1421
+ isFactory,
102
1422
  isFraction,
103
1423
  isFunction,
104
1424
  isIndex,
@@ -109,6 +1429,8 @@ export {
109
1429
  isNull,
110
1430
  isNumber,
111
1431
  isObject,
1432
+ isObjectWrappingMap,
1433
+ isOptionalDependency,
112
1434
  isPowZeroAtInfinity,
113
1435
  isRange,
114
1436
  isRegExp,
@@ -116,29 +1438,50 @@ export {
116
1438
  isString,
117
1439
  isUndefined,
118
1440
  isUnit,
1441
+ join,
1442
+ last,
119
1443
  lazy,
120
1444
  log10,
121
1445
  log1p,
122
1446
  log2,
1447
+ map,
123
1448
  mapObject,
124
1449
  memoize,
125
1450
  nearlyEqual,
126
1451
  normalizeFormatOptions,
127
1452
  pick,
128
1453
  pickShallow,
1454
+ processSizesWildcard,
1455
+ reduce,
1456
+ reshape,
1457
+ resize,
129
1458
  roundDigits,
130
1459
  safeNumberType,
1460
+ scatter,
131
1461
  set,
132
1462
  sign,
133
1463
  sinh,
1464
+ sortFactories,
134
1465
  splitNumber,
1466
+ squeeze,
1467
+ stretch,
1468
+ stringify,
1469
+ stripOptionalNotation,
135
1470
  tanh,
136
1471
  toEngineering,
1472
+ toEngineering2 as toEngineeringBigNumber,
137
1473
  toExponential,
1474
+ toExponential2 as toExponentialBigNumber,
138
1475
  toFixed,
1476
+ toFixed2 as toFixedBigNumber,
1477
+ toObject,
139
1478
  toPrecision,
140
1479
  traverse,
141
1480
  typeOf,
142
1481
  unitDependencies,
1482
+ unsqueeze,
1483
+ validate,
1484
+ validateIndex,
1485
+ validateIndexSourceSize,
143
1486
  warnOnce
144
1487
  };