You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

18 lines
338 B

'use strict';
var path = require('path');
function replaceExt(npath, ext) {
if (typeof npath !== 'string') {
return npath;
}
if (npath.length === 0) {
return npath;
}
var nFileName = path.basename(npath, path.extname(npath)) + ext;
return path.join(path.dirname(npath), nFileName);
}
module.exports = replaceExt;