UNPKG

1.15 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.config = void 0;
7
8var _config = require("../core/config.js");
9
10var _config2 = require("../core/function/config.js");
11
12function _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); }
13
14// create a read-only version of config
15var config = /* #__PURE__ */function config(options) {
16 if (options) {
17 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');
18 }
19
20 return Object.freeze(_config.DEFAULT_CONFIG);
21};
22
23exports.config = config;
24
25_extends(config, _config.DEFAULT_CONFIG, {
26 MATRIX_OPTIONS: _config2.MATRIX_OPTIONS,
27 NUMBER_OPTIONS: _config2.NUMBER_OPTIONS
28});
\No newline at end of file