Typescript Check If An Array Can Be Divided