403Webshell
Server IP : 127.0.1.1  /  Your IP : 127.0.0.1
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux sealall 5.15.0-179-generic #189-Ubuntu SMP Tue May 5 18:20:56 UTC 2026 x86_64
User : devops ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/node_modules/pm2/modules/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/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