Typescript Check Type Of Array In Javascript Code