🔧 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 = {
|
options = {
|
||||||
encoding: null
|
encoding: null
|
||||||
}
|
}
|
||||||
} else if (util.isString(options)) {
|
} else if (typeof options === 'string') {
|
||||||
options = {
|
options = {
|
||||||
encoding: options
|
encoding: options
|
||||||
}
|
}
|
||||||
|
@ -468,7 +468,7 @@
|
||||||
options = {
|
options = {
|
||||||
encoding: null
|
encoding: null
|
||||||
}
|
}
|
||||||
} else if (!util.isObject(options)) {
|
} else if (typeof options !== 'object') {
|
||||||
throw new TypeError('Bad arguments')
|
throw new TypeError('Bad arguments')
|
||||||
}
|
}
|
||||||
const {encoding} = options
|
const {encoding} = options
|
||||||
|
@ -531,11 +531,11 @@
|
||||||
options = {
|
options = {
|
||||||
encoding: null
|
encoding: null
|
||||||
}
|
}
|
||||||
} else if (util.isString(options)) {
|
} else if (typeof options === 'string') {
|
||||||
options = {
|
options = {
|
||||||
encoding: options
|
encoding: options
|
||||||
}
|
}
|
||||||
} else if (!util.isObject(options)) {
|
} else if (typeof options !== 'object') {
|
||||||
throw new TypeError('Bad arguments')
|
throw new TypeError('Bad arguments')
|
||||||
}
|
}
|
||||||
const {encoding} = options
|
const {encoding} = options
|
||||||
|
|
Loading…
Reference in a new issue