typescript map function with index