Using `Match` to Handle Arrays in TypeScript

Can you use
Match
to match an array? eg
pipe(
  Match.type<string | number | ReadonlyArray<{ id: string }>>(),
  Match.when(Match.string, (x) => `"${x.replace(/"/g, '""')}"`),
  Match.when(Match.number, (x) => x + ''),
  // what goes here?
)
Was this page helpful?