-
Notifications
You must be signed in to change notification settings - Fork 226
Closed
Labels
Description
See:
Lines 79 to 87 in bef1dc0
| function normalizeOptions(options: any, defEnc: string | null, defFlag: string, defMode: number | null): {encoding: string; flag: string; mode: number} { | |
| switch (typeof options) { | |
| case 'object': | |
| return { | |
| encoding: typeof options['encoding'] !== 'undefined' ? options['encoding'] : defEnc, | |
| flag: typeof options['flag'] !== 'undefined' ? options['flag'] : defFlag, | |
| mode: normalizeMode(options['mode'], defMode!) | |
| }; | |
| case 'string': |
If options in normalizeOptions(...) is null, typeof options equals "object" and the following code will throw a TypeError:
Line 83 in bef1dc0
| encoding: typeof options['encoding'] !== 'undefined' ? options['encoding'] : defEnc, |