![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/local/lib/node_modules/browserify/node_modules/parents/ |
Upload File : |
var pathPlatform = require('path-platform'); module.exports = function (cwd, opts) { if (cwd === undefined) cwd = process.cwd(); if (!opts) opts = {}; var platform = opts.platform || process.platform; var isWindows = /^win/.test(platform); var path = isWindows ? pathPlatform.win32 : pathPlatform; var normalize = !isWindows ? path.normalize : path.normalize('c:') === 'c:.' ? fixNormalize(path.normalize) : path.normalize; var sep = isWindows ? /[\\\/]/ : '/'; var init = isWindows ? '' : '/'; var join = function (x, y) { var ps = [ x, y ].filter(function (p) { return p && typeof p === 'string' }); return normalize(ps.join(isWindows ? '\\' : '/')); }; var res = normalize(cwd) .split(sep) .reduce(function (acc,dir,ix) { return acc.concat(join(acc[ix], dir)) }, [init]) .slice(1) .reverse() ; if (res[0] === res[1]) return [ res[0] ]; if (isWindows && /^\\/.test(cwd)) { return res.slice(0,-1).map(function (d) { var ch = d.charAt(0) return ch === '\\' ? d : ch === '.' ? '\\' + d.slice(1) : '\\' + d }); } return res; function fixNormalize(fn) { return function(p) { return fn(p).replace(/:\.$/, ':') } } }