{"size": 1029, "ext": "js", "max_stars_repo_path": "src/internal/web-requests/AbsoluteDispatcher.js", "max_stars_repo_name": "xinxinran0221010/tyber-framework", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/internal/web-requests/AbsoluteDispatcher.js", "max_issues_repo_name": "xinxinran0221010/tyber-framework", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/internal/web-requests/AbsoluteDispatcher.js", "max_forks_repo_name": "xinxinran0221010/tyber-framework", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 42.875, "max_line_length": 102, "alphanum_fraction": 0.657920311}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AbsoluteDispatcher = void 0;
const _utils_1 = require("@utils");
class AbsoluteDispatcher {
    async doService(serviceName, funcName, serviceContext, next, paramMethods) {
        const targetService = _utils_1.BeanUtils.getBean(_utils_1.BeanUtils.getBeanName(serviceName));
        const targetFunc = targetService && targetService[funcName];
        if (targetFunc) {
            const args = paramMethods.map(paramMethod => paramMethod(serviceContext, next));
            if (_utils_1.TypeUtils.isAsyncFunction(targetFunc)) {
                return await targetFunc.apply(targetService, args);
            }
            else {
                return targetFunc.apply(targetService, args);
            }
        }
        else {
            throw new Error('Request handler not found:' + serviceName + '->' + String(funcName));
        }
    }
}
exports.AbsoluteDispatcher = AbsoluteDispatcher;
//# sourceMappingURL=AbsoluteDispatcher.js.map