REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1008 B
Close
/proc/self/root/proc/self/root/opt/alt/alt-nodejs8/root/lib/node_modules/npm/node_modules/find-up/index.js
Text
Base64
'use strict'; const path = require('path'); const locatePath = require('locate-path'); module.exports = (filename, opts) => { opts = opts || {}; const startDir = path.resolve(opts.cwd || ''); const root = path.parse(startDir).root; const filenames = [].concat(filename); return new Promise(resolve => { (function find(dir) { locatePath(filenames, {cwd: dir}).then(file => { if (file) { resolve(path.join(dir, file)); } else if (dir === root) { resolve(null); } else { find(path.dirname(dir)); } }); })(startDir); }); }; module.exports.sync = (filename, opts) => { opts = opts || {}; let dir = path.resolve(opts.cwd || ''); const root = path.parse(dir).root; const filenames = [].concat(filename); // eslint-disable-next-line no-constant-condition while (true) { const file = locatePath.sync(filenames, {cwd: dir}); if (file) { return path.join(dir, file); } else if (dir === root) { return null; } dir = path.dirname(dir); } };
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
index.js
1008 B
lrw-r--r--
2021-09-28 10:29:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
license
1.09 KB
lrw-r--r--
2021-09-28 10:29:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
1.76 KB
lrw-r--r--
2021-09-28 10:29:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
readme.md
1.78 KB
lrw-r--r--
2021-09-28 10:29:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).