Dashboard sipadu mbip
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

index.js 338B

123456789101112131415161718
  1. 'use strict';
  2. var path = require('path');
  3. function replaceExt(npath, ext) {
  4. if (typeof npath !== 'string') {
  5. return npath;
  6. }
  7. if (npath.length === 0) {
  8. return npath;
  9. }
  10. var nFileName = path.basename(npath, path.extname(npath)) + ext;
  11. return path.join(path.dirname(npath), nFileName);
  12. }
  13. module.exports = replaceExt;