@nocobase/plugin-backup-restore 1.6.32 → 1.6.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/externalVersion.js +5 -5
  2. package/dist/node_modules/@hapi/topo/package.json +1 -1
  3. package/dist/node_modules/archiver/package.json +1 -1
  4. package/dist/node_modules/decompress/package.json +1 -1
  5. package/dist/node_modules/fs-extra/LICENSE +15 -0
  6. package/dist/node_modules/fs-extra/lib/copy/copy.js +232 -0
  7. package/dist/node_modules/fs-extra/lib/copy/index.js +6 -0
  8. package/dist/node_modules/fs-extra/lib/copy-sync/copy-sync.js +166 -0
  9. package/dist/node_modules/fs-extra/lib/copy-sync/index.js +5 -0
  10. package/dist/node_modules/fs-extra/lib/empty/index.js +48 -0
  11. package/dist/node_modules/fs-extra/lib/ensure/file.js +69 -0
  12. package/dist/node_modules/fs-extra/lib/ensure/index.js +23 -0
  13. package/dist/node_modules/fs-extra/lib/ensure/link.js +61 -0
  14. package/dist/node_modules/fs-extra/lib/ensure/symlink-paths.js +99 -0
  15. package/dist/node_modules/fs-extra/lib/ensure/symlink-type.js +31 -0
  16. package/dist/node_modules/fs-extra/lib/ensure/symlink.js +63 -0
  17. package/dist/node_modules/fs-extra/lib/fs/index.js +130 -0
  18. package/dist/node_modules/fs-extra/lib/index.js +1 -0
  19. package/dist/node_modules/fs-extra/lib/json/index.js +16 -0
  20. package/dist/node_modules/fs-extra/lib/json/jsonfile.js +11 -0
  21. package/dist/node_modules/fs-extra/lib/json/output-json-sync.js +12 -0
  22. package/dist/node_modules/fs-extra/lib/json/output-json.js +12 -0
  23. package/dist/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
  24. package/dist/node_modules/fs-extra/lib/mkdirs/make-dir.js +141 -0
  25. package/dist/node_modules/fs-extra/lib/move/index.js +6 -0
  26. package/dist/node_modules/fs-extra/lib/move/move.js +65 -0
  27. package/dist/node_modules/fs-extra/lib/move-sync/index.js +5 -0
  28. package/dist/node_modules/fs-extra/lib/move-sync/move-sync.js +47 -0
  29. package/dist/node_modules/fs-extra/lib/output/index.js +40 -0
  30. package/dist/node_modules/fs-extra/lib/path-exists/index.js +12 -0
  31. package/dist/node_modules/fs-extra/lib/remove/index.js +9 -0
  32. package/dist/node_modules/fs-extra/lib/remove/rimraf.js +302 -0
  33. package/dist/node_modules/fs-extra/lib/util/stat.js +139 -0
  34. package/dist/node_modules/fs-extra/lib/util/utimes.js +26 -0
  35. package/dist/node_modules/fs-extra/package.json +1 -0
  36. package/dist/node_modules/moment/package.json +1 -1
  37. package/dist/node_modules/semver/package.json +1 -1
  38. package/dist/server/dumper.js +3 -3
  39. package/package.json +2 -2
  40. package/dist/node_modules/mkdirp/LICENSE +0 -21
  41. package/dist/node_modules/mkdirp/bin/cmd.js +0 -68
  42. package/dist/node_modules/mkdirp/index.js +0 -1
  43. package/dist/node_modules/mkdirp/lib/find-made.js +0 -29
  44. package/dist/node_modules/mkdirp/lib/mkdirp-manual.js +0 -64
  45. package/dist/node_modules/mkdirp/lib/mkdirp-native.js +0 -39
  46. package/dist/node_modules/mkdirp/lib/opts-arg.js +0 -23
  47. package/dist/node_modules/mkdirp/lib/path-arg.js +0 -29
  48. package/dist/node_modules/mkdirp/lib/use-native.js +0 -10
  49. package/dist/node_modules/mkdirp/package.json +0 -1
  50. package/dist/node_modules/mkdirp/readme.markdown +0 -266
@@ -0,0 +1,99 @@
1
+ 'use strict'
2
+
3
+ const path = require('path')
4
+ const fs = require('graceful-fs')
5
+ const pathExists = require('../path-exists').pathExists
6
+
7
+ /**
8
+ * Function that returns two types of paths, one relative to symlink, and one
9
+ * relative to the current working directory. Checks if path is absolute or
10
+ * relative. If the path is relative, this function checks if the path is
11
+ * relative to symlink or relative to current working directory. This is an
12
+ * initiative to find a smarter `srcpath` to supply when building symlinks.
13
+ * This allows you to determine which path to use out of one of three possible
14
+ * types of source paths. The first is an absolute path. This is detected by
15
+ * `path.isAbsolute()`. When an absolute path is provided, it is checked to
16
+ * see if it exists. If it does it's used, if not an error is returned
17
+ * (callback)/ thrown (sync). The other two options for `srcpath` are a
18
+ * relative url. By default Node's `fs.symlink` works by creating a symlink
19
+ * using `dstpath` and expects the `srcpath` to be relative to the newly
20
+ * created symlink. If you provide a `srcpath` that does not exist on the file
21
+ * system it results in a broken symlink. To minimize this, the function
22
+ * checks to see if the 'relative to symlink' source file exists, and if it
23
+ * does it will use it. If it does not, it checks if there's a file that
24
+ * exists that is relative to the current working directory, if does its used.
25
+ * This preserves the expectations of the original fs.symlink spec and adds
26
+ * the ability to pass in `relative to current working direcotry` paths.
27
+ */
28
+
29
+ function symlinkPaths (srcpath, dstpath, callback) {
30
+ if (path.isAbsolute(srcpath)) {
31
+ return fs.lstat(srcpath, (err) => {
32
+ if (err) {
33
+ err.message = err.message.replace('lstat', 'ensureSymlink')
34
+ return callback(err)
35
+ }
36
+ return callback(null, {
37
+ toCwd: srcpath,
38
+ toDst: srcpath
39
+ })
40
+ })
41
+ } else {
42
+ const dstdir = path.dirname(dstpath)
43
+ const relativeToDst = path.join(dstdir, srcpath)
44
+ return pathExists(relativeToDst, (err, exists) => {
45
+ if (err) return callback(err)
46
+ if (exists) {
47
+ return callback(null, {
48
+ toCwd: relativeToDst,
49
+ toDst: srcpath
50
+ })
51
+ } else {
52
+ return fs.lstat(srcpath, (err) => {
53
+ if (err) {
54
+ err.message = err.message.replace('lstat', 'ensureSymlink')
55
+ return callback(err)
56
+ }
57
+ return callback(null, {
58
+ toCwd: srcpath,
59
+ toDst: path.relative(dstdir, srcpath)
60
+ })
61
+ })
62
+ }
63
+ })
64
+ }
65
+ }
66
+
67
+ function symlinkPathsSync (srcpath, dstpath) {
68
+ let exists
69
+ if (path.isAbsolute(srcpath)) {
70
+ exists = fs.existsSync(srcpath)
71
+ if (!exists) throw new Error('absolute srcpath does not exist')
72
+ return {
73
+ toCwd: srcpath,
74
+ toDst: srcpath
75
+ }
76
+ } else {
77
+ const dstdir = path.dirname(dstpath)
78
+ const relativeToDst = path.join(dstdir, srcpath)
79
+ exists = fs.existsSync(relativeToDst)
80
+ if (exists) {
81
+ return {
82
+ toCwd: relativeToDst,
83
+ toDst: srcpath
84
+ }
85
+ } else {
86
+ exists = fs.existsSync(srcpath)
87
+ if (!exists) throw new Error('relative srcpath does not exist')
88
+ return {
89
+ toCwd: srcpath,
90
+ toDst: path.relative(dstdir, srcpath)
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ module.exports = {
97
+ symlinkPaths,
98
+ symlinkPathsSync
99
+ }
@@ -0,0 +1,31 @@
1
+ 'use strict'
2
+
3
+ const fs = require('graceful-fs')
4
+
5
+ function symlinkType (srcpath, type, callback) {
6
+ callback = (typeof type === 'function') ? type : callback
7
+ type = (typeof type === 'function') ? false : type
8
+ if (type) return callback(null, type)
9
+ fs.lstat(srcpath, (err, stats) => {
10
+ if (err) return callback(null, 'file')
11
+ type = (stats && stats.isDirectory()) ? 'dir' : 'file'
12
+ callback(null, type)
13
+ })
14
+ }
15
+
16
+ function symlinkTypeSync (srcpath, type) {
17
+ let stats
18
+
19
+ if (type) return type
20
+ try {
21
+ stats = fs.lstatSync(srcpath)
22
+ } catch {
23
+ return 'file'
24
+ }
25
+ return (stats && stats.isDirectory()) ? 'dir' : 'file'
26
+ }
27
+
28
+ module.exports = {
29
+ symlinkType,
30
+ symlinkTypeSync
31
+ }
@@ -0,0 +1,63 @@
1
+ 'use strict'
2
+
3
+ const u = require('universalify').fromCallback
4
+ const path = require('path')
5
+ const fs = require('graceful-fs')
6
+ const _mkdirs = require('../mkdirs')
7
+ const mkdirs = _mkdirs.mkdirs
8
+ const mkdirsSync = _mkdirs.mkdirsSync
9
+
10
+ const _symlinkPaths = require('./symlink-paths')
11
+ const symlinkPaths = _symlinkPaths.symlinkPaths
12
+ const symlinkPathsSync = _symlinkPaths.symlinkPathsSync
13
+
14
+ const _symlinkType = require('./symlink-type')
15
+ const symlinkType = _symlinkType.symlinkType
16
+ const symlinkTypeSync = _symlinkType.symlinkTypeSync
17
+
18
+ const pathExists = require('../path-exists').pathExists
19
+
20
+ function createSymlink (srcpath, dstpath, type, callback) {
21
+ callback = (typeof type === 'function') ? type : callback
22
+ type = (typeof type === 'function') ? false : type
23
+
24
+ pathExists(dstpath, (err, destinationExists) => {
25
+ if (err) return callback(err)
26
+ if (destinationExists) return callback(null)
27
+ symlinkPaths(srcpath, dstpath, (err, relative) => {
28
+ if (err) return callback(err)
29
+ srcpath = relative.toDst
30
+ symlinkType(relative.toCwd, type, (err, type) => {
31
+ if (err) return callback(err)
32
+ const dir = path.dirname(dstpath)
33
+ pathExists(dir, (err, dirExists) => {
34
+ if (err) return callback(err)
35
+ if (dirExists) return fs.symlink(srcpath, dstpath, type, callback)
36
+ mkdirs(dir, err => {
37
+ if (err) return callback(err)
38
+ fs.symlink(srcpath, dstpath, type, callback)
39
+ })
40
+ })
41
+ })
42
+ })
43
+ })
44
+ }
45
+
46
+ function createSymlinkSync (srcpath, dstpath, type) {
47
+ const destinationExists = fs.existsSync(dstpath)
48
+ if (destinationExists) return undefined
49
+
50
+ const relative = symlinkPathsSync(srcpath, dstpath)
51
+ srcpath = relative.toDst
52
+ type = symlinkTypeSync(relative.toCwd, type)
53
+ const dir = path.dirname(dstpath)
54
+ const exists = fs.existsSync(dir)
55
+ if (exists) return fs.symlinkSync(srcpath, dstpath, type)
56
+ mkdirsSync(dir)
57
+ return fs.symlinkSync(srcpath, dstpath, type)
58
+ }
59
+
60
+ module.exports = {
61
+ createSymlink: u(createSymlink),
62
+ createSymlinkSync
63
+ }
@@ -0,0 +1,130 @@
1
+ 'use strict'
2
+ // This is adapted from https://github.com/normalize/mz
3
+ // Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors
4
+ const u = require('universalify').fromCallback
5
+ const fs = require('graceful-fs')
6
+
7
+ const api = [
8
+ 'access',
9
+ 'appendFile',
10
+ 'chmod',
11
+ 'chown',
12
+ 'close',
13
+ 'copyFile',
14
+ 'fchmod',
15
+ 'fchown',
16
+ 'fdatasync',
17
+ 'fstat',
18
+ 'fsync',
19
+ 'ftruncate',
20
+ 'futimes',
21
+ 'lchmod',
22
+ 'lchown',
23
+ 'link',
24
+ 'lstat',
25
+ 'mkdir',
26
+ 'mkdtemp',
27
+ 'open',
28
+ 'opendir',
29
+ 'readdir',
30
+ 'readFile',
31
+ 'readlink',
32
+ 'realpath',
33
+ 'rename',
34
+ 'rm',
35
+ 'rmdir',
36
+ 'stat',
37
+ 'symlink',
38
+ 'truncate',
39
+ 'unlink',
40
+ 'utimes',
41
+ 'writeFile'
42
+ ].filter(key => {
43
+ // Some commands are not available on some systems. Ex:
44
+ // fs.opendir was added in Node.js v12.12.0
45
+ // fs.rm was added in Node.js v14.14.0
46
+ // fs.lchown is not available on at least some Linux
47
+ return typeof fs[key] === 'function'
48
+ })
49
+
50
+ // Export all keys:
51
+ Object.keys(fs).forEach(key => {
52
+ if (key === 'promises') {
53
+ // fs.promises is a getter property that triggers ExperimentalWarning
54
+ // Don't re-export it here, the getter is defined in "lib/index.js"
55
+ return
56
+ }
57
+ exports[key] = fs[key]
58
+ })
59
+
60
+ // Universalify async methods:
61
+ api.forEach(method => {
62
+ exports[method] = u(fs[method])
63
+ })
64
+
65
+ // We differ from mz/fs in that we still ship the old, broken, fs.exists()
66
+ // since we are a drop-in replacement for the native module
67
+ exports.exists = function (filename, callback) {
68
+ if (typeof callback === 'function') {
69
+ return fs.exists(filename, callback)
70
+ }
71
+ return new Promise(resolve => {
72
+ return fs.exists(filename, resolve)
73
+ })
74
+ }
75
+
76
+ // fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args
77
+
78
+ exports.read = function (fd, buffer, offset, length, position, callback) {
79
+ if (typeof callback === 'function') {
80
+ return fs.read(fd, buffer, offset, length, position, callback)
81
+ }
82
+ return new Promise((resolve, reject) => {
83
+ fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {
84
+ if (err) return reject(err)
85
+ resolve({ bytesRead, buffer })
86
+ })
87
+ })
88
+ }
89
+
90
+ // Function signature can be
91
+ // fs.write(fd, buffer[, offset[, length[, position]]], callback)
92
+ // OR
93
+ // fs.write(fd, string[, position[, encoding]], callback)
94
+ // We need to handle both cases, so we use ...args
95
+ exports.write = function (fd, buffer, ...args) {
96
+ if (typeof args[args.length - 1] === 'function') {
97
+ return fs.write(fd, buffer, ...args)
98
+ }
99
+
100
+ return new Promise((resolve, reject) => {
101
+ fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {
102
+ if (err) return reject(err)
103
+ resolve({ bytesWritten, buffer })
104
+ })
105
+ })
106
+ }
107
+
108
+ // fs.writev only available in Node v12.9.0+
109
+ if (typeof fs.writev === 'function') {
110
+ // Function signature is
111
+ // s.writev(fd, buffers[, position], callback)
112
+ // We need to handle the optional arg, so we use ...args
113
+ exports.writev = function (fd, buffers, ...args) {
114
+ if (typeof args[args.length - 1] === 'function') {
115
+ return fs.writev(fd, buffers, ...args)
116
+ }
117
+
118
+ return new Promise((resolve, reject) => {
119
+ fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
120
+ if (err) return reject(err)
121
+ resolve({ bytesWritten, buffers })
122
+ })
123
+ })
124
+ }
125
+ }
126
+
127
+ // fs.realpath.native only available in Node v9.2+
128
+ if (typeof fs.realpath.native === 'function') {
129
+ exports.realpath.native = u(fs.realpath.native)
130
+ }
@@ -0,0 +1 @@
1
+ (function(){var e={995:function(e){e.exports=e=>{const t=process.versions.node.split(".").map((e=>parseInt(e,10)));e=e.split(".").map((e=>parseInt(e,10)));return t[0]>e[0]||t[0]===e[0]&&(t[1]>e[1]||t[1]===e[1]&&t[2]>=e[2])}},338:function(e,t,r){"use strict";const n=r(758);const i=r(17);const o=r(605).mkdirsSync;const c=r(548).utimesMillisSync;const s=r(901);function copySync(e,t,r){if(typeof r==="function"){r={filter:r}}r=r||{};r.clobber="clobber"in r?!!r.clobber:true;r.overwrite="overwrite"in r?!!r.overwrite:r.clobber;if(r.preserveTimestamps&&process.arch==="ia32"){console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)}const{srcStat:n,destStat:i}=s.checkPathsSync(e,t,"copy");s.checkParentPathsSync(e,n,t,"copy");return handleFilterAndCopy(i,e,t,r)}function handleFilterAndCopy(e,t,r,c){if(c.filter&&!c.filter(t,r))return;const s=i.dirname(r);if(!n.existsSync(s))o(s);return startCopy(e,t,r,c)}function startCopy(e,t,r,n){if(n.filter&&!n.filter(t,r))return;return getStats(e,t,r,n)}function getStats(e,t,r,i){const o=i.dereference?n.statSync:n.lstatSync;const c=o(t);if(c.isDirectory())return onDir(c,e,t,r,i);else if(c.isFile()||c.isCharacterDevice()||c.isBlockDevice())return onFile(c,e,t,r,i);else if(c.isSymbolicLink())return onLink(e,t,r,i)}function onFile(e,t,r,n,i){if(!t)return copyFile(e,r,n,i);return mayCopyFile(e,r,n,i)}function mayCopyFile(e,t,r,i){if(i.overwrite){n.unlinkSync(r);return copyFile(e,t,r,i)}else if(i.errorOnExist){throw new Error(`'${r}' already exists`)}}function copyFile(e,t,r,i){n.copyFileSync(t,r);if(i.preserveTimestamps)handleTimestamps(e.mode,t,r);return setDestMode(r,e.mode)}function handleTimestamps(e,t,r){if(fileIsNotWritable(e))makeFileWritable(r,e);return setDestTimestamps(t,r)}function fileIsNotWritable(e){return(e&128)===0}function makeFileWritable(e,t){return setDestMode(e,t|128)}function setDestMode(e,t){return n.chmodSync(e,t)}function setDestTimestamps(e,t){const r=n.statSync(e);return c(t,r.atime,r.mtime)}function onDir(e,t,r,n,i){if(!t)return mkDirAndCopy(e.mode,r,n,i);if(t&&!t.isDirectory()){throw new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`)}return copyDir(r,n,i)}function mkDirAndCopy(e,t,r,i){n.mkdirSync(r);copyDir(t,r,i);return setDestMode(r,e)}function copyDir(e,t,r){n.readdirSync(e).forEach((n=>copyDirItem(n,e,t,r)))}function copyDirItem(e,t,r,n){const o=i.join(t,e);const c=i.join(r,e);const{destStat:u}=s.checkPathsSync(o,c,"copy");return startCopy(u,o,c,n)}function onLink(e,t,r,o){let c=n.readlinkSync(t);if(o.dereference){c=i.resolve(process.cwd(),c)}if(!e){return n.symlinkSync(c,r)}else{let e;try{e=n.readlinkSync(r)}catch(e){if(e.code==="EINVAL"||e.code==="UNKNOWN")return n.symlinkSync(c,r);throw e}if(o.dereference){e=i.resolve(process.cwd(),e)}if(s.isSrcSubdir(c,e)){throw new Error(`Cannot copy '${c}' to a subdirectory of itself, '${e}'.`)}if(n.statSync(r).isDirectory()&&s.isSrcSubdir(e,c)){throw new Error(`Cannot overwrite '${e}' with '${c}'.`)}return copyLink(c,r)}}function copyLink(e,t){n.unlinkSync(t);return n.symlinkSync(e,t)}e.exports=copySync},135:function(e,t,r){"use strict";e.exports={copySync:r(338)}},834:function(e,t,r){"use strict";const n=r(758);const i=r(17);const o=r(605).mkdirs;const c=r(835).pathExists;const s=r(548).utimesMillis;const u=r(901);function copy(e,t,r,n){if(typeof r==="function"&&!n){n=r;r={}}else if(typeof r==="function"){r={filter:r}}n=n||function(){};r=r||{};r.clobber="clobber"in r?!!r.clobber:true;r.overwrite="overwrite"in r?!!r.overwrite:r.clobber;if(r.preserveTimestamps&&process.arch==="ia32"){console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)}u.checkPaths(e,t,"copy",((i,o)=>{if(i)return n(i);const{srcStat:c,destStat:s}=o;u.checkParentPaths(e,c,t,"copy",(i=>{if(i)return n(i);if(r.filter)return handleFilter(checkParentDir,s,e,t,r,n);return checkParentDir(s,e,t,r,n)}))}))}function checkParentDir(e,t,r,n,s){const u=i.dirname(r);c(u,((i,c)=>{if(i)return s(i);if(c)return startCopy(e,t,r,n,s);o(u,(i=>{if(i)return s(i);return startCopy(e,t,r,n,s)}))}))}function handleFilter(e,t,r,n,i,o){Promise.resolve(i.filter(r,n)).then((c=>{if(c)return e(t,r,n,i,o);return o()}),(e=>o(e)))}function startCopy(e,t,r,n,i){if(n.filter)return handleFilter(getStats,e,t,r,n,i);return getStats(e,t,r,n,i)}function getStats(e,t,r,i,o){const c=i.dereference?n.stat:n.lstat;c(t,((n,c)=>{if(n)return o(n);if(c.isDirectory())return onDir(c,e,t,r,i,o);else if(c.isFile()||c.isCharacterDevice()||c.isBlockDevice())return onFile(c,e,t,r,i,o);else if(c.isSymbolicLink())return onLink(e,t,r,i,o)}))}function onFile(e,t,r,n,i,o){if(!t)return copyFile(e,r,n,i,o);return mayCopyFile(e,r,n,i,o)}function mayCopyFile(e,t,r,i,o){if(i.overwrite){n.unlink(r,(n=>{if(n)return o(n);return copyFile(e,t,r,i,o)}))}else if(i.errorOnExist){return o(new Error(`'${r}' already exists`))}else return o()}function copyFile(e,t,r,i,o){n.copyFile(t,r,(n=>{if(n)return o(n);if(i.preserveTimestamps)return handleTimestampsAndMode(e.mode,t,r,o);return setDestMode(r,e.mode,o)}))}function handleTimestampsAndMode(e,t,r,n){if(fileIsNotWritable(e)){return makeFileWritable(r,e,(i=>{if(i)return n(i);return setDestTimestampsAndMode(e,t,r,n)}))}return setDestTimestampsAndMode(e,t,r,n)}function fileIsNotWritable(e){return(e&128)===0}function makeFileWritable(e,t,r){return setDestMode(e,t|128,r)}function setDestTimestampsAndMode(e,t,r,n){setDestTimestamps(t,r,(t=>{if(t)return n(t);return setDestMode(r,e,n)}))}function setDestMode(e,t,r){return n.chmod(e,t,r)}function setDestTimestamps(e,t,r){n.stat(e,((e,n)=>{if(e)return r(e);return s(t,n.atime,n.mtime,r)}))}function onDir(e,t,r,n,i,o){if(!t)return mkDirAndCopy(e.mode,r,n,i,o);if(t&&!t.isDirectory()){return o(new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`))}return copyDir(r,n,i,o)}function mkDirAndCopy(e,t,r,i,o){n.mkdir(r,(n=>{if(n)return o(n);copyDir(t,r,i,(t=>{if(t)return o(t);return setDestMode(r,e,o)}))}))}function copyDir(e,t,r,i){n.readdir(e,((n,o)=>{if(n)return i(n);return copyDirItems(o,e,t,r,i)}))}function copyDirItems(e,t,r,n,i){const o=e.pop();if(!o)return i();return copyDirItem(e,o,t,r,n,i)}function copyDirItem(e,t,r,n,o,c){const s=i.join(r,t);const a=i.join(n,t);u.checkPaths(s,a,"copy",((t,i)=>{if(t)return c(t);const{destStat:u}=i;startCopy(u,s,a,o,(t=>{if(t)return c(t);return copyDirItems(e,r,n,o,c)}))}))}function onLink(e,t,r,o,c){n.readlink(t,((t,s)=>{if(t)return c(t);if(o.dereference){s=i.resolve(process.cwd(),s)}if(!e){return n.symlink(s,r,c)}else{n.readlink(r,((t,a)=>{if(t){if(t.code==="EINVAL"||t.code==="UNKNOWN")return n.symlink(s,r,c);return c(t)}if(o.dereference){a=i.resolve(process.cwd(),a)}if(u.isSrcSubdir(s,a)){return c(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${a}'.`))}if(e.isDirectory()&&u.isSrcSubdir(a,s)){return c(new Error(`Cannot overwrite '${a}' with '${s}'.`))}return copyLink(s,r,c)}))}}))}function copyLink(e,t,r){n.unlink(t,(i=>{if(i)return r(i);return n.symlink(e,t,r)}))}e.exports=copy},335:function(e,t,r){"use strict";const n=r(46).fromCallback;e.exports={copy:n(r(834))}},970:function(e,t,r){"use strict";const n=r(46).fromCallback;const i=r(758);const o=r(17);const c=r(605);const s=r(357);const u=n((function emptyDir(e,t){t=t||function(){};i.readdir(e,((r,n)=>{if(r)return c.mkdirs(e,t);n=n.map((t=>o.join(e,t)));deleteItem();function deleteItem(){const e=n.pop();if(!e)return t();s.remove(e,(e=>{if(e)return t(e);deleteItem()}))}}))}));function emptyDirSync(e){let t;try{t=i.readdirSync(e)}catch{return c.mkdirsSync(e)}t.forEach((t=>{t=o.join(e,t);s.removeSync(t)}))}e.exports={emptyDirSync:emptyDirSync,emptydirSync:emptyDirSync,emptyDir:u,emptydir:u}},164:function(e,t,r){"use strict";const n=r(46).fromCallback;const i=r(17);const o=r(758);const c=r(605);function createFile(e,t){function makeFile(){o.writeFile(e,"",(e=>{if(e)return t(e);t()}))}o.stat(e,((r,n)=>{if(!r&&n.isFile())return t();const s=i.dirname(e);o.stat(s,((e,r)=>{if(e){if(e.code==="ENOENT"){return c.mkdirs(s,(e=>{if(e)return t(e);makeFile()}))}return t(e)}if(r.isDirectory())makeFile();else{o.readdir(s,(e=>{if(e)return t(e)}))}}))}))}function createFileSync(e){let t;try{t=o.statSync(e)}catch{}if(t&&t.isFile())return;const r=i.dirname(e);try{if(!o.statSync(r).isDirectory()){o.readdirSync(r)}}catch(e){if(e&&e.code==="ENOENT")c.mkdirsSync(r);else throw e}o.writeFileSync(e,"")}e.exports={createFile:n(createFile),createFileSync:createFileSync}},55:function(e,t,r){"use strict";const n=r(164);const i=r(797);const o=r(549);e.exports={createFile:n.createFile,createFileSync:n.createFileSync,ensureFile:n.createFile,ensureFileSync:n.createFileSync,createLink:i.createLink,createLinkSync:i.createLinkSync,ensureLink:i.createLink,ensureLinkSync:i.createLinkSync,createSymlink:o.createSymlink,createSymlinkSync:o.createSymlinkSync,ensureSymlink:o.createSymlink,ensureSymlinkSync:o.createSymlinkSync}},797:function(e,t,r){"use strict";const n=r(46).fromCallback;const i=r(17);const o=r(758);const c=r(605);const s=r(835).pathExists;function createLink(e,t,r){function makeLink(e,t){o.link(e,t,(e=>{if(e)return r(e);r(null)}))}s(t,((n,u)=>{if(n)return r(n);if(u)return r(null);o.lstat(e,(n=>{if(n){n.message=n.message.replace("lstat","ensureLink");return r(n)}const o=i.dirname(t);s(o,((n,i)=>{if(n)return r(n);if(i)return makeLink(e,t);c.mkdirs(o,(n=>{if(n)return r(n);makeLink(e,t)}))}))}))}))}function createLinkSync(e,t){const r=o.existsSync(t);if(r)return undefined;try{o.lstatSync(e)}catch(e){e.message=e.message.replace("lstat","ensureLink");throw e}const n=i.dirname(t);const s=o.existsSync(n);if(s)return o.linkSync(e,t);c.mkdirsSync(n);return o.linkSync(e,t)}e.exports={createLink:n(createLink),createLinkSync:createLinkSync}},727:function(e,t,r){"use strict";const n=r(17);const i=r(758);const o=r(835).pathExists;function symlinkPaths(e,t,r){if(n.isAbsolute(e)){return i.lstat(e,(t=>{if(t){t.message=t.message.replace("lstat","ensureSymlink");return r(t)}return r(null,{toCwd:e,toDst:e})}))}else{const c=n.dirname(t);const s=n.join(c,e);return o(s,((t,o)=>{if(t)return r(t);if(o){return r(null,{toCwd:s,toDst:e})}else{return i.lstat(e,(t=>{if(t){t.message=t.message.replace("lstat","ensureSymlink");return r(t)}return r(null,{toCwd:e,toDst:n.relative(c,e)})}))}}))}}function symlinkPathsSync(e,t){let r;if(n.isAbsolute(e)){r=i.existsSync(e);if(!r)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}else{const o=n.dirname(t);const c=n.join(o,e);r=i.existsSync(c);if(r){return{toCwd:c,toDst:e}}else{r=i.existsSync(e);if(!r)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:n.relative(o,e)}}}}e.exports={symlinkPaths:symlinkPaths,symlinkPathsSync:symlinkPathsSync}},254:function(e,t,r){"use strict";const n=r(758);function symlinkType(e,t,r){r=typeof t==="function"?t:r;t=typeof t==="function"?false:t;if(t)return r(null,t);n.lstat(e,((e,n)=>{if(e)return r(null,"file");t=n&&n.isDirectory()?"dir":"file";r(null,t)}))}function symlinkTypeSync(e,t){let r;if(t)return t;try{r=n.lstatSync(e)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}e.exports={symlinkType:symlinkType,symlinkTypeSync:symlinkTypeSync}},549:function(e,t,r){"use strict";const n=r(46).fromCallback;const i=r(17);const o=r(758);const c=r(605);const s=c.mkdirs;const u=c.mkdirsSync;const a=r(727);const f=a.symlinkPaths;const l=a.symlinkPathsSync;const y=r(254);const d=y.symlinkType;const m=y.symlinkTypeSync;const p=r(835).pathExists;function createSymlink(e,t,r,n){n=typeof r==="function"?r:n;r=typeof r==="function"?false:r;p(t,((c,u)=>{if(c)return n(c);if(u)return n(null);f(e,t,((c,u)=>{if(c)return n(c);e=u.toDst;d(u.toCwd,r,((r,c)=>{if(r)return n(r);const u=i.dirname(t);p(u,((r,i)=>{if(r)return n(r);if(i)return o.symlink(e,t,c,n);s(u,(r=>{if(r)return n(r);o.symlink(e,t,c,n)}))}))}))}))}))}function createSymlinkSync(e,t,r){const n=o.existsSync(t);if(n)return undefined;const c=l(e,t);e=c.toDst;r=m(c.toCwd,r);const s=i.dirname(t);const a=o.existsSync(s);if(a)return o.symlinkSync(e,t,r);u(s);return o.symlinkSync(e,t,r)}e.exports={createSymlink:n(createSymlink),createSymlinkSync:createSymlinkSync}},176:function(e,t,r){"use strict";const n=r(46).fromCallback;const i=r(758);const o=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>typeof i[e]==="function"));Object.keys(i).forEach((e=>{if(e==="promises"){return}t[e]=i[e]}));o.forEach((e=>{t[e]=n(i[e])}));t.exists=function(e,t){if(typeof t==="function"){return i.exists(e,t)}return new Promise((t=>i.exists(e,t)))};t.read=function(e,t,r,n,o,c){if(typeof c==="function"){return i.read(e,t,r,n,o,c)}return new Promise(((c,s)=>{i.read(e,t,r,n,o,((e,t,r)=>{if(e)return s(e);c({bytesRead:t,buffer:r})}))}))};t.write=function(e,t,...r){if(typeof r[r.length-1]==="function"){return i.write(e,t,...r)}return new Promise(((n,o)=>{i.write(e,t,...r,((e,t,r)=>{if(e)return o(e);n({bytesWritten:t,buffer:r})}))}))};if(typeof i.writev==="function"){t.writev=function(e,t,...r){if(typeof r[r.length-1]==="function"){return i.writev(e,t,...r)}return new Promise(((n,o)=>{i.writev(e,t,...r,((e,t,r)=>{if(e)return o(e);n({bytesWritten:t,buffers:r})}))}))}}if(typeof i.realpath.native==="function"){t.realpath.native=n(i.realpath.native)}},630:function(e,t,r){"use strict";e.exports={...r(176),...r(135),...r(335),...r(970),...r(55),...r(213),...r(605),...r(665),...r(497),...r(570),...r(835),...r(357)};const n=r(147);if(Object.getOwnPropertyDescriptor(n,"promises")){Object.defineProperty(e.exports,"promises",{get(){return n.promises}})}},213:function(e,t,r){"use strict";const n=r(46).fromPromise;const i=r(544);i.outputJson=n(r(531));i.outputJsonSync=r(421);i.outputJSON=i.outputJson;i.outputJSONSync=i.outputJsonSync;i.writeJSON=i.writeJson;i.writeJSONSync=i.writeJsonSync;i.readJSON=i.readJson;i.readJSONSync=i.readJsonSync;e.exports=i},544:function(e,t,r){"use strict";const n=r(160);e.exports={readJson:n.readFile,readJsonSync:n.readFileSync,writeJson:n.writeFile,writeJsonSync:n.writeFileSync}},421:function(e,t,r){"use strict";const{stringify:n}=r(902);const{outputFileSync:i}=r(570);function outputJsonSync(e,t,r){const o=n(t,r);i(e,o,r)}e.exports=outputJsonSync},531:function(e,t,r){"use strict";const{stringify:n}=r(902);const{outputFile:i}=r(570);async function outputJson(e,t,r={}){const o=n(t,r);await i(e,o,r)}e.exports=outputJson},605:function(e,t,r){"use strict";const n=r(46).fromPromise;const{makeDir:i,makeDirSync:o}=r(751);const c=n(i);e.exports={mkdirs:c,mkdirsSync:o,mkdirp:c,mkdirpSync:o,ensureDir:c,ensureDirSync:o}},751:function(e,t,r){"use strict";const n=r(176);const i=r(17);const o=r(995);const c=o("10.12.0");const checkPath=e=>{if(process.platform==="win32"){const t=/[<>:"|?*]/.test(e.replace(i.parse(e).root,""));if(t){const t=new Error(`Path contains invalid characters: ${e}`);t.code="EINVAL";throw t}}};const processOptions=e=>{const t={mode:511};if(typeof e==="number")e={mode:e};return{...t,...e}};const permissionError=e=>{const t=new Error(`operation not permitted, mkdir '${e}'`);t.code="EPERM";t.errno=-4048;t.path=e;t.syscall="mkdir";return t};e.exports.makeDir=async(e,t)=>{checkPath(e);t=processOptions(t);if(c){const r=i.resolve(e);return n.mkdir(r,{mode:t.mode,recursive:true})}const make=async e=>{try{await n.mkdir(e,t.mode)}catch(t){if(t.code==="EPERM"){throw t}if(t.code==="ENOENT"){if(i.dirname(e)===e){throw permissionError(e)}if(t.message.includes("null bytes")){throw t}await make(i.dirname(e));return make(e)}try{const t=await n.stat(e);if(!t.isDirectory()){throw new Error("The path is not a directory")}}catch{throw t}}};return make(i.resolve(e))};e.exports.makeDirSync=(e,t)=>{checkPath(e);t=processOptions(t);if(c){const r=i.resolve(e);return n.mkdirSync(r,{mode:t.mode,recursive:true})}const make=e=>{try{n.mkdirSync(e,t.mode)}catch(t){if(t.code==="EPERM"){throw t}if(t.code==="ENOENT"){if(i.dirname(e)===e){throw permissionError(e)}if(t.message.includes("null bytes")){throw t}make(i.dirname(e));return make(e)}try{if(!n.statSync(e).isDirectory()){throw new Error("The path is not a directory")}}catch{throw t}}};return make(i.resolve(e))}},665:function(e,t,r){"use strict";e.exports={moveSync:r(445)}},445:function(e,t,r){"use strict";const n=r(758);const i=r(17);const o=r(135).copySync;const c=r(357).removeSync;const s=r(605).mkdirpSync;const u=r(901);function moveSync(e,t,r){r=r||{};const n=r.overwrite||r.clobber||false;const{srcStat:o}=u.checkPathsSync(e,t,"move");u.checkParentPathsSync(e,o,t,"move");s(i.dirname(t));return doRename(e,t,n)}function doRename(e,t,r){if(r){c(t);return rename(e,t,r)}if(n.existsSync(t))throw new Error("dest already exists.");return rename(e,t,r)}function rename(e,t,r){try{n.renameSync(e,t)}catch(n){if(n.code!=="EXDEV")throw n;return moveAcrossDevice(e,t,r)}}function moveAcrossDevice(e,t,r){const n={overwrite:r,errorOnExist:true};o(e,t,n);return c(e)}e.exports=moveSync},497:function(e,t,r){"use strict";const n=r(46).fromCallback;e.exports={move:n(r(231))}},231:function(e,t,r){"use strict";const n=r(758);const i=r(17);const o=r(335).copy;const c=r(357).remove;const s=r(605).mkdirp;const u=r(835).pathExists;const a=r(901);function move(e,t,r,n){if(typeof r==="function"){n=r;r={}}const o=r.overwrite||r.clobber||false;a.checkPaths(e,t,"move",((r,c)=>{if(r)return n(r);const{srcStat:u}=c;a.checkParentPaths(e,u,t,"move",(r=>{if(r)return n(r);s(i.dirname(t),(r=>{if(r)return n(r);return doRename(e,t,o,n)}))}))}))}function doRename(e,t,r,n){if(r){return c(t,(i=>{if(i)return n(i);return rename(e,t,r,n)}))}u(t,((i,o)=>{if(i)return n(i);if(o)return n(new Error("dest already exists."));return rename(e,t,r,n)}))}function rename(e,t,r,i){n.rename(e,t,(n=>{if(!n)return i();if(n.code!=="EXDEV")return i(n);return moveAcrossDevice(e,t,r,i)}))}function moveAcrossDevice(e,t,r,n){const i={overwrite:r,errorOnExist:true};o(e,t,i,(t=>{if(t)return n(t);return c(e,n)}))}e.exports=move},570:function(e,t,r){"use strict";const n=r(46).fromCallback;const i=r(758);const o=r(17);const c=r(605);const s=r(835).pathExists;function outputFile(e,t,r,n){if(typeof r==="function"){n=r;r="utf8"}const u=o.dirname(e);s(u,((o,s)=>{if(o)return n(o);if(s)return i.writeFile(e,t,r,n);c.mkdirs(u,(o=>{if(o)return n(o);i.writeFile(e,t,r,n)}))}))}function outputFileSync(e,...t){const r=o.dirname(e);if(i.existsSync(r)){return i.writeFileSync(e,...t)}c.mkdirsSync(r);i.writeFileSync(e,...t)}e.exports={outputFile:n(outputFile),outputFileSync:outputFileSync}},835:function(e,t,r){"use strict";const n=r(46).fromPromise;const i=r(176);function pathExists(e){return i.access(e).then((()=>true)).catch((()=>false))}e.exports={pathExists:n(pathExists),pathExistsSync:i.existsSync}},357:function(e,t,r){"use strict";const n=r(46).fromCallback;const i=r(761);e.exports={remove:n(i),removeSync:i.sync}},761:function(e,t,r){"use strict";const n=r(758);const i=r(17);const o=r(491);const c=process.platform==="win32";function defaults(e){const t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((t=>{e[t]=e[t]||n[t];t=t+"Sync";e[t]=e[t]||n[t]}));e.maxBusyTries=e.maxBusyTries||3}function rimraf(e,t,r){let n=0;if(typeof t==="function"){r=t;t={}}o(e,"rimraf: missing path");o.strictEqual(typeof e,"string","rimraf: path should be a string");o.strictEqual(typeof r,"function","rimraf: callback function required");o(t,"rimraf: invalid options argument provided");o.strictEqual(typeof t,"object","rimraf: options should be object");defaults(t);rimraf_(e,t,(function CB(i){if(i){if((i.code==="EBUSY"||i.code==="ENOTEMPTY"||i.code==="EPERM")&&n<t.maxBusyTries){n++;const r=n*100;return setTimeout((()=>rimraf_(e,t,CB)),r)}if(i.code==="ENOENT")i=null}r(i)}))}function rimraf_(e,t,r){o(e);o(t);o(typeof r==="function");t.lstat(e,((n,i)=>{if(n&&n.code==="ENOENT"){return r(null)}if(n&&n.code==="EPERM"&&c){return fixWinEPERM(e,t,n,r)}if(i&&i.isDirectory()){return rmdir(e,t,n,r)}t.unlink(e,(n=>{if(n){if(n.code==="ENOENT"){return r(null)}if(n.code==="EPERM"){return c?fixWinEPERM(e,t,n,r):rmdir(e,t,n,r)}if(n.code==="EISDIR"){return rmdir(e,t,n,r)}}return r(n)}))}))}function fixWinEPERM(e,t,r,n){o(e);o(t);o(typeof n==="function");t.chmod(e,438,(i=>{if(i){n(i.code==="ENOENT"?null:r)}else{t.stat(e,((i,o)=>{if(i){n(i.code==="ENOENT"?null:r)}else if(o.isDirectory()){rmdir(e,t,r,n)}else{t.unlink(e,n)}}))}}))}function fixWinEPERMSync(e,t,r){let n;o(e);o(t);try{t.chmodSync(e,438)}catch(e){if(e.code==="ENOENT"){return}else{throw r}}try{n=t.statSync(e)}catch(e){if(e.code==="ENOENT"){return}else{throw r}}if(n.isDirectory()){rmdirSync(e,t,r)}else{t.unlinkSync(e)}}function rmdir(e,t,r,n){o(e);o(t);o(typeof n==="function");t.rmdir(e,(i=>{if(i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")){rmkids(e,t,n)}else if(i&&i.code==="ENOTDIR"){n(r)}else{n(i)}}))}function rmkids(e,t,r){o(e);o(t);o(typeof r==="function");t.readdir(e,((n,o)=>{if(n)return r(n);let c=o.length;let s;if(c===0)return t.rmdir(e,r);o.forEach((n=>{rimraf(i.join(e,n),t,(n=>{if(s){return}if(n)return r(s=n);if(--c===0){t.rmdir(e,r)}}))}))}))}function rimrafSync(e,t){let r;t=t||{};defaults(t);o(e,"rimraf: missing path");o.strictEqual(typeof e,"string","rimraf: path should be a string");o(t,"rimraf: missing options");o.strictEqual(typeof t,"object","rimraf: options should be object");try{r=t.lstatSync(e)}catch(r){if(r.code==="ENOENT"){return}if(r.code==="EPERM"&&c){fixWinEPERMSync(e,t,r)}}try{if(r&&r.isDirectory()){rmdirSync(e,t,null)}else{t.unlinkSync(e)}}catch(r){if(r.code==="ENOENT"){return}else if(r.code==="EPERM"){return c?fixWinEPERMSync(e,t,r):rmdirSync(e,t,r)}else if(r.code!=="EISDIR"){throw r}rmdirSync(e,t,r)}}function rmdirSync(e,t,r){o(e);o(t);try{t.rmdirSync(e)}catch(n){if(n.code==="ENOTDIR"){throw r}else if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM"){rmkidsSync(e,t)}else if(n.code!=="ENOENT"){throw n}}}function rmkidsSync(e,t){o(e);o(t);t.readdirSync(e).forEach((r=>rimrafSync(i.join(e,r),t)));if(c){const r=Date.now();do{try{const r=t.rmdirSync(e,t);return r}catch{}}while(Date.now()-r<500)}else{const r=t.rmdirSync(e,t);return r}}e.exports=rimraf;rimraf.sync=rimrafSync},901:function(e,t,r){"use strict";const n=r(176);const i=r(17);const o=r(837);const c=r(995);const s=c("10.5.0");const stat=e=>s?n.stat(e,{bigint:true}):n.stat(e);const statSync=e=>s?n.statSync(e,{bigint:true}):n.statSync(e);function getStats(e,t){return Promise.all([stat(e),stat(t).catch((e=>{if(e.code==="ENOENT")return null;throw e}))]).then((([e,t])=>({srcStat:e,destStat:t})))}function getStatsSync(e,t){let r;const n=statSync(e);try{r=statSync(t)}catch(e){if(e.code==="ENOENT")return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}function checkPaths(e,t,r,n){o.callbackify(getStats)(e,t,((i,o)=>{if(i)return n(i);const{srcStat:c,destStat:s}=o;if(s&&areIdentical(c,s)){return n(new Error("Source and destination must not be the same."))}if(c.isDirectory()&&isSrcSubdir(e,t)){return n(new Error(errMsg(e,t,r)))}return n(null,{srcStat:c,destStat:s})}))}function checkPathsSync(e,t,r){const{srcStat:n,destStat:i}=getStatsSync(e,t);if(i&&areIdentical(n,i)){throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&isSrcSubdir(e,t)){throw new Error(errMsg(e,t,r))}return{srcStat:n,destStat:i}}function checkParentPaths(e,t,r,o,c){const u=i.resolve(i.dirname(e));const a=i.resolve(i.dirname(r));if(a===u||a===i.parse(a).root)return c();const callback=(n,i)=>{if(n){if(n.code==="ENOENT")return c();return c(n)}if(areIdentical(t,i)){return c(new Error(errMsg(e,r,o)))}return checkParentPaths(e,t,a,o,c)};if(s)n.stat(a,{bigint:true},callback);else n.stat(a,callback)}function checkParentPathsSync(e,t,r,n){const o=i.resolve(i.dirname(e));const c=i.resolve(i.dirname(r));if(c===o||c===i.parse(c).root)return;let s;try{s=statSync(c)}catch(e){if(e.code==="ENOENT")return;throw e}if(areIdentical(t,s)){throw new Error(errMsg(e,r,n))}return checkParentPathsSync(e,t,c,n)}function areIdentical(e,t){if(t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev){if(s||t.ino<Number.MAX_SAFE_INTEGER){return true}if(t.size===e.size&&t.mode===e.mode&&t.nlink===e.nlink&&t.atimeMs===e.atimeMs&&t.mtimeMs===e.mtimeMs&&t.ctimeMs===e.ctimeMs&&t.birthtimeMs===e.birthtimeMs){return true}}return false}function isSrcSubdir(e,t){const r=i.resolve(e).split(i.sep).filter((e=>e));const n=i.resolve(t).split(i.sep).filter((e=>e));return r.reduce(((e,t,r)=>e&&n[r]===t),true)}function errMsg(e,t,r){return`Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`}e.exports={checkPaths:checkPaths,checkPathsSync:checkPathsSync,checkParentPaths:checkParentPaths,checkParentPathsSync:checkParentPathsSync,isSrcSubdir:isSrcSubdir}},548:function(e,t,r){"use strict";const n=r(758);function utimesMillis(e,t,r,i){n.open(e,"r+",((e,o)=>{if(e)return i(e);n.futimes(o,t,r,(e=>{n.close(o,(t=>{if(i)i(e||t)}))}))}))}function utimesMillisSync(e,t,r){const i=n.openSync(e,"r+");n.futimesSync(i,t,r);return n.closeSync(i)}e.exports={utimesMillis:utimesMillis,utimesMillisSync:utimesMillisSync}},356:function(e){"use strict";e.exports=clone;var t=Object.getPrototypeOf||function(e){return e.__proto__};function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var r={__proto__:t(e)};else var r=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}));return r}},758:function(e,t,r){var n=r(147);var i=r(263);var o=r(86);var c=r(356);var s=r(837);var u;var a;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){u=Symbol.for("graceful-fs.queue");a=Symbol.for("graceful-fs.previous")}else{u="___graceful-fs.queue";a="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,u,{get:function(){return t}})}var f=noop;if(s.debuglog)f=s.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))f=function(){var e=s.format.apply(s,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!n[u]){var l=global[u]||[];publishQueue(n,l);n.close=function(e){function close(t,r){return e.call(n,t,(function(e){if(!e){resetQueue()}if(typeof r==="function")r.apply(this,arguments)}))}Object.defineProperty(close,a,{value:e});return close}(n.close);n.closeSync=function(e){function closeSync(t){e.apply(n,arguments);resetQueue()}Object.defineProperty(closeSync,a,{value:e});return closeSync}(n.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){f(n[u]);r(491).equal(n[u].length,0)}))}}if(!global[u]){publishQueue(global,n[u])}e.exports=patch(c(n));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched){e.exports=patch(n);n.__patched=true}function patch(e){i(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,r,n){if(typeof r==="function")n=r,r=null;return go$readFile(e,r,n);function go$readFile(e,r,n,i){return t(e,r,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,r,n],t,i||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var r=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,n,i){if(typeof n==="function")i=n,n=null;return go$writeFile(e,t,n,i);function go$writeFile(e,t,n,i,o){return r(e,t,n,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$writeFile,[e,t,n,i],r,o||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}}))}}var n=e.appendFile;if(n)e.appendFile=appendFile;function appendFile(e,t,r,i){if(typeof r==="function")i=r,r=null;return go$appendFile(e,t,r,i);function go$appendFile(e,t,r,i,o){return n(e,t,r,(function(n){if(n&&(n.code==="EMFILE"||n.code==="ENFILE"))enqueue([go$appendFile,[e,t,r,i],n,o||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}}))}}var c=e.copyFile;if(c)e.copyFile=copyFile;function copyFile(e,t,r,n){if(typeof r==="function"){n=r;r=0}return go$copyFile(e,t,r,n);function go$copyFile(e,t,r,n,i){return c(e,t,r,(function(o){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$copyFile,[e,t,r,n],o,i||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var s=e.readdir;e.readdir=readdir;var u=/^v[0-5]\./;function readdir(e,t,r){if(typeof t==="function")r=t,t=null;var n=u.test(process.version)?function go$readdir(e,t,r,n){return s(e,fs$readdirCallback(e,t,r,n))}:function go$readdir(e,t,r,n){return s(e,t,fs$readdirCallback(e,t,r,n))};return n(e,t,r);function fs$readdirCallback(e,t,r,i){return function(o,c){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([n,[e,t,r],o,i||Date.now(),Date.now()]);else{if(c&&c.sort)c.sort();if(typeof r==="function")r.call(this,o,c)}}}}if(process.version.substr(0,4)==="v0.8"){var a=o(e);ReadStream=a.ReadStream;WriteStream=a.WriteStream}var f=e.ReadStream;if(f){ReadStream.prototype=Object.create(f.prototype);ReadStream.prototype.open=ReadStream$open}var l=e.WriteStream;if(l){WriteStream.prototype=Object.create(l.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var y=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return y},set:function(e){y=e},enumerable:true,configurable:true});var d=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return d},set:function(e){d=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return f.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return l.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r)}}))}function createReadStream(t,r){return new e.ReadStream(t,r)}function createWriteStream(t,r){return new e.WriteStream(t,r)}var m=e.open;e.open=open;function open(e,t,r,n){if(typeof r==="function")n=r,r=null;return go$open(e,t,r,n);function go$open(e,t,r,n,i){return m(e,t,r,(function(o,c){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$open,[e,t,r,n],o,i||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}return e}function enqueue(e){f("ENQUEUE",e[0].name,e[1]);n[u].push(e);retry()}var y;function resetQueue(){var e=Date.now();for(var t=0;t<n[u].length;++t){if(n[u][t].length>2){n[u][t][3]=e;n[u][t][4]=e}}retry()}function retry(){clearTimeout(y);y=undefined;if(n[u].length===0)return;var e=n[u].shift();var t=e[0];var r=e[1];var i=e[2];var o=e[3];var c=e[4];if(o===undefined){f("RETRY",t.name,r);t.apply(null,r)}else if(Date.now()-o>=6e4){f("TIMEOUT",t.name,r);var s=r.pop();if(typeof s==="function")s.call(null,i)}else{var a=Date.now()-c;var l=Math.max(c-o,1);var d=Math.min(l*1.2,100);if(a>=d){f("RETRY",t.name,r);t.apply(null,r.concat([o]))}else{n[u].push(e)}}if(y===undefined){y=setTimeout(retry,0)}}},86:function(e,t,r){var n=r(781).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,r){if(!(this instanceof ReadStream))return new ReadStream(t,r);n.call(this);var i=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;r=r||{};var o=Object.keys(r);for(var c=0,s=o.length;c<s;c++){var u=o[c];this[u]=r[u]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){i._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){i.emit("error",e);i.readable=false;return}i.fd=t;i.emit("open",t);i._read()}))}function WriteStream(t,r){if(!(this instanceof WriteStream))return new WriteStream(t,r);n.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;r=r||{};var i=Object.keys(r);for(var o=0,c=i.length;o<c;o++){var s=i[o];this[s]=r[s]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},263:function(e,t,r){var n=r(57);var i=process.cwd;var o=null;var c=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!o)o=i.call(process);return o};try{process.cwd()}catch(e){}if(typeof process.chdir==="function"){var s=process.chdir;process.chdir=function(e){o=null;s.call(process,e)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,s)}e.exports=patch;function patch(e){if(n.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(e.chmod&&!e.lchmod){e.lchmod=function(e,t,r){if(r)process.nextTick(r)};e.lchmodSync=function(){}}if(e.chown&&!e.lchown){e.lchown=function(e,t,r,n){if(n)process.nextTick(n)};e.lchownSync=function(){}}if(c==="win32"){e.rename=typeof e.rename!=="function"?e.rename:function(t){function rename(r,n,i){var o=Date.now();var c=0;t(r,n,(function CB(s){if(s&&(s.code==="EACCES"||s.code==="EPERM"||s.code==="EBUSY")&&Date.now()-o<6e4){setTimeout((function(){e.stat(n,(function(e,o){if(e&&e.code==="ENOENT")t(r,n,CB);else i(s)}))}),c);if(c<100)c+=10;return}if(i)i(s)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,t);return rename}(e.rename)}e.read=typeof e.read!=="function"?e.read:function(t){function read(r,n,i,o,c,s){var u;if(s&&typeof s==="function"){var a=0;u=function(f,l,y){if(f&&f.code==="EAGAIN"&&a<10){a++;return t.call(e,r,n,i,o,c,u)}s.apply(this,arguments)}}return t.call(e,r,n,i,o,c,u)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,t);return read}(e.read);e.readSync=typeof e.readSync!=="function"?e.readSync:function(t){return function(r,n,i,o,c){var s=0;while(true){try{return t.call(e,r,n,i,o,c)}catch(e){if(e.code==="EAGAIN"&&s<10){s++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,r,i){e.open(t,n.O_WRONLY|n.O_SYMLINK,r,(function(t,n){if(t){if(i)i(t);return}e.fchmod(n,r,(function(t){e.close(n,(function(e){if(i)i(t||e)}))}))}))};e.lchmodSync=function(t,r){var i=e.openSync(t,n.O_WRONLY|n.O_SYMLINK,r);var o=true;var c;try{c=e.fchmodSync(i,r);o=false}finally{if(o){try{e.closeSync(i)}catch(e){}}else{e.closeSync(i)}}return c}}function patchLutimes(e){if(n.hasOwnProperty("O_SYMLINK")&&e.futimes){e.lutimes=function(t,r,i,o){e.open(t,n.O_SYMLINK,(function(t,n){if(t){if(o)o(t);return}e.futimes(n,r,i,(function(t){e.close(n,(function(e){if(o)o(t||e)}))}))}))};e.lutimesSync=function(t,r,i){var o=e.openSync(t,n.O_SYMLINK);var c;var s=true;try{c=e.futimesSync(o,r,i);s=false}finally{if(s){try{e.closeSync(o)}catch(e){}}else{e.closeSync(o)}}return c}}else if(e.futimes){e.lutimes=function(e,t,r,n){if(n)process.nextTick(n)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(r,n,i){return t.call(e,r,n,(function(e){if(chownErOk(e))e=null;if(i)i.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(r,n){try{return t.call(e,r,n)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(r,n,i,o){return t.call(e,r,n,i,(function(e){if(chownErOk(e))e=null;if(o)o.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(r,n,i){try{return t.call(e,r,n,i)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(r,n,i){if(typeof n==="function"){i=n;n=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(i)i.apply(this,arguments)}return n?t.call(e,r,n,callback):t.call(e,r,callback)}}function statFixSync(t){if(!t)return t;return function(r,n){var i=n?t.call(e,r,n):t.call(e,r);if(i){if(i.uid<0)i.uid+=4294967296;if(i.gid<0)i.gid+=4294967296}return i}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},160:function(e,t,r){let n;try{n=r(758)}catch(e){n=r(147)}const i=r(46);const{stringify:o,stripBom:c}=r(902);async function _readFile(e,t={}){if(typeof t==="string"){t={encoding:t}}const r=t.fs||n;const o="throws"in t?t.throws:true;let s=await i.fromCallback(r.readFile)(e,t);s=c(s);let u;try{u=JSON.parse(s,t?t.reviver:null)}catch(t){if(o){t.message=`${e}: ${t.message}`;throw t}else{return null}}return u}const s=i.fromPromise(_readFile);function readFileSync(e,t={}){if(typeof t==="string"){t={encoding:t}}const r=t.fs||n;const i="throws"in t?t.throws:true;try{let n=r.readFileSync(e,t);n=c(n);return JSON.parse(n,t.reviver)}catch(t){if(i){t.message=`${e}: ${t.message}`;throw t}else{return null}}}async function _writeFile(e,t,r={}){const c=r.fs||n;const s=o(t,r);await i.fromCallback(c.writeFile)(e,s,r)}const u=i.fromPromise(_writeFile);function writeFileSync(e,t,r={}){const i=r.fs||n;const c=o(t,r);return i.writeFileSync(e,c,r)}const a={readFile:s,readFileSync:readFileSync,writeFile:u,writeFileSync:writeFileSync};e.exports=a},902:function(e){function stringify(e,{EOL:t="\n",finalEOL:r=true,replacer:n=null,spaces:i}={}){const o=r?t:"";const c=JSON.stringify(e,n,i);return c.replace(/\n/g,t)+o}function stripBom(e){if(Buffer.isBuffer(e))e=e.toString("utf8");return e.replace(/^\uFEFF/,"")}e.exports={stringify:stringify,stripBom:stripBom}},46:function(e,t){"use strict";t.fromCallback=function(e){return Object.defineProperty((function(...t){if(typeof t[t.length-1]==="function")e.apply(this,t);else{return new Promise(((r,n)=>{t.push(((e,t)=>e!=null?n(e):r(t)));e.apply(this,t)}))}}),"name",{value:e.name})};t.fromPromise=function(e){return Object.defineProperty((function(...t){const r=t[t.length-1];if(typeof r!=="function")return e.apply(this,t);else{t.pop();e.apply(this,t).then((e=>r(null,e)),r)}}),"name",{value:e.name})}},491:function(e){"use strict";e.exports=require("assert")},57:function(e){"use strict";e.exports=require("constants")},147:function(e){"use strict";e.exports=require("fs")},17:function(e){"use strict";e.exports=require("path")},781:function(e){"use strict";e.exports=require("stream")},837:function(e){"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={exports:{}};var o=true;try{e[r](i,i.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(630);module.exports=r})();
@@ -0,0 +1,16 @@
1
+ 'use strict'
2
+
3
+ const u = require('universalify').fromPromise
4
+ const jsonFile = require('./jsonfile')
5
+
6
+ jsonFile.outputJson = u(require('./output-json'))
7
+ jsonFile.outputJsonSync = require('./output-json-sync')
8
+ // aliases
9
+ jsonFile.outputJSON = jsonFile.outputJson
10
+ jsonFile.outputJSONSync = jsonFile.outputJsonSync
11
+ jsonFile.writeJSON = jsonFile.writeJson
12
+ jsonFile.writeJSONSync = jsonFile.writeJsonSync
13
+ jsonFile.readJSON = jsonFile.readJson
14
+ jsonFile.readJSONSync = jsonFile.readJsonSync
15
+
16
+ module.exports = jsonFile
@@ -0,0 +1,11 @@
1
+ 'use strict'
2
+
3
+ const jsonFile = require('jsonfile')
4
+
5
+ module.exports = {
6
+ // jsonfile exports
7
+ readJson: jsonFile.readFile,
8
+ readJsonSync: jsonFile.readFileSync,
9
+ writeJson: jsonFile.writeFile,
10
+ writeJsonSync: jsonFile.writeFileSync
11
+ }
@@ -0,0 +1,12 @@
1
+ 'use strict'
2
+
3
+ const { stringify } = require('jsonfile/utils')
4
+ const { outputFileSync } = require('../output')
5
+
6
+ function outputJsonSync (file, data, options) {
7
+ const str = stringify(data, options)
8
+
9
+ outputFileSync(file, str, options)
10
+ }
11
+
12
+ module.exports = outputJsonSync
@@ -0,0 +1,12 @@
1
+ 'use strict'
2
+
3
+ const { stringify } = require('jsonfile/utils')
4
+ const { outputFile } = require('../output')
5
+
6
+ async function outputJson (file, data, options = {}) {
7
+ const str = stringify(data, options)
8
+
9
+ await outputFile(file, str, options)
10
+ }
11
+
12
+ module.exports = outputJson
@@ -0,0 +1,14 @@
1
+ 'use strict'
2
+ const u = require('universalify').fromPromise
3
+ const { makeDir: _makeDir, makeDirSync } = require('./make-dir')
4
+ const makeDir = u(_makeDir)
5
+
6
+ module.exports = {
7
+ mkdirs: makeDir,
8
+ mkdirsSync: makeDirSync,
9
+ // alias
10
+ mkdirp: makeDir,
11
+ mkdirpSync: makeDirSync,
12
+ ensureDir: makeDir,
13
+ ensureDirSync: makeDirSync
14
+ }
@@ -0,0 +1,141 @@
1
+ // Adapted from https://github.com/sindresorhus/make-dir
2
+ // Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
3
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+ // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6
+ 'use strict'
7
+ const fs = require('../fs')
8
+ const path = require('path')
9
+ const atLeastNode = require('at-least-node')
10
+
11
+ const useNativeRecursiveOption = atLeastNode('10.12.0')
12
+
13
+ // https://github.com/nodejs/node/issues/8987
14
+ // https://github.com/libuv/libuv/pull/1088
15
+ const checkPath = pth => {
16
+ if (process.platform === 'win32') {
17
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''))
18
+
19
+ if (pathHasInvalidWinCharacters) {
20
+ const error = new Error(`Path contains invalid characters: ${pth}`)
21
+ error.code = 'EINVAL'
22
+ throw error
23
+ }
24
+ }
25
+ }
26
+
27
+ const processOptions = options => {
28
+ const defaults = { mode: 0o777 }
29
+ if (typeof options === 'number') options = { mode: options }
30
+ return { ...defaults, ...options }
31
+ }
32
+
33
+ const permissionError = pth => {
34
+ // This replicates the exception of `fs.mkdir` with native the
35
+ // `recusive` option when run on an invalid drive under Windows.
36
+ const error = new Error(`operation not permitted, mkdir '${pth}'`)
37
+ error.code = 'EPERM'
38
+ error.errno = -4048
39
+ error.path = pth
40
+ error.syscall = 'mkdir'
41
+ return error
42
+ }
43
+
44
+ module.exports.makeDir = async (input, options) => {
45
+ checkPath(input)
46
+ options = processOptions(options)
47
+
48
+ if (useNativeRecursiveOption) {
49
+ const pth = path.resolve(input)
50
+
51
+ return fs.mkdir(pth, {
52
+ mode: options.mode,
53
+ recursive: true
54
+ })
55
+ }
56
+
57
+ const make = async pth => {
58
+ try {
59
+ await fs.mkdir(pth, options.mode)
60
+ } catch (error) {
61
+ if (error.code === 'EPERM') {
62
+ throw error
63
+ }
64
+
65
+ if (error.code === 'ENOENT') {
66
+ if (path.dirname(pth) === pth) {
67
+ throw permissionError(pth)
68
+ }
69
+
70
+ if (error.message.includes('null bytes')) {
71
+ throw error
72
+ }
73
+
74
+ await make(path.dirname(pth))
75
+ return make(pth)
76
+ }
77
+
78
+ try {
79
+ const stats = await fs.stat(pth)
80
+ if (!stats.isDirectory()) {
81
+ // This error is never exposed to the user
82
+ // it is caught below, and the original error is thrown
83
+ throw new Error('The path is not a directory')
84
+ }
85
+ } catch {
86
+ throw error
87
+ }
88
+ }
89
+ }
90
+
91
+ return make(path.resolve(input))
92
+ }
93
+
94
+ module.exports.makeDirSync = (input, options) => {
95
+ checkPath(input)
96
+ options = processOptions(options)
97
+
98
+ if (useNativeRecursiveOption) {
99
+ const pth = path.resolve(input)
100
+
101
+ return fs.mkdirSync(pth, {
102
+ mode: options.mode,
103
+ recursive: true
104
+ })
105
+ }
106
+
107
+ const make = pth => {
108
+ try {
109
+ fs.mkdirSync(pth, options.mode)
110
+ } catch (error) {
111
+ if (error.code === 'EPERM') {
112
+ throw error
113
+ }
114
+
115
+ if (error.code === 'ENOENT') {
116
+ if (path.dirname(pth) === pth) {
117
+ throw permissionError(pth)
118
+ }
119
+
120
+ if (error.message.includes('null bytes')) {
121
+ throw error
122
+ }
123
+
124
+ make(path.dirname(pth))
125
+ return make(pth)
126
+ }
127
+
128
+ try {
129
+ if (!fs.statSync(pth).isDirectory()) {
130
+ // This error is never exposed to the user
131
+ // it is caught below, and the original error is thrown
132
+ throw new Error('The path is not a directory')
133
+ }
134
+ } catch {
135
+ throw error
136
+ }
137
+ }
138
+ }
139
+
140
+ return make(path.resolve(input))
141
+ }
@@ -0,0 +1,6 @@
1
+ 'use strict'
2
+
3
+ const u = require('universalify').fromCallback
4
+ module.exports = {
5
+ move: u(require('./move'))
6
+ }