@teachinglab/omd 0.6.3 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -77,4 +77,4 @@ export default {
77
77
  const { omdDisplay } = await import('./omd/core/index.js');
78
78
  return new omdDisplay(container);
79
79
  }
80
- };
80
+ };
@@ -0,0 +1,19 @@
1
+ import * as mathjs from 'mathjs';
2
+
3
+ const globalScope = (() => {
4
+ if (typeof globalThis !== 'undefined') return globalThis;
5
+ if (typeof window !== 'undefined') return window;
6
+ if (typeof global !== 'undefined') return global;
7
+ return undefined;
8
+ })();
9
+
10
+ if (globalScope && !globalScope.math) {
11
+ try {
12
+ globalScope.math = mathjs;
13
+ } catch (_) {
14
+ // Silently ignore if the global object is not writable.
15
+ }
16
+ }
17
+
18
+ export const math = mathjs;
19
+ export default mathjs;
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@teachinglab/omd",
3
- "version": "0.6.3",
3
+ "version": "0.6.6",
4
4
  "description": "omd",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
7
7
  "type": "module",
8
8
  "exports": {
9
9
  ".": "./index.js",
10
+ "./register-math": "./omd/utils/registerMathGlobal.js",
10
11
  "./package.json": "./package.json"
11
12
  },
12
13
  "files": [
@@ -56,4 +57,3 @@
56
57
  "vite": "^5.4.0"
57
58
  }
58
59
  }
59
-