mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-25 06:49:15 +01:00
19 lines
338 B
JavaScript
Vendored
19 lines
338 B
JavaScript
Vendored
'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;
|