Hyperlinkv0.8.0-beta.28

Schema

Schema.overrideToFormatterfunctioneffect/Schema.ts:13116
<S extends Top>(toFormatter: () => Formatter<S["Type"]>): (
  self: S
) => S["Rebuild"]

Attaches a custom formatter used by toFormatter.

Details

Use this when the formatter derived from the schema structure is not suitable. The annotation is applied through this helper because adding it directly to Annotations.Bottom would make schemas invariant.

Formatter
export function overrideToFormatter<S extends Top>(toFormatter: () => Formatter<S["Type"]>) {
  return (self: S): S["Rebuild"] => {
    return self.annotate({ toFormatter })
  }
}