Decoding Arrays with Schema Validation: Built-in Transform Options

Is there a built-in transform to decode an Array<unknown> into an Array<A>, discarding any items that don't satisfy the schema for A? I've previously done this with my own transform, but just wondering if there's a built-in way to do it.

I know this is a "destructive" use case and that's generally discouraged/not the goal of the library, but in some ways its similar to disregarding additional properties when decoding objects. A lot of external APIs will give me a laundry list of objects to deal with, and I typically only care about a subset that satisfy a specific type.
Was this page helpful?