@travetto/runtime 8.0.0-alpha.16 → 8.0.0-alpha.18
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/package.json +3 -3
- package/support/patch.js +21 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/runtime",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Runtime for travetto applications.",
|
|
6
6
|
"keywords": [
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"directory": "module/runtime"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@travetto/manifest": "^8.0.0-alpha.
|
|
29
|
+
"@travetto/manifest": "^8.0.0-alpha.9",
|
|
30
30
|
"@types/debug": "^4.1.13",
|
|
31
31
|
"debug": "^4.4.3"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@travetto/transformer": "^8.0.0-alpha.
|
|
34
|
+
"@travetto/transformer": "^8.0.0-alpha.12",
|
|
35
35
|
"temporal-polyfill-lite": "^0.4.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependenciesMeta": {
|
package/support/patch.js
CHANGED
|
@@ -7,29 +7,29 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
// polyfills
|
|
10
|
-
|
|
11
|
-
if (majorVersion < 26 || (majorVersion === 26 && minorVersion < 1)) {
|
|
10
|
+
if (!globalThis.Temporal) { // For anyone that doesn't have it
|
|
12
11
|
void import('temporal-polyfill-lite/global');
|
|
12
|
+
}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
Map.prototype.getOrInsert ??= function (key, value) {
|
|
15
|
+
return (this.has(key) || this.set(key, value), this.get(key));
|
|
16
|
+
};
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
Map.prototype.getOrInsertComputed ??= function (key, compute) {
|
|
19
|
+
return (this.has(key) || this.set(key, compute()), this.get(key));
|
|
20
|
+
};
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
return out;
|
|
22
|
+
// Allow for the throwIfNoEntry if on a version of node that is less than 25.7
|
|
23
|
+
const [majorVersion, minorVersion] = process.version.match(/\d+/g).map(text => parseInt(text, 10));
|
|
24
|
+
if (majorVersion < 25 || (majorVersion === 25 && minorVersion < 7)) {
|
|
25
|
+
const og = fs.stat;
|
|
26
|
+
Object.defineProperty(fs, 'stat', {
|
|
27
|
+
value: (...args) => {
|
|
28
|
+
const out = og.call(fs, ...args);
|
|
29
|
+
if (typeof args[1] === 'object' && args[1].throwIfNoEntry === false) {
|
|
30
|
+
return out.catch(() => { });
|
|
32
31
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|