Alan
Alan
Aarktype
Created by Alan on 12/30/2024 in #questions
Filtering Array<unknown> to a type?
Is this the best way to filter an Array of unknown to an ark type?:
type transaction = type(...);
const items: unknown[] = ...;
const transactions = items
.filter(transaction.allows)
.map(transaction);
type transaction = type(...);
const items: unknown[] = ...;
const transactions = items
.filter(transaction.allows)
.map(transaction);
I don't need to throw when something in items doesn't match. I just want to filter.
3 replies