tnp-core 16.444.13 → 16.444.15

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.
@@ -546,23 +546,38 @@ const crossPlatformPath = (pathStringOrPathParts) => {
546
546
  if (Array.isArray(pathStringOrPathParts)) {
547
547
  pathStringOrPathParts = pathStringOrPathParts.join('/');
548
548
  }
549
- /* */
550
- /* */
551
- /* */
552
- /* */
553
- /* */
554
- /* */
555
- /* */
556
- /* */
557
549
  if (typeof pathStringOrPathParts !== 'string') {
558
550
  return pathStringOrPathParts;
559
551
  }
552
+ if (typeof pathStringOrPathParts === 'string' &&
553
+ /^[A-Z]\:/.test(pathStringOrPathParts)) {
554
+ pathStringOrPathParts = _.lowerFirst(pathStringOrPathParts);
555
+ }
560
556
  const isExtendedLengthPath = /^\\\\\?\\/.test(pathStringOrPathParts);
561
557
  const hasNonAscii = /[^\u0000-\u0080]+/.test(pathStringOrPathParts); // eslint-disable-line no-control-regex
562
- if (isExtendedLengthPath || hasNonAscii) {
563
- return pathStringOrPathParts?.replace(/\/\//g, '/');
558
+ if (isExtendedLengthPath) {
559
+ console.warn(`[firedev-core][crossPlatformPath]: Path starts with \\\\,
560
+ this is not supported in crossPlatformPath`);
561
+ console.trace(`path: "${pathStringOrPathParts}"`);
564
562
  }
565
- return pathStringOrPathParts.replace(/\\/g, '/').replace(/\/\//g, '/');
563
+ if (hasNonAscii) {
564
+ console.warn(`[firedev-core][crossPlatformPath]: Path contains non-ascii characters`);
565
+ console.trace(`path: "${pathStringOrPathParts}"`);
566
+ }
567
+ pathStringOrPathParts = (pathStringOrPathParts || '')
568
+ .replace(/\\/g, '/')
569
+ .replace(/\/\//g, '/')
570
+ .replace(/\/\//g, '/'); // TODO probably not needed
571
+ let isWindows = false;
572
+ /* */
573
+ /* */
574
+ /* */
575
+ /* */
576
+ const regexWinPath1 = /^(\/)[a-zA-Z]\:/;
577
+ if (isWindows && regexWinPath1.test(pathStringOrPathParts)) {
578
+ pathStringOrPathParts = pathStringOrPathParts.slice(1);
579
+ }
580
+ return pathStringOrPathParts;
566
581
  };
567
582
  /* */
568
583
  /* */
@@ -1515,18 +1530,6 @@ class HelpersCore extends HelpersMessages {
1515
1530
  /* */
1516
1531
  /* */
1517
1532
  /* */
1518
- getShell() {
1519
- /* */
1520
- /* */
1521
- /* */
1522
- /* */
1523
- /* */
1524
- /* */
1525
- /* */
1526
- /* */
1527
- /* */
1528
- return (void 0);
1529
- }
1530
1533
  get isRunningInGitBash() {
1531
1534
  /* */
1532
1535
  /* */
@@ -3230,6 +3233,14 @@ class HelpersCore extends HelpersMessages {
3230
3233
  /* */
3231
3234
  /* */
3232
3235
  /* */
3236
+ /* */
3237
+ /* */
3238
+ /* */
3239
+ /* */
3240
+ /* */
3241
+ /* */
3242
+ /* */
3243
+ /* */
3233
3244
  replaceLinesInFile(absoluteFilePath, lineReplaceFn) {
3234
3245
  /* */
3235
3246
  /* */
@@ -3557,6 +3568,13 @@ class HelpersCore extends HelpersMessages {
3557
3568
  /* */
3558
3569
  /* */
3559
3570
  /* */
3571
+ /* */
3572
+ /* */
3573
+ /* */
3574
+ /* */
3575
+ /* */
3576
+ /* */
3577
+ /* */
3560
3578
  hideNodeWarnings() {
3561
3579
  /* */
3562
3580
  /* */