Merge pull request #11235 from electron/standard-10
infra: Upgrade to StandardJS 10
This commit is contained in:
commit
1c0ea0286e
27 changed files with 105 additions and 43 deletions
|
@ -367,6 +367,8 @@
|
|||
return invalidArchiveError(asarPath, callback)
|
||||
}
|
||||
process.nextTick(function () {
|
||||
// Disabled due to false positive in StandardJS
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback(archive.stat(filePath) !== false)
|
||||
})
|
||||
}
|
||||
|
@ -482,7 +484,7 @@
|
|||
}
|
||||
if (info.size === 0) {
|
||||
return process.nextTick(function () {
|
||||
callback(null, encoding ? '' : new Buffer(0))
|
||||
callback(null, encoding ? '' : Buffer.alloc(0))
|
||||
})
|
||||
}
|
||||
if (info.unpacked) {
|
||||
|
@ -490,7 +492,7 @@
|
|||
return fs.readFile(realPath, options, callback)
|
||||
}
|
||||
|
||||
const buffer = new Buffer(info.size)
|
||||
const buffer = Buffer.alloc(info.size)
|
||||
const fd = archive.getFd()
|
||||
if (!(fd >= 0)) {
|
||||
return notFoundError(asarPath, filePath, callback)
|
||||
|
@ -519,7 +521,7 @@
|
|||
if (options) {
|
||||
return ''
|
||||
} else {
|
||||
return new Buffer(0)
|
||||
return Buffer.alloc(0)
|
||||
}
|
||||
}
|
||||
if (info.unpacked) {
|
||||
|
@ -538,7 +540,7 @@
|
|||
throw new TypeError('Bad arguments')
|
||||
}
|
||||
const {encoding} = options
|
||||
const buffer = new Buffer(info.size)
|
||||
const buffer = Buffer.alloc(info.size)
|
||||
const fd = archive.getFd()
|
||||
if (!(fd >= 0)) {
|
||||
notFoundError(asarPath, filePath)
|
||||
|
@ -611,7 +613,7 @@
|
|||
encoding: 'utf8'
|
||||
})
|
||||
}
|
||||
const buffer = new Buffer(info.size)
|
||||
const buffer = Buffer.alloc(info.size)
|
||||
const fd = archive.getFd()
|
||||
if (!(fd >= 0)) {
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue