tnp-core 19.0.50 → 19.0.52

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.
@@ -2378,28 +2378,19 @@ var UtilsOs;
2378
2378
  * Electron backend or browser.
2379
2379
  */
2380
2380
  UtilsOs.isRunningInElectron = () => {
2381
- if (UtilsOs.isRunningInSSRMode()) {
2382
- return false; // no ssr for electron
2383
- }
2384
- // Renderer process
2385
- // @ts-ignore
2386
- if (typeof window !== 'undefined' &&
2387
- typeof window.process === 'object' &&
2388
- // @ts-ignore
2389
- window.process.type === 'renderer') {
2381
+ // Electron main or renderer (most reliable)
2382
+ if (typeof process !== 'undefined' && process?.versions?.electron) {
2390
2383
  return true;
2391
2384
  }
2392
- // Main process
2393
- // @ts-ignore
2394
- if (typeof process !== 'undefined' &&
2395
- typeof process.versions === 'object' &&
2396
- !!process.versions.electron) {
2385
+ // Renderer with nodeIntegration
2386
+ if (typeof globalThis !== 'undefined' &&
2387
+ globalThis?.process?.type === 'renderer') {
2397
2388
  return true;
2398
2389
  }
2399
- // Detect the user agent when the `nodeIntegration` option is set to false
2390
+ // Renderer with nodeIntegration disabled
2400
2391
  if (typeof navigator === 'object' &&
2401
2392
  typeof navigator.userAgent === 'string' &&
2402
- navigator.userAgent.indexOf('Electron') >= 0) {
2393
+ /Electron/i.test(navigator.userAgent)) {
2403
2394
  return true;
2404
2395
  }
2405
2396
  return false;
@@ -2673,6 +2664,12 @@ var UtilsOs;
2673
2664
  /* */
2674
2665
  /* */
2675
2666
  /* */
2667
+ /* */
2668
+ /* */
2669
+ /* */
2670
+ /* */
2671
+ /* */
2672
+ /* */
2676
2673
  return (void 0);
2677
2674
  };
2678
2675
  //#endregion
@@ -3398,6 +3395,7 @@ var UtilsJson;
3398
3395
  //#endregion
3399
3396
  })(UtilsJson || (UtilsJson = {}));
3400
3397
  //#endregion
3398
+ //#region utils yaml
3401
3399
  var UtilsYaml;
3402
3400
  (function (UtilsYaml) {
3403
3401
  UtilsYaml.yamlToJson = (yamlString) => {
@@ -3455,6 +3453,7 @@ var UtilsYaml;
3455
3453
  };
3456
3454
  //#endregion
3457
3455
  })(UtilsYaml || (UtilsYaml = {}));
3456
+ //#endregion
3458
3457
 
3459
3458
  class HelpersIsomorphic {
3460
3459
  /**