One Hat Cyber Team
Your IP :
10.30.1.1
Server IP :
103.148.201.5
Server :
Linux web-olt 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
Server Software :
Apache/2.4.52 (Ubuntu)
PHP Version :
8.1.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
npm
/
node_modules
/
common-ancestor-path
/
Edit File:
index.js
const {parse, sep, normalize: norm} = require('path') function* commonArrayMembers (a, b) { const [l, s] = a.length > b.length ? [a, b] : [b, a] for (const x of s) { if (x === l.shift()) yield x else break } } const commonAncestorPath = (a, b) => a === b ? a : parse(a).root !== parse(b).root ? null : [...commonArrayMembers(norm(a).split(sep), norm(b).split(sep))].join(sep) module.exports = (...paths) => paths.reduce(commonAncestorPath)
Simpan