jest-allure2-reporter
Version:
Idiomatic Jest reporter for Allure Framework
20 lines • 829 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.mergerExtractor = mergerExtractor;
const utils_1 = require("../../utils");
const composeExtractors2_1 = require("./composeExtractors2");
function mergerExtractor(maybeExtractor, fallbackValue) {
if (maybeExtractor == null) {
return;
}
if (typeof maybeExtractor === 'object') {
const value = maybeExtractor;
return (context) => {
const base = context.value;
return (0, utils_1.thruMaybePromise)(base, (v) => ({ ...v, ...value }));
};
}
const extractor = maybeExtractor;
return (0, composeExtractors2_1.composeExtractors2)(({ value }) => (0, utils_1.thruMaybePromise)(value, (base) => base ?? fallbackValue), extractor);
}
//# sourceMappingURL=mergerExtractor.js.map