import { pipe } from "https://deno.land/x/domain_functions@v3.0.0/src/index.ts";
Creates a single domain function out of a chain of multiple domain functions. It will pass the same environment to all given functions, and it will pass the output of a function as the next function's input in left-to-right order. The resulting data will be the output of the rightmost function.
Examples
import { mdf, pipe } from 'domain-functions'
import { mdf, pipe } from 'domain-functions'
const a = mdf(z.object({ aNumber: z.number() }))( ({ aNumber }) => ({ aString: String(aNumber) }), ) const b = mdf(z.object({ aString: z.string() }))( ({ aString }) => ({ aBoolean: aString == '1' }), ) const d = pipe(a, b) // ^? DomainFunction<{ aBoolean: boolean }>
Type Parameters
T extends DomainFunction[]
Parameters
...fns: T