🔧 Don’t use deprecated util.is* methods

This commit is contained in:
Felix Rieseberg 2017-11-20 09:40:47 -08:00
parent fa37d49fb6
commit 71b8eaf085

View file

@ -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