@@ -743,12 +743,12 @@ const win32 = {
743743
744744 /**
745745 * @param {string } path
746- * @param {string } [ext ]
746+ * @param {string } [suffix ]
747747 * @returns {string }
748748 */
749- basename ( path , ext ) {
750- if ( ext !== undefined )
751- validateString ( ext , 'ext' ) ;
749+ basename ( path , suffix ) {
750+ if ( suffix !== undefined )
751+ validateString ( suffix , 'ext' ) ;
752752 validateString ( path , 'path' ) ;
753753 let start = 0 ;
754754 let end = - 1 ;
@@ -763,10 +763,10 @@ const win32 = {
763763 start = 2 ;
764764 }
765765
766- if ( ext !== undefined && ext . length > 0 && ext . length <= path . length ) {
767- if ( ext === path )
766+ if ( suffix !== undefined && suffix . length > 0 && suffix . length <= path . length ) {
767+ if ( suffix === path )
768768 return '' ;
769- let extIdx = ext . length - 1 ;
769+ let extIdx = suffix . length - 1 ;
770770 let firstNonSlashEnd = - 1 ;
771771 for ( let i = path . length - 1 ; i >= start ; -- i ) {
772772 const code = StringPrototypeCharCodeAt ( path , i ) ;
@@ -786,7 +786,7 @@ const win32 = {
786786 }
787787 if ( extIdx >= 0 ) {
788788 // Try to match the explicit extension
789- if ( code === StringPrototypeCharCodeAt ( ext , extIdx ) ) {
789+ if ( code === StringPrototypeCharCodeAt ( suffix , extIdx ) ) {
790790 if ( -- extIdx === - 1 ) {
791791 // We matched the extension, so mark this as the end of our path
792792 // component
@@ -1300,22 +1300,22 @@ const posix = {
13001300
13011301 /**
13021302 * @param {string } path
1303- * @param {string } [ext ]
1303+ * @param {string } [suffix ]
13041304 * @returns {string }
13051305 */
1306- basename ( path , ext ) {
1307- if ( ext !== undefined )
1308- validateString ( ext , 'ext' ) ;
1306+ basename ( path , suffix ) {
1307+ if ( suffix !== undefined )
1308+ validateString ( suffix , 'ext' ) ;
13091309 validateString ( path , 'path' ) ;
13101310
13111311 let start = 0 ;
13121312 let end = - 1 ;
13131313 let matchedSlash = true ;
13141314
1315- if ( ext !== undefined && ext . length > 0 && ext . length <= path . length ) {
1316- if ( ext === path )
1315+ if ( suffix !== undefined && suffix . length > 0 && suffix . length <= path . length ) {
1316+ if ( suffix === path )
13171317 return '' ;
1318- let extIdx = ext . length - 1 ;
1318+ let extIdx = suffix . length - 1 ;
13191319 let firstNonSlashEnd = - 1 ;
13201320 for ( let i = path . length - 1 ; i >= 0 ; -- i ) {
13211321 const code = StringPrototypeCharCodeAt ( path , i ) ;
@@ -1335,7 +1335,7 @@ const posix = {
13351335 }
13361336 if ( extIdx >= 0 ) {
13371337 // Try to match the explicit extension
1338- if ( code === StringPrototypeCharCodeAt ( ext , extIdx ) ) {
1338+ if ( code === StringPrototypeCharCodeAt ( suffix , extIdx ) ) {
13391339 if ( -- extIdx === - 1 ) {
13401340 // We matched the extension, so mark this as the end of our path
13411341 // component
0 commit comments