1428
1429
extname(path: string): string {
1430
>
validateString(path, 'path');
path.ts
1431
>
let startDot = -1;
1432
>
let startPart = 0;
1433
>
let end = -1;
1434
>
let matchedSlash = true;
1435
>
// Track the state of characters (if any) we see before our first dot and
1436
>
// after any path separator we find
1437
>
let preDotState = 0;
1438
>
for (let i = path.length - 1; i >= 0; --i) {
1439
>
const char = path[i];
1440
>
if (char === '/') {
1441
// If we reached a path separator that was not part of a set of path
1442
// separators at the end of the string, stop now