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 url = require('url')
|
||||||
const {EventEmitter} = require('events')
|
const {EventEmitter} = require('events')
|
||||||
const util = require('util')
|
|
||||||
const {Readable} = require('stream')
|
const {Readable} = require('stream')
|
||||||
const {app} = require('electron')
|
const {app} = require('electron')
|
||||||
const {Session} = process.atomBinding('session')
|
const {Session} = process.atomBinding('session')
|
||||||
|
@ -115,7 +114,7 @@ class ClientRequest extends EventEmitter {
|
||||||
if (typeof options === 'string') {
|
if (typeof options === 'string') {
|
||||||
options = url.parse(options)
|
options = url.parse(options)
|
||||||
} else {
|
} else {
|
||||||
options = util._extend({}, options)
|
options = Object.assign({}, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
const method = (options.method || 'GET').toUpperCase()
|
const method = (options.method || 'GET').toUpperCase()
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
const {Buffer} = require('buffer')
|
const {Buffer} = require('buffer')
|
||||||
const childProcess = require('child_process')
|
const childProcess = require('child_process')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const util = require('util')
|
|
||||||
|
|
||||||
const hasProp = {}.hasOwnProperty
|
const hasProp = {}.hasOwnProperty
|
||||||
|
|
||||||
|
@ -460,7 +459,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 +467,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 +530,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…
Add table
Add a link
Reference in a new issue