Casting types in pipeline without re-mapping

Hi! Just wanna ask how you often cast the types in pipeline? I wonder if I can cast without having to .map again

cause.pipe(
    Cause.failures, // => AppError | ValidationError | OtherError
    Chunk.filter((e) => e instanceof ValidationError),
    Chunk.map((e) => e as ValidationError) // or maybe Chunk.cast<ValidationError>,
    Chunk.map((e) => e.errors),
    Chunk.toReadonlyArray
)
Was this page helpful?