I've come across this function:
function stringToArray(s: string|[]): [] {
return typeof s === 'string' ? JSON.parse(s.replace(/'/g, '"')) : s;
}
This function is functioning as expected without any type warnings. But I'm curious - is [] a valid type? Is it synonymous with any[]?