Socket
Socket
Sign inDemoInstall

mathjs

Package Overview
Dependencies
10
Maintainers
1
Versions
272
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 11.9.0 to 11.9.1

4

lib/browser/math.js.LICENSE.txt

@@ -26,4 +26,4 @@ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

*
* @version 11.9.0
* @date 2023-07-19
* @version 11.9.1
* @date 2023-07-24
*

@@ -30,0 +30,0 @@ * @license

@@ -240,3 +240,3 @@ "use strict";

return function evalFunctionNode(scope, args, context) {
var fn = args[_name];
var fn = (0, _customs.getSafeProperty)(args, _name);
if (typeof fn !== 'function') {

@@ -265,7 +265,6 @@ throw new TypeError("Argument '".concat(_name, "' was not a function; received: ").concat(strin(fn)));

var object = evalObject(scope, args, context);
(0, _customs.validateSafeMethod)(object, prop);
var isRaw = object[prop] && object[prop].rawArgs;
if (isRaw) {
var fn = (0, _customs.getSafeMethod)(object, prop);
if (fn !== null && fn !== void 0 && fn.rawArgs) {
// "Raw" evaluation
return object[prop](_rawArgs2, math, (0, _scope.createSubScope)(scope, args), scope);
return fn(_rawArgs2, math, (0, _scope.createSubScope)(scope, args), scope);
} else {

@@ -276,3 +275,3 @@ // "regular" evaluation

});
return object[prop].apply(object, values);
return fn.apply(object, values);
}

@@ -279,0 +278,0 @@ };

@@ -15,7 +15,7 @@ "use strict";

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _customs = require("../../utils/customs.js");
var _factory = require("../../utils/factory.js");
var _is = require("../../utils/is.js");
var _object = require("../../utils/object.js");
var _string = require("../../utils/string.js");
var _customs = require("../../utils/customs.js");
var _object = require("../../utils/object.js");
var _factory = require("../../utils/factory.js");
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }

@@ -86,6 +86,4 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

var parsedKey = JSON.parse(stringifiedKey);
if (!(0, _customs.isSafeProperty)(this.properties, parsedKey)) {
throw new Error('No access to property "' + parsedKey + '"');
}
evalEntries[parsedKey] = this.properties[key]._compile(math, argNames);
var prop = (0, _customs.getSafeProperty)(this.properties, key);
evalEntries[parsedKey] = prop._compile(math, argNames);
}

@@ -92,0 +90,0 @@ }

@@ -87,3 +87,3 @@ "use strict";

return function (scope, args, context) {
return args[name];
return (0, _customs.getSafeProperty)(args, name);
};

@@ -90,0 +90,0 @@ } else if (name in math) {

@@ -9,4 +9,4 @@ /**

*
* @version 11.9.0
* @date 2023-07-19
* @version 11.9.1
* @date 2023-07-24
*

@@ -13,0 +13,0 @@ * @license

@@ -7,2 +7,3 @@ "use strict";

});
exports.getSafeMethod = getSafeMethod;
exports.getSafeProperties = getSafeProperties;

@@ -15,3 +16,2 @@ exports.getSafeProperty = getSafeProperty;

exports.setSafeProperty = setSafeProperty;
exports.validateSafeMethod = validateSafeMethod;
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));

@@ -104,8 +104,9 @@ var _object = require("./object.js");

* @param {string} method
* @return {function} Returns the method when valid
*/
// TODO: merge this function into assign.js?
function validateSafeMethod(object, method) {
function getSafeMethod(object, method) {
if (!isSafeMethod(object, method)) {
throw new Error('No access to method "' + method + '"');
}
return object[method];
}

@@ -112,0 +113,0 @@

@@ -7,5 +7,5 @@ "use strict";

exports.version = void 0;
var version = '11.9.0';
var version = '11.9.1';
// Note: This file is automatically generated when building math.js.
// Changes made in this file will be overwritten.
exports.version = version;

@@ -5,3 +5,3 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";

import { hasOwnProperty } from '../../utils/object.js';
import { getSafeProperty, validateSafeMethod } from '../../utils/customs.js';
import { getSafeProperty, getSafeMethod } from '../../utils/customs.js';
import { createSubScope } from '../../utils/scope.js';

@@ -207,3 +207,3 @@ import { factory } from '../../utils/factory.js';

return function evalFunctionNode(scope, args, context) {
var fn = args[_name];
var fn = getSafeProperty(args, _name);
if (typeof fn !== 'function') {

@@ -230,11 +230,10 @@ throw new TypeError("Argument '".concat(_name, "' was not a function; received: ").concat(strin(fn)));

var object = evalObject(scope, args, context);
validateSafeMethod(object, prop);
var isRaw = object[prop] && object[prop].rawArgs;
if (isRaw) {
var fn = getSafeMethod(object, prop);
if (fn !== null && fn !== void 0 && fn.rawArgs) {
// "Raw" evaluation
return object[prop](_rawArgs2, math, createSubScope(scope, args), scope);
return fn(_rawArgs2, math, createSubScope(scope, args), scope);
} else {
// "regular" evaluation
var values = evalArgs.map(evalArg => evalArg(scope, args, context));
return object[prop].apply(object, values);
return fn.apply(object, values);
}

@@ -241,0 +240,0 @@ };

import _defineProperty from "@babel/runtime/helpers/defineProperty";
import { getSafeProperty } from '../../utils/customs.js';
import { factory } from '../../utils/factory.js';
import { isNode } from '../../utils/is.js';
import { hasOwnProperty } from '../../utils/object.js';
import { escape, stringify } from '../../utils/string.js';
import { isSafeProperty } from '../../utils/customs.js';
import { hasOwnProperty } from '../../utils/object.js';
import { factory } from '../../utils/factory.js';
var name = 'ObjectNode';

@@ -61,6 +61,4 @@ var dependencies = ['Node'];

var parsedKey = JSON.parse(stringifiedKey);
if (!isSafeProperty(this.properties, parsedKey)) {
throw new Error('No access to property "' + parsedKey + '"');
}
evalEntries[parsedKey] = this.properties[key]._compile(math, argNames);
var prop = getSafeProperty(this.properties, key);
evalEntries[parsedKey] = prop._compile(math, argNames);
}

@@ -67,0 +65,0 @@ }

@@ -64,3 +64,3 @@ import { escape } from '../../utils/string.js';

return function (scope, args, context) {
return args[name];
return getSafeProperty(args, name);
};

@@ -67,0 +67,0 @@ } else if (name in math) {

@@ -86,8 +86,9 @@ import { hasOwnProperty } from './object.js';

* @param {string} method
* @return {function} Returns the method when valid
*/
// TODO: merge this function into assign.js?
function validateSafeMethod(object, method) {
function getSafeMethod(object, method) {
if (!isSafeMethod(object, method)) {
throw new Error('No access to method "' + method + '"');
}
return object[method];
}

@@ -152,4 +153,4 @@

export { getSafeProperties };
export { validateSafeMethod };
export { getSafeMethod };
export { isSafeMethod };
export { isPlainObject };

@@ -1,3 +0,3 @@

export var version = '11.9.0';
export var version = '11.9.1';
// Note: This file is automatically generated when building math.js.
// Changes made in this file will be overwritten.
{
"name": "mathjs",
"version": "11.9.0",
"version": "11.9.1",
"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.",

@@ -28,3 +28,3 @@ "author": "Jos de Jong <wjosdejong@gmail.com> (https://github.com/josdejong)",

"dependencies": {
"@babel/runtime": "^7.22.5",
"@babel/runtime": "^7.22.6",
"complex.js": "^2.1.1",

@@ -40,20 +40,20 @@ "decimal.js": "^10.4.3",

"devDependencies": {
"@babel/core": "7.22.5",
"@babel/core": "7.22.9",
"@babel/plugin-transform-object-assign": "7.22.5",
"@babel/plugin-transform-runtime": "7.22.5",
"@babel/preset-env": "7.22.5",
"@babel/plugin-transform-runtime": "7.22.9",
"@babel/preset-env": "7.22.9",
"@babel/register": "7.22.5",
"@types/assert": "1.5.6",
"@types/mocha": "10.0.1",
"@typescript-eslint/eslint-plugin": "5.60.0",
"@typescript-eslint/parser": "5.60.0",
"@typescript-eslint/eslint-plugin": "6.1.0",
"@typescript-eslint/parser": "6.1.0",
"assert": "2.0.0",
"babel-loader": "9.1.2",
"babel-loader": "9.1.3",
"benchmark": "2.1.4",
"c8": "8.0.0",
"codecov": "3.8.3",
"core-js": "3.31.0",
"core-js": "3.31.1",
"del": "6.1.1",
"dtslint": "4.2.1",
"eslint": "8.43.0",
"eslint": "8.45.0",
"eslint-config-prettier": "8.8.0",

@@ -63,3 +63,3 @@ "eslint-config-standard": "17.1.0",

"eslint-plugin-mocha": "10.1.0",
"eslint-plugin-n": "16.0.0",
"eslint-plugin-n": "16.0.1",
"eslint-plugin-prettier": "4.2.1",

@@ -81,5 +81,5 @@ "eslint-plugin-promise": "6.1.1",

"karma-webpack": "5.0.0",
"mkdirp": "2.1.6",
"mkdirp": "3.0.1",
"mocha": "10.2.0",
"mocha-junit-reporter": "2.2.0",
"mocha-junit-reporter": "2.2.1",
"ndarray": "1.0.19",

@@ -96,4 +96,4 @@ "ndarray-determinant": "1.0.0",

"ts-node": "10.9.1",
"typescript": "5.1.3",
"webpack": "5.87.0",
"typescript": "5.1.6",
"webpack": "5.88.2",
"zeros": "1.0.0"

@@ -100,0 +100,0 @@ },

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc