onrails
    Preparing search index...
    • Step factory: parse the workflow input with a Zod-like schema (or a unary parse function). Call .as(key) to name the output field.

      Type Parameters

      • I
      • T
      • E

      Parameters

      • parser: ParserLike<I, T>
      • onThrow: (error: unknown) => E

      Returns {
          as: <K extends string>(
              key: K,
          ) => <F, M extends RailwayMode>(
              workflow: Railway<RailwayInput<I>, F, M>,
          ) => Railway<RailwayInput<I> & Record<K, T>, E | F, M>;
      }

      parseWith(IdSchema, toError).as("id");
      // Used as the first step in `railway(rawId, parseId, ...)`