🔧 fs.readFile: options are optional
This commit is contained in:
parent
5eb00e45aa
commit
c9f2080e4b
1 changed files with 4 additions and 0 deletions
|
@ -464,6 +464,10 @@
|
||||||
options = {
|
options = {
|
||||||
encoding: options
|
encoding: options
|
||||||
}
|
}
|
||||||
|
} else if (options === null || options === undefined) {
|
||||||
|
options = {
|
||||||
|
encoding: null
|
||||||
|
}
|
||||||
} else if (!util.isObject(options)) {
|
} else if (!util.isObject(options)) {
|
||||||
throw new TypeError('Bad arguments')
|
throw new TypeError('Bad arguments')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue