x_ite-node 2.0.24 → 2.0.26

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.
Files changed (2) hide show
  1. package/package.json +2 -1
  2. package/src/index.js +17 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x_ite-node",
3
- "version": "2.0.24",
3
+ "version": "2.0.26",
4
4
  "description": "Pure Node.js Wrapper of X_ITE",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -52,6 +52,7 @@
52
52
  ],
53
53
  "dependencies": {
54
54
  "atob": "^2.1.2",
55
+ "canvas": "^3.2.3",
55
56
  "filereader": "^0.10.3",
56
57
  "jsdom": "27.0.0",
57
58
  "jsdom-global": "^3.0.2",
package/src/index.js CHANGED
@@ -2,9 +2,12 @@
2
2
 
3
3
  // Restore it later.
4
4
  const BlobClass = Blob;
5
+ const URLClass = URL;
5
6
 
6
7
  require ("jsdom-global") ();
7
8
 
9
+ const { Image } = require ("canvas");
10
+
8
11
  // Preparations
9
12
 
10
13
  const
@@ -86,6 +89,12 @@ Object .defineProperties (window,
86
89
  configurable: true,
87
90
  writable: true,
88
91
  },
92
+ Image:
93
+ {
94
+ value: Image,
95
+ configurable: true,
96
+ writable: true,
97
+ },
89
98
  MutationObserver:
90
99
  {
91
100
  value: class
@@ -106,6 +115,12 @@ Object .defineProperties (window,
106
115
  configurable: true,
107
116
  writable: true,
108
117
  },
118
+ URL:
119
+ {
120
+ value: URLClass,
121
+ configurable: true,
122
+ writable: true,
123
+ },
109
124
  atob:
110
125
  {
111
126
  value: require ("atob"),
@@ -239,8 +254,10 @@ Object .defineProperties (global,
239
254
  "Blob",
240
255
  "FileReader",
241
256
  "FontFace",
257
+ "Image",
242
258
  "MutationObserver",
243
259
  "ResizeObserver",
260
+ "URL",
244
261
  ]
245
262
  .map (name => [name,
246
263
  {
@@ -393,22 +410,6 @@ HTMLCanvasElement .prototype .getContext = function (contextType, ... args)
393
410
  }
394
411
  };
395
412
 
396
- Object .defineProperties (URL,
397
- {
398
- createObjectURL:
399
- {
400
- value: blob => "",
401
- configurable: true,
402
- writable: true,
403
- },
404
- revokeObjectURL:
405
- {
406
- value: Function .prototype,
407
- configurable: true,
408
- writable: true,
409
- },
410
- });
411
-
412
413
  // X_ITE
413
414
 
414
415
  const