Upsilon-VsCode/Client/node_modules/replace-ext/index.js

19 lines
338 B
JavaScript
Raw Normal View History

2019-02-17 17:07:28 +00:00
'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;