.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / replace-ext / index.js
1 'use strict';
2
3 var path = require('path');
4
5 function replaceExt(npath, ext) {
6   if (typeof npath !== 'string') {
7     return npath;
8   }
9
10   if (npath.length === 0) {
11     return npath;
12   }
13
14   var nFileName = path.basename(npath, path.extname(npath)) + ext;
15   return path.join(path.dirname(npath), nFileName);
16 }
17
18 module.exports = replaceExt;