[TS] Correct pointer arithmetic on array construction