1454
}
1455
if (char === '.') {
1456
>
// If this is our first dot, mark it as the start of our extension
path.ts
1457
>
if (startDot === -1) {
1458
>
startDot = i;
1459
>
}
1460
else if (preDotState !== 1) {
1461
preDotState = 1;
1462
}
1463
} else if (startDot !== -1) {
1464
>
// We saw a non-dot and non-path separator before our dot, so we should
path.ts
1465
>
// have a good chance at having a non-empty extension
1466
>
preDotState = -1;
1467
>
}
1468
}
1469
1470
if (startDot === -1 ||
1472
>
// We saw a non-dot character immediately before the dot
1473
>
preDotState === 0 ||
1474
>
// The (right-most) trimmed path component is exactly '..'
1475
>
(preDotState === 1 &&
1476
startDot === end - 1 &&
1477
startDot === startPart + 1)) {
1478
return '';
1479
}
1480
>
return path.slice(startDot, end);
path.ts
1481
},
1482