1 | import { DEFAULT_CONFIG } from '../core/config'
|
2 | import { MATRIX_OPTIONS, NUMBER_OPTIONS } from '../core/function/config'
|
3 |
|
4 |
|
5 | export const config = function (options) {
|
6 | if (options) {
|
7 | throw new Error('The global config is readonly. \n' +
|
8 | 'Please create a mathjs instance if you want to change the default configuration. \n' +
|
9 | 'Example:\n' +
|
10 | '\n' +
|
11 | ' import { create, all } from \'mathjs\';\n' +
|
12 | ' const mathjs = create(all);\n' +
|
13 | ' mathjs.config({ number: \'BigNumber\' });\n')
|
14 | }
|
15 |
|
16 | return Object.freeze(DEFAULT_CONFIG)
|
17 | }
|
18 | Object.assign(config, DEFAULT_CONFIG, { MATRIX_OPTIONS, NUMBER_OPTIONS })
|