All files / dist/apiService ApiService.js

100% Statements 19/19
100% Branches 5/5
100% Functions 6/6
100% Lines 17/17

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31  1x 1x 1x   1x   1x 1x   1x 1x 1x   2x 2x 1x 1x             1x 1x   1x   1x  
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiService = void 0;
var ApiService = /** @class */ (function () {
    function ApiService(apiConfig, api) {
        this.api = api;
    }
    ApiService.prototype.getOutBoundFn = function () {
        return this.outboundFn;
    };
    ApiService.prototype.getInboundFn = function () {
        var _this = this;
        return function (payload) {
            var _a;
            var propertyToCall = payload.propertyToCall, args = payload.args, uuid = payload.uuid;
            if (propertyToCall && uuid && (propertyToCall in _this.api)) {
                var result = (_a = _this.api)[propertyToCall].apply(_a, args);
                _this.getOutBoundFn()({
                    uuid: uuid,
                    returnValue: result
                });
            }
        };
    };
    ApiService.prototype.setOutboundFn = function (outboundFn) {
        this.outboundFn = outboundFn;
    };
    return ApiService;
}());
exports.ApiService = ApiService;
//# sourceMappingURL=ApiService.js.map