Merge pull request #11187 from electron/util-is-deprecation
fix: Don’t use deprecated util.is* methods
This commit is contained in:
commit
70fae85451
2 changed files with 5 additions and 7 deletions
|
@ -2,7 +2,6 @@
|
|||
|
||||
const url = require('url')
|
||||
const {EventEmitter} = require('events')
|
||||
const util = require('util')
|
||||
const {Readable} = require('stream')
|
||||
const {app} = require('electron')
|
||||
const {Session} = process.atomBinding('session')
|
||||
|
@ -115,7 +114,7 @@ class ClientRequest extends EventEmitter {
|
|||
if (typeof options === 'string') {
|
||||
options = url.parse(options)
|
||||
} else {
|
||||
options = util._extend({}, options)
|
||||
options = Object.assign({}, options)
|
||||
}
|
||||
|
||||
const method = (options.method || 'GET').toUpperCase()
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
const {Buffer} = require('buffer')
|
||||
const childProcess = require('child_process')
|
||||
const path = require('path')
|
||||
const util = require('util')
|
||||
|
||||
const hasProp = {}.hasOwnProperty
|
||||
|
||||
|
@ -460,7 +459,7 @@
|
|||
options = {
|
||||
encoding: null
|
||||
}
|
||||
} else if (util.isString(options)) {
|
||||
} else if (typeof options === 'string') {
|
||||
options = {
|
||||
encoding: options
|
||||
}
|
||||
|
@ -468,7 +467,7 @@
|
|||
options = {
|
||||
encoding: null
|
||||
}
|
||||
} else if (!util.isObject(options)) {
|
||||
} else if (typeof options !== 'object') {
|
||||
throw new TypeError('Bad arguments')
|
||||
}
|
||||
const {encoding} = options
|
||||
|
@ -531,11 +530,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…
Add table
Add a link
Reference in a new issue