@travetto/runtime 8.0.0-alpha.16 → 8.0.0-alpha.17

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 +1 -1
  2. 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.16",
3
+ "version": "8.0.0-alpha.17",
4
4
  "type": "module",
5
5
  "description": "Runtime for travetto applications.",
6
6
  "keywords": [
package/support/patch.js CHANGED
@@ -7,29 +7,29 @@ if (process.env.NODE_ENV !== 'production') {
7
7
  }
8
8
 
9
9
  // polyfills
10
- const [majorVersion, minorVersion] = process.version.match(/\d+/g).map(text => parseInt(text, 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
- Map.prototype.getOrInsert ??= function (key, value) {
15
- return (this.has(key) || this.set(key, value), this.get(key));
16
- };
14
+ Map.prototype.getOrInsert ??= function (key, value) {
15
+ return (this.has(key) || this.set(key, value), this.get(key));
16
+ };
17
17
 
18
- Map.prototype.getOrInsertComputed ??= function (key, compute) {
19
- return (this.has(key) || this.set(key, compute()), this.get(key));
20
- };
18
+ Map.prototype.getOrInsertComputed ??= function (key, compute) {
19
+ return (this.has(key) || this.set(key, compute()), this.get(key));
20
+ };
21
21
 
22
- // Allow for the throwIfNoEntry if on a version of node that is less than 25.7
23
- if (majorVersion < 25 || (majorVersion === 25 && minorVersion < 7)) {
24
- const og = fs.stat;
25
- Object.defineProperty(fs, 'stat', {
26
- value: (...args) => {
27
- const out = og.call(fs, ...args);
28
- if (typeof args[1] === 'object' && args[1].throwIfNoEntry === false) {
29
- return out.catch(() => { });
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
+ }