!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/node-red/node_modules/jsdoc/lib/jsdoc/util/   drwxr-xr-x
Free 13 GB of 57.97 GB (22.42%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     cast.js (2.26 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/**
 * Module to convert values between various JavaScript types.
 * @module
 * @private
 */

/**
 * Check whether a string contains a boolean or numeric value, and convert the string to the
 * appropriate type if necessary.
 *
 * @private
 * @param {string} str - The string to convert.
 * @return {(string|number|boolean)} The converted value.
 */
function castString(str) {
    let number;
    let result;

    switch (str) {
        case 'true':
            result = true;
            break;

        case 'false':
            result = false;
            break;

        case 'NaN':
            result = NaN;
            break;

        case 'null':
            result = null;
            break;

        case 'undefined':
            result = undefined;
            break;

        default:
            if (typeof str === 'string') {
                if (str.includes('.')) {
                    number = parseFloat(str);
                }
                else {
                    number = parseInt(str, 10);
                }

                if ( String(number) === str && !isNaN(number) ) {
                    result = number;
                }
                else {
                    result = str;
                }
            }
    }

    return result;
}

/**
 * Check whether a string contains a boolean or numeric value, and convert the string to the
 * appropriate type if necessary.
 *
 * If an object or array is passed to this method, the object or array's values will be recursively
 * converted to the appropriate types. The original object or array is not modified.
 *
 * @private
 * @param {(string|Object|Array)} item - The item whose type will be converted.
 * @return {(string|number|boolean|Object|Array)} The converted value.
 */
exports.cast = function cast(item) {
    let result;

    if ( Array.isArray(item) ) {
        result = [];
        for (let i = 0, l = item.length; i < l; i++) {
            result[i] = cast(item[i]);
        }
    }
    else if (typeof item === 'object' && item !== null) {
        result = {};
        Object.keys(item).forEach(prop => {
            result[prop] = cast(item[prop]);
        });
    }
    else if (typeof item === 'string') {
        result = castString(item);
    }
    else {
        result = item;
    }

    return result;
};

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0046 ]--