⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
invoice
/
node_modules
/
replace-ext
/
Edit File: index.js
'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; var nFilepath = path.join(path.dirname(npath), nFileName); // Because `path.join` removes the head './' from the given path. // This removal can cause a problem when passing the result to `require` or // `import`. if (startsWithSingleDot(npath)) { return '.' + path.sep + nFilepath; } return nFilepath; } function startsWithSingleDot(fpath) { var first2chars = fpath.slice(0, 2); return (first2chars === '.' + path.sep) || (first2chars === './'); } module.exports = replaceExt;
Simpan