isn't `if (typeof properties !== 'object') {` sufficient?