I can detect iOS 13 on iPhone but in iPad OS 13 navigator.platform comes as MacIntel. So it is not possible to get iPad identified using below code, but it work
I was able to get iPad detection working by checking for navigator.maxTouchPoints as well as navigator.platform. It's not perfect (as discussed in the comments below) but it's the best solution I've come across so far so I wanted to share.
const iPad = (userAgent.match(/(iPad)/) /* iOS pre 13 */ ||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1) /* iPad OS 13 */);