UNPKG

jest-allure2-reporter

Version:
13 lines 692 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.hijackFunction = void 0; const thruMaybePromise_1 = require("./thruMaybePromise"); const wrapFunction_1 = require("./wrapFunction"); const hijackFunction = (function_, callback) => { return (0, wrapFunction_1.wrapFunction)(function_, function hijackFunctionWrapper(...arguments_) { const result = Reflect.apply(function_, this, arguments_); return (0, thruMaybePromise_1.thruMaybePromise)(result, (value) => (0, thruMaybePromise_1.thruMaybePromise)(callback(value, arguments_), () => value)); }); }; exports.hijackFunction = hijackFunction; //# sourceMappingURL=hijackFunction.js.map