import { map } from "https://deno.land/x/domain_functions@v3.0.0/src/domain-functions.ts";
It takes a domain function and a predicate to apply a transformation over the result.data of that function. It only runs if the function was successfull. When the given domain function fails, its error is returned wihout changes.
Examples
import { mdf, map } from 'domain-functions'
import { mdf, map } from 'domain-functions'
const a = mdf(z.object({ n: z.number() }))(({ n }) => n + 1) const df = map(a, (n) => String(n)) // ^? DomainFunction
Parameters
dfn: DomainFunction<O>