2016-10-10 03:43:44 +02:00
|
|
|
var path = require('path');
|
|
|
|
|
2017-04-20 03:09:25 +02:00
|
|
|
module.exports = function(npath, ext) {
|
|
|
|
if (typeof npath !== 'string') return npath;
|
|
|
|
if (npath.length === 0) return npath;
|
2016-10-10 03:43:44 +02:00
|
|
|
|
2017-04-20 03:09:25 +02:00
|
|
|
var nFileName = path.basename(npath, path.extname(npath))+ext;
|
2016-10-10 03:43:44 +02:00
|
|
|
return path.join(path.dirname(npath), nFileName);
|
2017-04-20 03:09:25 +02:00
|
|
|
};
|