import { failure, success } from './constructors' export const failureIfDefined = (value: T | undefined, otherwise = undefined) => value ? failure(value) : success(otherwise) export const successIfDefined = (value: T | undefined, otherwise = undefined) => value ? success(value) : failure(otherwise)