@codehz/draw-call 0.4.2 → 0.4.3
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/browser/index.cjs +2 -2
- package/browser/index.js +2 -2
- package/package.json +1 -1
package/browser/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
//#region src/compat/index.ts
|
|
3
|
-
const DOMMatrix = window.DOMMatrix;
|
|
4
|
-
const Path2D = window.Path2D;
|
|
3
|
+
const DOMMatrix = typeof window !== "undefined" ? window.DOMMatrix : void 0;
|
|
4
|
+
const Path2D = typeof window !== "undefined" ? window.Path2D : void 0;
|
|
5
5
|
function createRawCanvas(width, height) {
|
|
6
6
|
const canvas = document.createElement("canvas");
|
|
7
7
|
canvas.width = width;
|
package/browser/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/compat/index.ts
|
|
2
|
-
const DOMMatrix = window.DOMMatrix;
|
|
3
|
-
const Path2D = window.Path2D;
|
|
2
|
+
const DOMMatrix = typeof window !== "undefined" ? window.DOMMatrix : void 0;
|
|
3
|
+
const Path2D = typeof window !== "undefined" ? window.Path2D : void 0;
|
|
4
4
|
function createRawCanvas(width, height) {
|
|
5
5
|
const canvas = document.createElement("canvas");
|
|
6
6
|
canvas.width = width;
|