403Webshell
Server IP : 14.225.204.176  /  Your IP : 216.73.216.252
Web Server : nginx/1.24.0
System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64
User : root ( 0)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/share/nodejs/has-own-deep/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/nodejs/has-own-deep/index.js
/*!
 * has-own-deep <https://github.com/jonschlinkert/has-own-deep>
 *
 * Copyright (c) 2015-2018, Jon Schlinkert.
 * Released under the MIT License.
 */

'use strict';

const hasOwn = Object.prototype.hasOwnProperty;
const isObject = require('isobject');

module.exports = function(target, path) {
  if (!isObject(target) && !Array.isArray(target)) {
    throw new TypeError('expected the first argument to be an object or array');
  }

  if (typeof path !== 'string') {
    throw new TypeError('expected object path to be a string');
  }

  if (hasOwn.call(target, path)) {
    return true;
  }

  let segs = Array.isArray(path) ? path : path.split(/\\?\./);
  let obj = target;

  while ((isObject(obj) || Array.isArray(obj)) && segs.length) {
    if (hasOwn.call(obj, segs[0])) {
      obj = obj[segs.shift()];
      continue;
    }

    let rest = segs.slice();
    let has = false;

    do {
      const prop = rest.join('.');

      if ((has = hasOwn.call(obj, prop))) {
        segs = segs.slice(rest.length);
        obj = obj[prop];
        break;
      }

      rest.pop();
    } while (rest.length);


    if (!has) {
      return false;
    }
  }

  return true;
};

Youez - 2016 - github.com/yon3zu
LinuXploit