We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
StringPrototypeCharCodeAt
posix.extname
1 parent 11eaf19 commit 01fbe7bCopy full SHA for 01fbe7b
lib/path.js
@@ -1462,8 +1462,8 @@ const posix = {
1462
// after any path separator we find
1463
let preDotState = 0;
1464
for (let i = path.length - 1; i >= 0; --i) {
1465
- const code = StringPrototypeCharCodeAt(path, i);
1466
- if (code === CHAR_FORWARD_SLASH) {
+ const char = path[i];
+ if (char === '/') {
1467
// If we reached a path separator that was not part of a set of path
1468
// separators at the end of the string, stop now
1469
if (!matchedSlash) {
@@ -1478,7 +1478,7 @@ const posix = {
1478
matchedSlash = false;
1479
end = i + 1;
1480
}
1481
- if (code === CHAR_DOT) {
+ if (char === '.') {
1482
// If this is our first dot, mark it as the start of our extension
1483
if (startDot === -1)
1484
startDot = i;
0 commit comments