this might be clearer as `if (value !== null && typeof value !== 'object') {` but that might just be a personal preference. nbd.