HEX
Server: nginx/1.24.0
System: Linux nowruzgan 6.8.0-57-generic #59-Ubuntu SMP PREEMPT_DYNAMIC Sat Mar 15 17:40:59 UTC 2025 x86_64
User: babak (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/dev/shahnamag/front-end/node_modules/tree-dump/lib/printTree.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.printTree = void 0;
const printTree = (tab = '', children) => {
    let str = '';
    let last = children.length - 1;
    for (; last >= 0; last--)
        if (children[last])
            break;
    for (let i = 0; i <= last; i++) {
        const fn = children[i];
        if (!fn)
            continue;
        const isLast = i === last;
        const child = fn(tab + (isLast ? ' ' : '│') + '  ');
        const branch = child ? (isLast ? '└─' : '├─') : '│';
        str += '\n' + tab + branch + (child ? ' ' + child : '');
    }
    return str;
};
exports.printTree = printTree;