mirror of
https://github.com/deployphp/action.git
synced 2025-06-29 12:44:14 +00:00
Update deps
This commit is contained in:
parent
eed58e3496
commit
363bb1be96
126 changed files with 5743 additions and 2737 deletions
50
node_modules/fs-extra/lib/fs/index.js
generated
vendored
50
node_modules/fs-extra/lib/fs/index.js
generated
vendored
|
@ -41,8 +41,7 @@ const api = [
|
|||
'writeFile'
|
||||
].filter(key => {
|
||||
// Some commands are not available on some systems. Ex:
|
||||
// fs.opendir was added in Node.js v12.12.0
|
||||
// fs.rm was added in Node.js v14.14.0
|
||||
// fs.cp was added in Node.js v16.7.0
|
||||
// fs.lchown is not available on at least some Linux
|
||||
return typeof fs[key] === 'function'
|
||||
})
|
||||
|
@ -66,7 +65,7 @@ exports.exists = function (filename, callback) {
|
|||
})
|
||||
}
|
||||
|
||||
// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args
|
||||
// fs.read(), fs.write(), fs.readv(), & fs.writev() need special treatment due to multiple callback args
|
||||
|
||||
exports.read = function (fd, buffer, offset, length, position, callback) {
|
||||
if (typeof callback === 'function') {
|
||||
|
@ -98,23 +97,36 @@ exports.write = function (fd, buffer, ...args) {
|
|||
})
|
||||
}
|
||||
|
||||
// fs.writev only available in Node v12.9.0+
|
||||
if (typeof fs.writev === 'function') {
|
||||
// Function signature is
|
||||
// s.writev(fd, buffers[, position], callback)
|
||||
// We need to handle the optional arg, so we use ...args
|
||||
exports.writev = function (fd, buffers, ...args) {
|
||||
if (typeof args[args.length - 1] === 'function') {
|
||||
return fs.writev(fd, buffers, ...args)
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
|
||||
if (err) return reject(err)
|
||||
resolve({ bytesWritten, buffers })
|
||||
})
|
||||
})
|
||||
// Function signature is
|
||||
// s.readv(fd, buffers[, position], callback)
|
||||
// We need to handle the optional arg, so we use ...args
|
||||
exports.readv = function (fd, buffers, ...args) {
|
||||
if (typeof args[args.length - 1] === 'function') {
|
||||
return fs.readv(fd, buffers, ...args)
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => {
|
||||
if (err) return reject(err)
|
||||
resolve({ bytesRead, buffers })
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Function signature is
|
||||
// s.writev(fd, buffers[, position], callback)
|
||||
// We need to handle the optional arg, so we use ...args
|
||||
exports.writev = function (fd, buffers, ...args) {
|
||||
if (typeof args[args.length - 1] === 'function') {
|
||||
return fs.writev(fd, buffers, ...args)
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
|
||||
if (err) return reject(err)
|
||||
resolve({ bytesWritten, buffers })
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// fs.realpath.native sometimes not available if fs is monkey-patched
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue