🔧 Don’t use deprecated util.is* methods
This commit is contained in:
parent
fa37d49fb6
commit
71b8eaf085
1 changed files with 4 additions and 4 deletions
|
@ -460,7 +460,7 @@
|
|||
options = {
|
||||
encoding: null
|
||||
}
|
||||
} else if (util.isString(options)) {
|
||||
} else if (typeof options === 'string') {
|
||||
options = {
|
||||
encoding: options
|
||||
}
|
||||
|
@ -468,7 +468,7 @@
|
|||
options = {
|
||||
encoding: null
|
||||
}
|
||||
} else if (!util.isObject(options)) {
|
||||
} else if (typeof options !== 'object') {
|
||||
throw new TypeError('Bad arguments')
|
||||
}
|
||||
const {encoding} = options
|
||||
|
@ -531,11 +531,11 @@
|
|||
options = {
|
||||
encoding: null
|
||||
}
|
||||
} else if (util.isString(options)) {
|
||||
} else if (typeof options === 'string') {
|
||||
options = {
|
||||
encoding: options
|
||||
}
|
||||
} else if (!util.isObject(options)) {
|
||||
} else if (typeof options !== 'object') {
|
||||
throw new TypeError('Bad arguments')
|
||||
}
|
||||
const {encoding} = options
|
||||
|
|
Loading…
Reference in a new issue