How is it wrong ?
Currently: either string OR number
Possible: either string | number OR just number
Are you implying in your other comment (that HN won't let me reply to) that Typescript has an "OR" operator that is distinct from "|"? Can you link to documentation on that?
if isInteger(x) is true, x is definitely a `number`
if isInteger(x) is false, x is unknown/unaltered (it remains `typeof x`)
Current type guards can't express "yes versus maybe", so isInteger cannot be a type guard at all.