UNPKG

tripledoc

Version:

Library to read, create and update documents on a Solid Pod

19 lines (13 loc) 338 B
'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;