Skip to content

Commit e8bdbed

Browse files
committed
Stricter undefined checks for options
1 parent ce1eceb commit e8bdbed

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export const VERSION = pkg.version
5555
* Registration options.
5656
*/
5757
export interface Options {
58-
typeCheck?: boolean | null
59-
cache?: boolean | null
58+
typeCheck?: boolean
59+
cache?: boolean
6060
cacheDirectory?: string
6161
compiler?: string
6262
project?: boolean | string
@@ -169,9 +169,9 @@ export function register (options: Options = {}): Register {
169169
).concat(emptyFileListWarnings).map(Number)
170170
const getFile = options.getFile || DEFAULTS.getFile
171171
const fileExists = options.fileExists || DEFAULTS.fileExists
172-
const shouldCache = !!(options.cache == null ? DEFAULTS.cache : options.cache)
173-
const typeCheck = !!(options.typeCheck == null ? DEFAULTS.typeCheck : options.typeCheck)
174-
const project = options.project == null ? DEFAULTS.project : options.project
172+
const shouldCache = !!(options.cache === undefined ? DEFAULTS.cache : options.cache)
173+
const typeCheck = !!(options.typeCheck === undefined ? DEFAULTS.typeCheck : options.typeCheck)
174+
const project = options.project === undefined ? DEFAULTS.project : options.project
175175
const cacheDirectory = options.cacheDirectory || DEFAULTS.cacheDirectory || getTmpDir()
176176
const compilerOptions = Object.assign({}, DEFAULTS.compilerOptions, options.compilerOptions)
177177
const originalJsHandler = require.extensions['.js']

0 commit comments

Comments
 (0)