fn(x: any, y: any, z: any):any{
if (!Array.isArray(x)) x = [x];
if (!Array.isArray(y)) y = [y];
if (!Array.isArray(z)) z = [z];
// .....
}
function fn(x: number | Array<number>): void {
if(!Array.isArray(x))
x = [x];
console.log(x);
}