I think you could skip the `typeof` call and just write `id || url`.