mathjs 14.3.0 → 14.3.1

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.
@@ -75,7 +75,7 @@ function importFactory(typed, load, math, importedFactories) {
75
75
  function flattenImports(flatValues, value, name) {
76
76
  if (Array.isArray(value)) {
77
77
  value.forEach(item => flattenImports(flatValues, item));
78
- } else if (typeof value === 'object') {
78
+ } else if ((0, _is.isObject)(value) || isModule(value)) {
79
79
  for (const name in value) {
80
80
  if ((0, _object.hasOwnProperty)(value, name)) {
81
81
  flattenImports(flatValues, value[name], name);
@@ -316,6 +316,9 @@ function importFactory(typed, load, math, importedFactories) {
316
316
  function isSupportedType(object) {
317
317
  return typeof object === 'function' || typeof object === 'number' || typeof object === 'string' || typeof object === 'boolean' || object === null || (0, _is.isUnit)(object) || (0, _is.isComplex)(object) || (0, _is.isBigNumber)(object) || (0, _is.isFraction)(object) || (0, _is.isMatrix)(object) || Array.isArray(object);
318
318
  }
319
+ function isModule(object) {
320
+ return typeof object === 'object' && object[Symbol.toStringTag] === 'Module';
321
+ }
319
322
  function hasTypedFunctionSignature(fn) {
320
323
  return typeof fn === 'function' && typeof fn.signature === 'string';
321
324
  }
package/lib/cjs/header.js CHANGED
@@ -6,8 +6,8 @@
6
6
  * It features real and complex numbers, units, matrices, a large set of
7
7
  * mathematical functions, and a flexible expression parser.
8
8
  *
9
- * @version 14.3.0
10
- * @date 2025-02-28
9
+ * @version 14.3.1
10
+ * @date 2025-03-06
11
11
  *
12
12
  * @license
13
13
  * Copyright (C) 2013-2025 Jos de Jong <wjosdejong@gmail.com>
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = void 0;
7
- const version = exports.version = '14.3.0';
7
+ const version = exports.version = '14.3.1';
8
8
  // Note: This file is automatically generated when building math.js.
9
9
  // Changes made in this file will be overwritten.
@@ -1,4 +1,4 @@
1
- import { isBigNumber, isComplex, isFraction, isMatrix, isUnit } from '../../utils/is.js';
1
+ import { isBigNumber, isComplex, isFraction, isMatrix, isObject, isUnit } from '../../utils/is.js';
2
2
  import { isFactory, stripOptionalNotation } from '../../utils/factory.js';
3
3
  import { hasOwnProperty, lazy } from '../../utils/object.js';
4
4
  import { ArgumentsError } from '../../error/ArgumentsError.js';
@@ -69,7 +69,7 @@ export function importFactory(typed, load, math, importedFactories) {
69
69
  function flattenImports(flatValues, value, name) {
70
70
  if (Array.isArray(value)) {
71
71
  value.forEach(item => flattenImports(flatValues, item));
72
- } else if (typeof value === 'object') {
72
+ } else if (isObject(value) || isModule(value)) {
73
73
  for (var _name in value) {
74
74
  if (hasOwnProperty(value, _name)) {
75
75
  flattenImports(flatValues, value[_name], _name);
@@ -310,6 +310,9 @@ export function importFactory(typed, load, math, importedFactories) {
310
310
  function isSupportedType(object) {
311
311
  return typeof object === 'function' || typeof object === 'number' || typeof object === 'string' || typeof object === 'boolean' || object === null || isUnit(object) || isComplex(object) || isBigNumber(object) || isFraction(object) || isMatrix(object) || Array.isArray(object);
312
312
  }
313
+ function isModule(object) {
314
+ return typeof object === 'object' && object[Symbol.toStringTag] === 'Module';
315
+ }
313
316
  function hasTypedFunctionSignature(fn) {
314
317
  return typeof fn === 'function' && typeof fn.signature === 'string';
315
318
  }
@@ -1,3 +1,3 @@
1
- export var version = '14.3.0';
1
+ export var version = '14.3.1';
2
2
  // Note: This file is automatically generated when building math.js.
3
3
  // Changes made in this file will be overwritten.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mathjs",
3
- "version": "14.3.0",
3
+ "version": "14.3.1",
4
4
  "description": "Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices.",
5
5
  "author": "Jos de Jong <wjosdejong@gmail.com> (https://github.com/josdejong)",
6
6
  "homepage": "https://mathjs.org",