@woosh/meep-engine 2.33.9 → 2.33.13
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.
|
@@ -52,17 +52,36 @@ WorkerBuilder.prototype.importScript = function (path) {
|
|
|
52
52
|
this.imports.push(path);
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* @param {string} code
|
|
58
|
+
* @return {string}
|
|
59
|
+
*/
|
|
55
60
|
function codeToURL(code) {
|
|
61
|
+
const js_mime = 'application/javascript';
|
|
62
|
+
|
|
56
63
|
let blob;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
|
|
65
|
+
if (window !== undefined) {
|
|
66
|
+
if (window.Blob !== undefined) {
|
|
67
|
+
blob = new Blob([code], { type: js_mime });
|
|
68
|
+
} else {
|
|
69
|
+
// Backwards-compatibility
|
|
70
|
+
const BlobBuilder = window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
|
|
71
|
+
if (BlobBuilder !== undefined) {
|
|
72
|
+
blob = new BlobBuilder();
|
|
73
|
+
blob.append(code);
|
|
74
|
+
blob = blob.getBlob();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (blob !== undefined && URL.createObjectURL !== undefined) {
|
|
80
|
+
return URL.createObjectURL(blob);
|
|
81
|
+
} else {
|
|
82
|
+
// build data URL in a slowest way possible
|
|
83
|
+
return `data:${js_mime},${encodeURIComponent(code)}`;
|
|
64
84
|
}
|
|
65
|
-
return URL.createObjectURL(blob);
|
|
66
85
|
}
|
|
67
86
|
|
|
68
87
|
/**
|
|
@@ -11,8 +11,8 @@ function isGlobalPath(path) {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
// *** Environment setup code ***
|
|
14
|
-
const ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof require === 'function';
|
|
15
14
|
const ENVIRONMENT_IS_WEB = typeof window === 'object';
|
|
15
|
+
const ENVIRONMENT_IS_NODE = typeof process === 'object' && !ENVIRONMENT_IS_WEB;
|
|
16
16
|
const ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';
|
|
17
17
|
const ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"productName": "Meep",
|
|
5
5
|
"description": "production-ready JavaScript game engine based on Entity Component System Architecture",
|
|
6
6
|
"author": "Alexander Goldring",
|
|
7
|
-
"version": "2.33.
|
|
7
|
+
"version": "2.33.13",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"fast-levenshtein": "2.0.6",
|
|
10
10
|
"opentype.js": "1.3.3",
|