Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / replace-ext / index.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/replace-ext/index.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/replace-ext/index.js
new file mode 100644 (file)
index 0000000..7cb7789
--- /dev/null
@@ -0,0 +1,18 @@
+'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;