How to do an array check (like Array.isArray()) with a readonly array (ReadonlyArray)?
Array.isArray()
ReadonlyArray
As an example:
Here's relevant issue in typescript.
Suggested workaround by @jcalz is adding overload to declaration of isArray:
isArray
declare global { interface ArrayConstructor { isArray(arg: ReadonlyArray | any): arg is ReadonlyArray } }