Can we just have an explicit comparison to null? It's just a bit easier to read (I just spent a few minutes trying to figure out what else this is supposed to catch) Is there something else we're trying to handle? We can also just push that check into the parent if:
if (typeof obj === 'object' && object !== null)
because String(null) === 'null'