403Webshell
Server IP : 167.235.67.158  /  Your IP : 216.73.216.179
Web Server : Apache
System : Linux ubuntu-8gb-nbg1-1 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64
User : upstairsbar.co.uk ( 982)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/node_modules/pm2/modules/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/node_modules/pm2/modules/fclone.js
'use strict';

function fclone(obj, refs) {
  if (!obj || typeof obj !== 'object') return obj;

  if (obj instanceof Date) return new Date(obj);
  if (Buffer.isBuffer(obj)) return Buffer.from(obj);
  if (ArrayBuffer.isView(obj)) return obj.slice(0);

  if (!refs) refs = [];

  // handle array-like objects (arguments, NodeList, etc.)
  let isArr = Array.isArray(obj);
  if (!isArr) {
    let len = obj.length;
    isArr = typeof len === 'number' && (len === 0 || (len - 1) in obj) && typeof obj.indexOf === 'function';
  }

  if (isArr) {
    refs.push(obj);
    let copy = new Array(obj.length);
    for (let i = 0; i < obj.length; i++) {
      let v = obj[i];
      copy[i] = (v && typeof v === 'object' && refs.indexOf(v) !== -1) ? '[Circular]' : fclone(v, refs);
    }
    refs.pop();
    return copy;
  }

  refs.push(obj);
  let copy = {};

  if (obj instanceof Error) {
    copy.name = obj.name;
    copy.message = obj.message;
    copy.stack = obj.stack;
  }

  let keys = Object.keys(obj);
  for (let i = 0; i < keys.length; i++) {
    let v = obj[keys[i]];
    copy[keys[i]] = (v && typeof v === 'object' && refs.indexOf(v) !== -1) ? '[Circular]' : fclone(v, refs);
  }

  refs.pop();
  return copy;
}

module.exports = fclone;

Youez - 2016 - github.com/yon3zu
LinuXploit