UNPKG

992 BJavaScriptView Raw
1function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
3import { DEFAULT_CONFIG } from '../core/config.js';
4import { MATRIX_OPTIONS, NUMBER_OPTIONS } from '../core/function/config.js'; // create a read-only version of config
5
6export var config = /* #__PURE__ */function config(options) {
7 if (options) {
8 throw new Error('The global config is readonly. \n' + 'Please create a mathjs instance if you want to change the default configuration. \n' + 'Example:\n' + '\n' + ' import { create, all } from \'mathjs\';\n' + ' const mathjs = create(all);\n' + ' mathjs.config({ number: \'BigNumber\' });\n');
9 }
10
11 return Object.freeze(DEFAULT_CONFIG);
12};
13
14_extends(config, DEFAULT_CONFIG, {
15 MATRIX_OPTIONS,
16 NUMBER_OPTIONS
17});
\No newline at end of file