simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

configReadonly.js (728B)


      1 import _extends from "@babel/runtime/helpers/extends";
      2 import { DEFAULT_CONFIG } from '../core/config.js';
      3 import { MATRIX_OPTIONS, NUMBER_OPTIONS } from '../core/function/config.js'; // create a read-only version of config
      4 
      5 export var config = /* #__PURE__ */function config(options) {
      6   if (options) {
      7     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');
      8   }
      9 
     10   return Object.freeze(DEFAULT_CONFIG);
     11 };
     12 
     13 _extends(config, DEFAULT_CONFIG, {
     14   MATRIX_OPTIONS,
     15   NUMBER_OPTIONS
     16 });