UNPKG

jest-allure2-reporter

Version:
25 lines 792 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.helpers = helpers; function helpers(customizer) { if (customizer == null) { return undefined; } if (typeof customizer === 'function') { return customizer; } const customizedKeys = Object.keys(customizer); return (context) => { const base = { ...context.value }; const baseKeys = Object.keys(base); const allKeys = new Set([...baseKeys, ...customizedKeys]); for (const key of allKeys) { if (customizer[key]) { const factory = customizer[key]; base[key] = factory({ ...context, value: context.$[key] }); } } return base; }; } //# sourceMappingURL=helpers.js.map