UNPKG

jest-allure2-reporter

Version:
10 lines (7 loc) 358 B
import type { MaybePromise, PropertyExtractor } from 'jest-allure2-reporter'; import { thruMaybePromise } from '../../utils'; export function mapper<Context, Value, Result>( function_: (value: Value) => Result, ): PropertyExtractor<Context, MaybePromise<Value>, MaybePromise<Result>> { return (context) => thruMaybePromise(context.value, function_); }