why not just `invariant(typeof partialState === 'object' && partialState != null)`?