Update gitignore (sorry)
This commit is contained in:
parent
a8f8c4d7ad
commit
cca8b02fea
6604 changed files with 1219661 additions and 4 deletions
26
electron/node_modules/asar/lib/wrapped-fs.js
generated
vendored
Normal file
26
electron/node_modules/asar/lib/wrapped-fs.js
generated
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
'use strict'
|
||||
|
||||
const fs = process.versions.electron ? require('original-fs') : require('fs')
|
||||
|
||||
const promisifiedMethods = [
|
||||
'lstat',
|
||||
'mkdtemp',
|
||||
'readFile',
|
||||
'stat',
|
||||
'writeFile'
|
||||
]
|
||||
|
||||
const promisified = {}
|
||||
|
||||
for (const method of Object.keys(fs)) {
|
||||
if (promisifiedMethods.includes(method)) {
|
||||
promisified[method] = fs.promises[method]
|
||||
} else {
|
||||
promisified[method] = fs[method]
|
||||
}
|
||||
}
|
||||
// To make it more like fs-extra
|
||||
promisified.mkdirp = (dir) => fs.promises.mkdir(dir, { recursive: true })
|
||||
promisified.mkdirpSync = (dir) => fs.mkdirSync(dir, { recursive: true })
|
||||
|
||||
module.exports = promisified
|
||||
Loading…
Add table
Add a link
Reference in a new issue