{"version":3,"file":"index.cjs","sources":["../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js","../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js","../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js","../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js","../src/fs/universalify.ts","../src/fs/index.ts","../src/external/path-is-inside.ts","../src/external/vacuum.ts","../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js","../lib/mkdirs/utils.js","../lib/mkdirs/make-dir.js","../lib/mkdirs/index.js","../src/fs/exists.ts","../lib/util/utimes.js","../lib/util/stat.js","../lib/copy/copy.js","../lib/copy/copy-sync.js","../lib/remove/index.js","../lib/empty/index.js","../lib/ensure/file.js","../lib/ensure/link.js","../lib/ensure/symlink-paths.js","../lib/ensure/symlink-type.js","../lib/ensure/symlink.js","../lib/move/move.js","../lib/move/move-sync.js","../lib/output-file/index.js","../src/fs/dive.ts","../src/fs/for-each-child.ts","../src/fs/is-directory.ts","../src/helpers.ts","../src/fs/map-children.ts","../src/fs/map-structure.ts","../src/fs/read-lines.ts","../src/fs/read-text.ts","../src/fs/write-file.ts","../src/json.ts","../src/subindex.ts"],"sourcesContent":["var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n  if (!cwd)\n    cwd = origCwd.call(process)\n  return cwd\n}\ntry {\n  process.cwd()\n} catch (er) {}\n\n// This check is needed until node.js 12 is required\nif (typeof process.chdir === 'function') {\n  var chdir = process.chdir\n  process.chdir = function (d) {\n    cwd = null\n    chdir.call(process, d)\n  }\n  if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n  // (re-)implement some things that are known busted or missing.\n\n  // lchmod, broken prior to 0.6.2\n  // back-port the fix here.\n  if (constants.hasOwnProperty('O_SYMLINK') &&\n      process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n    patchLchmod(fs)\n  }\n\n  // lutimes implementation, or no-op\n  if (!fs.lutimes) {\n    patchLutimes(fs)\n  }\n\n  // https://github.com/isaacs/node-graceful-fs/issues/4\n  // Chown should not fail on einval or eperm if non-root.\n  // It should not fail on enosys ever, as this just indicates\n  // that a fs doesn't support the intended operation.\n\n  fs.chown = chownFix(fs.chown)\n  fs.fchown = chownFix(fs.fchown)\n  fs.lchown = chownFix(fs.lchown)\n\n  fs.chmod = chmodFix(fs.chmod)\n  fs.fchmod = chmodFix(fs.fchmod)\n  fs.lchmod = chmodFix(fs.lchmod)\n\n  fs.chownSync = chownFixSync(fs.chownSync)\n  fs.fchownSync = chownFixSync(fs.fchownSync)\n  fs.lchownSync = chownFixSync(fs.lchownSync)\n\n  fs.chmodSync = chmodFixSync(fs.chmodSync)\n  fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n  fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n  fs.stat = statFix(fs.stat)\n  fs.fstat = statFix(fs.fstat)\n  fs.lstat = statFix(fs.lstat)\n\n  fs.statSync = statFixSync(fs.statSync)\n  fs.fstatSync = statFixSync(fs.fstatSync)\n  fs.lstatSync = statFixSync(fs.lstatSync)\n\n  // if lchmod/lchown do not exist, then make them no-ops\n  if (fs.chmod && !fs.lchmod) {\n    fs.lchmod = function (path, mode, cb) {\n      if (cb) process.nextTick(cb)\n    }\n    fs.lchmodSync = function () {}\n  }\n  if (fs.chown && !fs.lchown) {\n    fs.lchown = function (path, uid, gid, cb) {\n      if (cb) process.nextTick(cb)\n    }\n    fs.lchownSync = function () {}\n  }\n\n  // on Windows, A/V software can lock the directory, causing this\n  // to fail with an EACCES or EPERM if the directory contains newly\n  // created files.  Try again on failure, for up to 60 seconds.\n\n  // Set the timeout this long because some Windows Anti-Virus, such as Parity\n  // bit9, may lock files for up to a minute, causing npm package install\n  // failures. Also, take care to yield the scheduler. Windows scheduling gives\n  // CPU to a busy looping process, which can cause the program causing the lock\n  // contention to be starved of CPU by node, so the contention doesn't resolve.\n  if (platform === \"win32\") {\n    fs.rename = typeof fs.rename !== 'function' ? fs.rename\n    : (function (fs$rename) {\n      function rename (from, to, cb) {\n        var start = Date.now()\n        var backoff = 0;\n        fs$rename(from, to, function CB (er) {\n          if (er\n              && (er.code === \"EACCES\" || er.code === \"EPERM\" || er.code === \"EBUSY\")\n              && Date.now() - start < 60000) {\n            setTimeout(function() {\n              fs.stat(to, function (stater, st) {\n                if (stater && stater.code === \"ENOENT\")\n                  fs$rename(from, to, CB);\n                else\n                  cb(er)\n              })\n            }, backoff)\n            if (backoff < 100)\n              backoff += 10;\n            return;\n          }\n          if (cb) cb(er)\n        })\n      }\n      if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)\n      return rename\n    })(fs.rename)\n  }\n\n  // if read() returns EAGAIN, then just try it again.\n  fs.read = typeof fs.read !== 'function' ? fs.read\n  : (function (fs$read) {\n    function read (fd, buffer, offset, length, position, callback_) {\n      var callback\n      if (callback_ && typeof callback_ === 'function') {\n        var eagCounter = 0\n        callback = function (er, _, __) {\n          if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n            eagCounter ++\n            return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n          }\n          callback_.apply(this, arguments)\n        }\n      }\n      return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n    }\n\n    // This ensures `util.promisify` works as it does for native `fs.read`.\n    if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)\n    return read\n  })(fs.read)\n\n  fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync\n  : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n    var eagCounter = 0\n    while (true) {\n      try {\n        return fs$readSync.call(fs, fd, buffer, offset, length, position)\n      } catch (er) {\n        if (er.code === 'EAGAIN' && eagCounter < 10) {\n          eagCounter ++\n          continue\n        }\n        throw er\n      }\n    }\n  }})(fs.readSync)\n\n  function patchLchmod (fs) {\n    fs.lchmod = function (path, mode, callback) {\n      fs.open( path\n             , constants.O_WRONLY | constants.O_SYMLINK\n             , mode\n             , function (err, fd) {\n        if (err) {\n          if (callback) callback(err)\n          return\n        }\n        // prefer to return the chmod error, if one occurs,\n        // but still try to close, and report closing errors if they occur.\n        fs.fchmod(fd, mode, function (err) {\n          fs.close(fd, function(err2) {\n            if (callback) callback(err || err2)\n          })\n        })\n      })\n    }\n\n    fs.lchmodSync = function (path, mode) {\n      var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n      // prefer to return the chmod error, if one occurs,\n      // but still try to close, and report closing errors if they occur.\n      var threw = true\n      var ret\n      try {\n        ret = fs.fchmodSync(fd, mode)\n        threw = false\n      } finally {\n        if (threw) {\n          try {\n            fs.closeSync(fd)\n          } catch (er) {}\n        } else {\n          fs.closeSync(fd)\n        }\n      }\n      return ret\n    }\n  }\n\n  function patchLutimes (fs) {\n    if (constants.hasOwnProperty(\"O_SYMLINK\") && fs.futimes) {\n      fs.lutimes = function (path, at, mt, cb) {\n        fs.open(path, constants.O_SYMLINK, function (er, fd) {\n          if (er) {\n            if (cb) cb(er)\n            return\n          }\n          fs.futimes(fd, at, mt, function (er) {\n            fs.close(fd, function (er2) {\n              if (cb) cb(er || er2)\n            })\n          })\n        })\n      }\n\n      fs.lutimesSync = function (path, at, mt) {\n        var fd = fs.openSync(path, constants.O_SYMLINK)\n        var ret\n        var threw = true\n        try {\n          ret = fs.futimesSync(fd, at, mt)\n          threw = false\n        } finally {\n          if (threw) {\n            try {\n              fs.closeSync(fd)\n            } catch (er) {}\n          } else {\n            fs.closeSync(fd)\n          }\n        }\n        return ret\n      }\n\n    } else if (fs.futimes) {\n      fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n      fs.lutimesSync = function () {}\n    }\n  }\n\n  function chmodFix (orig) {\n    if (!orig) return orig\n    return function (target, mode, cb) {\n      return orig.call(fs, target, mode, function (er) {\n        if (chownErOk(er)) er = null\n        if (cb) cb.apply(this, arguments)\n      })\n    }\n  }\n\n  function chmodFixSync (orig) {\n    if (!orig) return orig\n    return function (target, mode) {\n      try {\n        return orig.call(fs, target, mode)\n      } catch (er) {\n        if (!chownErOk(er)) throw er\n      }\n    }\n  }\n\n\n  function chownFix (orig) {\n    if (!orig) return orig\n    return function (target, uid, gid, cb) {\n      return orig.call(fs, target, uid, gid, function (er) {\n        if (chownErOk(er)) er = null\n        if (cb) cb.apply(this, arguments)\n      })\n    }\n  }\n\n  function chownFixSync (orig) {\n    if (!orig) return orig\n    return function (target, uid, gid) {\n      try {\n        return orig.call(fs, target, uid, gid)\n      } catch (er) {\n        if (!chownErOk(er)) throw er\n      }\n    }\n  }\n\n  function statFix (orig) {\n    if (!orig) return orig\n    // Older versions of Node erroneously returned signed integers for\n    // uid + gid.\n    return function (target, options, cb) {\n      if (typeof options === 'function') {\n        cb = options\n        options = null\n      }\n      function callback (er, stats) {\n        if (stats) {\n          if (stats.uid < 0) stats.uid += 0x100000000\n          if (stats.gid < 0) stats.gid += 0x100000000\n        }\n        if (cb) cb.apply(this, arguments)\n      }\n      return options ? orig.call(fs, target, options, callback)\n        : orig.call(fs, target, callback)\n    }\n  }\n\n  function statFixSync (orig) {\n    if (!orig) return orig\n    // Older versions of Node erroneously returned signed integers for\n    // uid + gid.\n    return function (target, options) {\n      var stats = options ? orig.call(fs, target, options)\n        : orig.call(fs, target)\n      if (stats) {\n        if (stats.uid < 0) stats.uid += 0x100000000\n        if (stats.gid < 0) stats.gid += 0x100000000\n      }\n      return stats;\n    }\n  }\n\n  // ENOSYS means that the fs doesn't support the op. Just ignore\n  // that, because it doesn't matter.\n  //\n  // if there's no getuid, or if getuid() is something other\n  // than 0, and the error is EINVAL or EPERM, then just ignore\n  // it.\n  //\n  // This specific case is a silent failure in cp, install, tar,\n  // and most other unix tools that manage permissions.\n  //\n  // When running as root, or if other types of errors are\n  // encountered, then it's strict.\n  function chownErOk (er) {\n    if (!er)\n      return true\n\n    if (er.code === \"ENOSYS\")\n      return true\n\n    var nonroot = !process.getuid || process.getuid() !== 0\n    if (nonroot) {\n      if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n        return true\n    }\n\n    return false\n  }\n}\n","var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n  gracefulQueue = Symbol.for('graceful-fs.queue')\n  // This is used in testing by future versions\n  previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n  gracefulQueue = '___graceful-fs.queue'\n  previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n  Object.defineProperty(context, gracefulQueue, {\n    get: function() {\n      return queue\n    }\n  })\n}\n\nvar debug = noop\nif (util.debuglog)\n  debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n  debug = function() {\n    var m = util.format.apply(util, arguments)\n    m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n    console.error(m)\n  }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n  // This queue can be shared by multiple loaded instances\n  var queue = global[gracefulQueue] || []\n  publishQueue(fs, queue)\n\n  // Patch fs.close/closeSync to shared queue version, because we need\n  // to retry() whenever a close happens *anywhere* in the program.\n  // This is essential when multiple graceful-fs instances are\n  // in play at the same time.\n  fs.close = (function (fs$close) {\n    function close (fd, cb) {\n      return fs$close.call(fs, fd, function (err) {\n        // This function uses the graceful-fs shared queue\n        if (!err) {\n          resetQueue()\n        }\n\n        if (typeof cb === 'function')\n          cb.apply(this, arguments)\n      })\n    }\n\n    Object.defineProperty(close, previousSymbol, {\n      value: fs$close\n    })\n    return close\n  })(fs.close)\n\n  fs.closeSync = (function (fs$closeSync) {\n    function closeSync (fd) {\n      // This function uses the graceful-fs shared queue\n      fs$closeSync.apply(fs, arguments)\n      resetQueue()\n    }\n\n    Object.defineProperty(closeSync, previousSymbol, {\n      value: fs$closeSync\n    })\n    return closeSync\n  })(fs.closeSync)\n\n  if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n    process.on('exit', function() {\n      debug(fs[gracefulQueue])\n      require('assert').equal(fs[gracefulQueue].length, 0)\n    })\n  }\n}\n\nif (!global[gracefulQueue]) {\n  publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n    module.exports = patch(fs)\n    fs.__patched = true;\n}\n\nfunction patch (fs) {\n  // Everything that references the open() function needs to be in here\n  polyfills(fs)\n  fs.gracefulify = patch\n\n  fs.createReadStream = createReadStream\n  fs.createWriteStream = createWriteStream\n  var fs$readFile = fs.readFile\n  fs.readFile = readFile\n  function readFile (path, options, cb) {\n    if (typeof options === 'function')\n      cb = options, options = null\n\n    return go$readFile(path, options, cb)\n\n    function go$readFile (path, options, cb, startTime) {\n      return fs$readFile(path, options, function (err) {\n        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n          enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])\n        else {\n          if (typeof cb === 'function')\n            cb.apply(this, arguments)\n        }\n      })\n    }\n  }\n\n  var fs$writeFile = fs.writeFile\n  fs.writeFile = writeFile\n  function writeFile (path, data, options, cb) {\n    if (typeof options === 'function')\n      cb = options, options = null\n\n    return go$writeFile(path, data, options, cb)\n\n    function go$writeFile (path, data, options, cb, startTime) {\n      return fs$writeFile(path, data, options, function (err) {\n        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n          enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n        else {\n          if (typeof cb === 'function')\n            cb.apply(this, arguments)\n        }\n      })\n    }\n  }\n\n  var fs$appendFile = fs.appendFile\n  if (fs$appendFile)\n    fs.appendFile = appendFile\n  function appendFile (path, data, options, cb) {\n    if (typeof options === 'function')\n      cb = options, options = null\n\n    return go$appendFile(path, data, options, cb)\n\n    function go$appendFile (path, data, options, cb, startTime) {\n      return fs$appendFile(path, data, options, function (err) {\n        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n          enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n        else {\n          if (typeof cb === 'function')\n            cb.apply(this, arguments)\n        }\n      })\n    }\n  }\n\n  var fs$copyFile = fs.copyFile\n  if (fs$copyFile)\n    fs.copyFile = copyFile\n  function copyFile (src, dest, flags, cb) {\n    if (typeof flags === 'function') {\n      cb = flags\n      flags = 0\n    }\n    return go$copyFile(src, dest, flags, cb)\n\n    function go$copyFile (src, dest, flags, cb, startTime) {\n      return fs$copyFile(src, dest, flags, function (err) {\n        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n          enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])\n        else {\n          if (typeof cb === 'function')\n            cb.apply(this, arguments)\n        }\n      })\n    }\n  }\n\n  var fs$readdir = fs.readdir\n  fs.readdir = readdir\n  var noReaddirOptionVersions = /^v[0-5]\\./\n  function readdir (path, options, cb) {\n    if (typeof options === 'function')\n      cb = options, options = null\n\n    var go$readdir = noReaddirOptionVersions.test(process.version)\n      ? function go$readdir (path, options, cb, startTime) {\n        return fs$readdir(path, fs$readdirCallback(\n          path, options, cb, startTime\n        ))\n      }\n      : function go$readdir (path, options, cb, startTime) {\n        return fs$readdir(path, options, fs$readdirCallback(\n          path, options, cb, startTime\n        ))\n      }\n\n    return go$readdir(path, options, cb)\n\n    function fs$readdirCallback (path, options, cb, startTime) {\n      return function (err, files) {\n        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n          enqueue([\n            go$readdir,\n            [path, options, cb],\n            err,\n            startTime || Date.now(),\n            Date.now()\n          ])\n        else {\n          if (files && files.sort)\n            files.sort()\n\n          if (typeof cb === 'function')\n            cb.call(this, err, files)\n        }\n      }\n    }\n  }\n\n  if (process.version.substr(0, 4) === 'v0.8') {\n    var legStreams = legacy(fs)\n    ReadStream = legStreams.ReadStream\n    WriteStream = legStreams.WriteStream\n  }\n\n  var fs$ReadStream = fs.ReadStream\n  if (fs$ReadStream) {\n    ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n    ReadStream.prototype.open = ReadStream$open\n  }\n\n  var fs$WriteStream = fs.WriteStream\n  if (fs$WriteStream) {\n    WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n    WriteStream.prototype.open = WriteStream$open\n  }\n\n  Object.defineProperty(fs, 'ReadStream', {\n    get: function () {\n      return ReadStream\n    },\n    set: function (val) {\n      ReadStream = val\n    },\n    enumerable: true,\n    configurable: true\n  })\n  Object.defineProperty(fs, 'WriteStream', {\n    get: function () {\n      return WriteStream\n    },\n    set: function (val) {\n      WriteStream = val\n    },\n    enumerable: true,\n    configurable: true\n  })\n\n  // legacy names\n  var FileReadStream = ReadStream\n  Object.defineProperty(fs, 'FileReadStream', {\n    get: function () {\n      return FileReadStream\n    },\n    set: function (val) {\n      FileReadStream = val\n    },\n    enumerable: true,\n    configurable: true\n  })\n  var FileWriteStream = WriteStream\n  Object.defineProperty(fs, 'FileWriteStream', {\n    get: function () {\n      return FileWriteStream\n    },\n    set: function (val) {\n      FileWriteStream = val\n    },\n    enumerable: true,\n    configurable: true\n  })\n\n  function ReadStream (path, options) {\n    if (this instanceof ReadStream)\n      return fs$ReadStream.apply(this, arguments), this\n    else\n      return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n  }\n\n  function ReadStream$open () {\n    var that = this\n    open(that.path, that.flags, that.mode, function (err, fd) {\n      if (err) {\n        if (that.autoClose)\n          that.destroy()\n\n        that.emit('error', err)\n      } else {\n        that.fd = fd\n        that.emit('open', fd)\n        that.read()\n      }\n    })\n  }\n\n  function WriteStream (path, options) {\n    if (this instanceof WriteStream)\n      return fs$WriteStream.apply(this, arguments), this\n    else\n      return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n  }\n\n  function WriteStream$open () {\n    var that = this\n    open(that.path, that.flags, that.mode, function (err, fd) {\n      if (err) {\n        that.destroy()\n        that.emit('error', err)\n      } else {\n        that.fd = fd\n        that.emit('open', fd)\n      }\n    })\n  }\n\n  function createReadStream (path, options) {\n    return new fs.ReadStream(path, options)\n  }\n\n  function createWriteStream (path, options) {\n    return new fs.WriteStream(path, options)\n  }\n\n  var fs$open = fs.open\n  fs.open = open\n  function open (path, flags, mode, cb) {\n    if (typeof mode === 'function')\n      cb = mode, mode = null\n\n    return go$open(path, flags, mode, cb)\n\n    function go$open (path, flags, mode, cb, startTime) {\n      return fs$open(path, flags, mode, function (err, fd) {\n        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n          enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])\n        else {\n          if (typeof cb === 'function')\n            cb.apply(this, arguments)\n        }\n      })\n    }\n  }\n\n  return fs\n}\n\nfunction enqueue (elem) {\n  debug('ENQUEUE', elem[0].name, elem[1])\n  fs[gracefulQueue].push(elem)\n  retry()\n}\n\n// keep track of the timeout between retry() calls\nvar retryTimer\n\n// reset the startTime and lastTime to now\n// this resets the start of the 60 second overall timeout as well as the\n// delay between attempts so that we'll retry these jobs sooner\nfunction resetQueue () {\n  var now = Date.now()\n  for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n    // entries that are only a length of 2 are from an older version, don't\n    // bother modifying those since they'll be retried anyway.\n    if (fs[gracefulQueue][i].length > 2) {\n      fs[gracefulQueue][i][3] = now // startTime\n      fs[gracefulQueue][i][4] = now // lastTime\n    }\n  }\n  // call retry to make sure we're actively processing the queue\n  retry()\n}\n\nfunction retry () {\n  // clear the timer and remove it to help prevent unintended concurrency\n  clearTimeout(retryTimer)\n  retryTimer = undefined\n\n  if (fs[gracefulQueue].length === 0)\n    return\n\n  var elem = fs[gracefulQueue].shift()\n  var fn = elem[0]\n  var args = elem[1]\n  // these items may be unset if they were added by an older graceful-fs\n  var err = elem[2]\n  var startTime = elem[3]\n  var lastTime = elem[4]\n\n  // if we don't have a startTime we have no way of knowing if we've waited\n  // long enough, so go ahead and retry this item now\n  if (startTime === undefined) {\n    debug('RETRY', fn.name, args)\n    fn.apply(null, args)\n  } else if (Date.now() - startTime >= 60000) {\n    // it's been more than 60 seconds total, bail now\n    debug('TIMEOUT', fn.name, args)\n    var cb = args.pop()\n    if (typeof cb === 'function')\n      cb.call(null, err)\n  } else {\n    // the amount of time between the last attempt and right now\n    var sinceAttempt = Date.now() - lastTime\n    // the amount of time between when we first tried, and when we last tried\n    // rounded up to at least 1\n    var sinceStart = Math.max(lastTime - startTime, 1)\n    // backoff. wait longer than the total time we've been retrying, but only\n    // up to a maximum of 100ms\n    var desiredDelay = Math.min(sinceStart * 1.2, 100)\n    // it's been long enough since the last retry, do it again\n    if (sinceAttempt >= desiredDelay) {\n      debug('RETRY', fn.name, args)\n      fn.apply(null, args.concat([startTime]))\n    } else {\n      // if we can't do this job yet, push it to the end of the queue\n      // and let the next iteration check again\n      fs[gracefulQueue].push(elem)\n    }\n  }\n\n  // schedule our next run if one isn't already scheduled\n  if (retryTimer === undefined) {\n    retryTimer = setTimeout(retry, 0)\n  }\n}\n","var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n  return {\n    ReadStream: ReadStream,\n    WriteStream: WriteStream\n  }\n\n  function ReadStream (path, options) {\n    if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n    Stream.call(this);\n\n    var self = this;\n\n    this.path = path;\n    this.fd = null;\n    this.readable = true;\n    this.paused = false;\n\n    this.flags = 'r';\n    this.mode = 438; /*=0666*/\n    this.bufferSize = 64 * 1024;\n\n    options = options || {};\n\n    // Mixin options into this\n    var keys = Object.keys(options);\n    for (var index = 0, length = keys.length; index < length; index++) {\n      var key = keys[index];\n      this[key] = options[key];\n    }\n\n    if (this.encoding) this.setEncoding(this.encoding);\n\n    if (this.start !== undefined) {\n      if ('number' !== typeof this.start) {\n        throw TypeError('start must be a Number');\n      }\n      if (this.end === undefined) {\n        this.end = Infinity;\n      } else if ('number' !== typeof this.end) {\n        throw TypeError('end must be a Number');\n      }\n\n      if (this.start > this.end) {\n        throw new Error('start must be <= end');\n      }\n\n      this.pos = this.start;\n    }\n\n    if (this.fd !== null) {\n      process.nextTick(function() {\n        self._read();\n      });\n      return;\n    }\n\n    fs.open(this.path, this.flags, this.mode, function (err, fd) {\n      if (err) {\n        self.emit('error', err);\n        self.readable = false;\n        return;\n      }\n\n      self.fd = fd;\n      self.emit('open', fd);\n      self._read();\n    })\n  }\n\n  function WriteStream (path, options) {\n    if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n    Stream.call(this);\n\n    this.path = path;\n    this.fd = null;\n    this.writable = true;\n\n    this.flags = 'w';\n    this.encoding = 'binary';\n    this.mode = 438; /*=0666*/\n    this.bytesWritten = 0;\n\n    options = options || {};\n\n    // Mixin options into this\n    var keys = Object.keys(options);\n    for (var index = 0, length = keys.length; index < length; index++) {\n      var key = keys[index];\n      this[key] = options[key];\n    }\n\n    if (this.start !== undefined) {\n      if ('number' !== typeof this.start) {\n        throw TypeError('start must be a Number');\n      }\n      if (this.start < 0) {\n        throw new Error('start must be >= zero');\n      }\n\n      this.pos = this.start;\n    }\n\n    this.busy = false;\n    this._queue = [];\n\n    if (this.fd === null) {\n      this._open = fs.open;\n      this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n      this.flush();\n    }\n  }\n}\n","'use strict'\n\nmodule.exports = clone\n\nvar getPrototypeOf = Object.getPrototypeOf || function (obj) {\n  return obj.__proto__\n}\n\nfunction clone (obj) {\n  if (obj === null || typeof obj !== 'object')\n    return obj\n\n  if (obj instanceof Object)\n    var copy = { __proto__: getPrototypeOf(obj) }\n  else\n    var copy = Object.create(null)\n\n  Object.getOwnPropertyNames(obj).forEach(function (key) {\n    Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n  })\n\n  return copy\n}\n","import { type CustomPromisify, promisify } from 'util';\r\n\r\n// https://www.reddit.com/r/typescript/comments/10ibwi4/get_last_item_type_of_a_tuple/j5dogh8/\r\ntype LastElement<Arr extends any[]> = Arr extends [...any[], infer B] ? B : never\r\n\r\ntype CallbackArgs<T extends (...args: any) => any> = LastElement<Parameters<T>> extends (err: any, ...cbArgs: infer CbArgs) => void\r\n    ? CbArgs\r\n    : never;\r\n\r\nconst universalifiedSymbol = Symbol();\r\n\r\n// fallbackObjectCreator overloads\r\nexport function universalify<TFunction extends CustomPromisify<TCustom> & ((...args: any) => any), TCustom extends (...args: any) => any>(\r\n    fn: TFunction & CustomPromisify<TCustom>,\r\n    fallbackMultiResultObjectCreator: (...args: CallbackArgs<TFunction>) => Awaited<ReturnType<TCustom>>\r\n): TFunction & TCustom;\r\nexport function universalify<A extends unknown[], X extends (...args: any[]) => any, R extends any[], F>(\r\n    fn: X & ((...args: [...A, (err: any, ...cbArgs: R) => void]) => void),\r\n    fallbackMultiResultObjectCreator: (...args: R) => F\r\n): {\r\n    (...args: Parameters<X>): void;\r\n    (...args: A): Promise<F>;\r\n}\r\n\r\n// no fallback overloads\r\nexport function universalify<TFunction extends CustomPromisify<TCustom>, TCustom extends (...args: any) => any>(fn: TFunction & CustomPromisify<TCustom>): TFunction & TCustom;\r\nexport function universalify<A extends unknown[], X extends (...args: any[]) => any, R>(fn: X & ((...args: [...A, (err: any, result: R) => void]) => void)): {\r\n    (...args: Parameters<X>): void;\r\n    (...args: A): Promise<R>;\r\n}\r\nexport function universalify<A extends unknown[], X extends (...args: any[]) => any, R>(fn: X & ((...args: [...A, (err?: any) => void]) => void)): {\r\n    (...args: Parameters<X>): void;\r\n    (...args: A): Promise<void>;\r\n}\r\n\r\n// implementation\r\nexport function universalify<A extends unknown[], X extends (...args: any[]) => any, R>(\r\n    fn: X & ((...args: [...A, (err?: any, result?: R) => void]) => void),\r\n    fallbackMultiResultObjectCreator?: (...args: any[]) => any\r\n): {\r\n    (...args: Parameters<X>): void;\r\n    (...args: A): Promise<R>;\r\n} {\r\n    if (!fn) return fn;\r\n\r\n    if (universalifiedSymbol in fn) {\r\n        return fn[universalifiedSymbol] as any;\r\n    }\r\n\r\n    const promisified = fallbackMultiResultObjectCreator ? promisifyFallback(fn, fallbackMultiResultObjectCreator) : promisify(fn);\r\n\r\n    const f = function(...args: ([...A, (err: any, result: R) => void][0] | A[0])[]) {\r\n        const cb = args[args.length - 1];\r\n        if (typeof cb === 'function') {\r\n            return fn(...args as Parameters<typeof fn>);\r\n        }\r\n        return promisified(...args);\r\n    };\r\n\r\n    const attr = {\r\n        value: f, enumerable: false, writable: false, configurable: true\r\n    };\r\n    Object.defineProperty(fn, universalifiedSymbol, attr);\r\n    Object.defineProperty(f, universalifiedSymbol, attr);\r\n\r\n    return f;\r\n}\r\n\r\nfunction promisifyFallback<T extends any[], TResults extends any[], TFallback>(\r\n    fn: (...args: [...args: T, callback: (err: any, ...results: TResults) => void]) => void,\r\n    fallbackObjectCreator: (...args: TResults) => TFallback\r\n): (...args: T) => Promise<TFallback> {\r\n    // Return the existing util.promisified implementation if one exists. We expect that the util.promisified version has the same return signature, but this is not enforced except by TypeScript.\r\n    if ('__promisify__' in fn || promisify.custom in fn) {\r\n        return promisify(fn) as any;\r\n    }\r\n\r\n    return (...args) => {\r\n        return new Promise((resolve, reject) => {\r\n            fn(...args, (err: any, ...results: TResults) => {\r\n                if (err) reject(err);\r\n                resolve(fallbackObjectCreator(...results));\r\n            });\r\n        });\r\n    };\r\n}\r\n\r\n","// use fully qualified imports to aid tree-shaking in bundlers\r\nimport * as gfs from 'graceful-fs';\r\n\r\nimport type * as fs from 'fs';\r\n\r\nexport * from 'graceful-fs';\r\n\r\nimport { universalify } from './universalify';\r\n\r\nimport rfs from 'fs';\r\n\r\n/**\r\n * Asynchronously rename file at `oldPath` to the pathname provided\r\n * as `newPath`. In the case that `newPath` already exists, it will\r\n * be overwritten. If there is a directory at `newPath`, an error will\r\n * be raised instead. No arguments other than a possible exception are\r\n * given to the completion callback.\r\n *\r\n * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html).\r\n *\r\n * ```js\r\n * import { rename } from 'node:fs';\r\n *\r\n * rename('oldFile.txt', 'newFile.txt', (err) => {\r\n *   if (err) throw err;\r\n *   console.log('Rename complete!');\r\n * });\r\n * ```\r\n * @since v0.0.2\r\n * @see {@link fs.rename}\r\n * @see {@link fs.promises.rename}\r\n */\r\nexport const rename: typeof fs.rename & typeof fs.rename.__promisify__ = universalify(gfs.rename);\r\n/**\r\n * Truncates the file. No arguments other than a possible exception are\r\n * given to the completion callback. A file descriptor can also be passed as the\r\n * first argument. In this case, `fs.ftruncate()` is called.\r\n *\r\n * ```js\r\n * import { truncate } from 'node:fs';\r\n * // Assuming that 'path/file.txt' is a regular file.\r\n * truncate('path/file.txt', (err) => {\r\n *   if (err) throw err;\r\n *   console.log('path/file.txt was truncated');\r\n * });\r\n * ```\r\n *\r\n * Passing a file descriptor is deprecated and may result in an error being thrown\r\n * in the future.\r\n *\r\n * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details.\r\n * @since v0.8.6\r\n * @param [len=0]\r\n * @see {@link fs.truncate}\r\n * @see {@link fs.promises.truncate}\r\n */\r\nexport const truncate: typeof fs.truncate & typeof fs.truncate.__promisify__ = universalify(gfs.truncate);\r\n/**\r\n * Truncates the file descriptor. No arguments other than a possible exception are\r\n * given to the completion callback.\r\n *\r\n * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail.\r\n *\r\n * If the file referred to by the file descriptor was larger than `len` bytes, only\r\n * the first `len` bytes will be retained in the file.\r\n *\r\n * For example, the following program retains only the first four bytes of the\r\n * file:\r\n *\r\n * ```js\r\n * import { open, close, ftruncate } from 'node:fs';\r\n *\r\n * function closeFd(fd) {\r\n *   close(fd, (err) => {\r\n *     if (err) throw err;\r\n *   });\r\n * }\r\n *\r\n * open('temp.txt', 'r+', (err, fd) => {\r\n *   if (err) throw err;\r\n *\r\n *   try {\r\n *     ftruncate(fd, 4, (err) => {\r\n *       closeFd(fd);\r\n *       if (err) throw err;\r\n *     });\r\n *   } catch (err) {\r\n *     closeFd(fd);\r\n *     if (err) throw err;\r\n *   }\r\n * });\r\n * ```\r\n *\r\n * If the file previously was shorter than `len` bytes, it is extended, and the\r\n * extended part is filled with null bytes (`'\\0'`):\r\n *\r\n * If `len` is negative then `0` will be used.\r\n * @since v0.8.6\r\n * @param [len=0]\r\n * @see {@link fs.ftruncate}\r\n * @see {@link fs.promises.ftruncate}\r\n */\r\nexport const ftruncate: typeof fs.ftruncate & typeof fs.ftruncate.__promisify__ = universalify(gfs.ftruncate);\r\n/**\r\n * Asynchronously changes owner and group of a file. No arguments other than a\r\n * possible exception are given to the completion callback.\r\n *\r\n * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail.\r\n * @since v0.1.97\r\n * @see {@link fs.chown}\r\n * @see {@link fs.promises.chown}\r\n */\r\nexport const chown: typeof fs.chown & typeof fs.chown.__promisify__ = universalify(gfs.chown);\r\n/**\r\n * Sets the owner of the file. No arguments other than a possible exception are\r\n * given to the completion callback.\r\n *\r\n * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail.\r\n * @since v0.4.7\r\n * @see {@link fs.fchown}\r\n * @see {@link fs.promises.fchown}\r\n */\r\nexport const fchown: typeof fs.fchown & typeof fs.fchown.__promisify__ = universalify(gfs.fchown);\r\n/**\r\n * Set the owner of the symbolic link. No arguments other than a possible\r\n * exception are given to the completion callback.\r\n *\r\n * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail.\r\n * @see {@link fs.lchown}\r\n * @see {@link fs.promises.lchown}\r\n */\r\nexport const lchown: typeof fs.lchown & typeof fs.lchown.__promisify__ = universalify(gfs.lchown);\r\n/**\r\n * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic\r\n * link, then the link is not dereferenced: instead, the timestamps of the\r\n * symbolic link itself are changed.\r\n *\r\n * No arguments other than a possible exception are given to the completion\r\n * callback.\r\n * @since v14.5.0, v12.19.0\r\n * @see {@link fs.lutimes}\r\n * @see {@link fs.promises.lutimes}\r\n */\r\nexport const lutimes: typeof fs.lutimes & typeof fs.lutimes.__promisify__ = universalify(gfs.lutimes);\r\n/**\r\n * Asynchronously changes the permissions of a file. No arguments other than a\r\n * possible exception are given to the completion callback.\r\n *\r\n * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail.\r\n *\r\n * ```js\r\n * import { chmod } from 'node:fs';\r\n *\r\n * chmod('my_file.txt', 0o775, (err) => {\r\n *   if (err) throw err;\r\n *   console.log('The permissions for file \"my_file.txt\" have been changed!');\r\n * });\r\n * ```\r\n * @since v0.1.30\r\n * @see {@link fs.chmod}\r\n * @see {@link fs.promises.chmod}\r\n */\r\nexport const chmod: typeof fs.chmod & typeof fs.chmod.__promisify__ = universalify(gfs.chmod);\r\n/**\r\n * Sets the permissions on the file. No arguments other than a possible exception\r\n * are given to the completion callback.\r\n *\r\n * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail.\r\n * @since v0.4.7\r\n * @see {@link fs.fchmod}\r\n * @see {@link fs.promises.fchmod}\r\n */\r\nexport const fchmod: typeof fs.fchmod & typeof fs.fchmod.__promisify__ = universalify(gfs.fchmod);\r\n/**\r\n * Changes the permissions on a symbolic link. No arguments other than a possible\r\n * exception are given to the completion callback.\r\n *\r\n * This method is only implemented on macOS.\r\n *\r\n * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail.\r\n * @deprecated Since v0.4.7\r\n * @see {@link fs.lchmod}\r\n * @see {@link fs.promises.lchmod}\r\n */\r\nexport const lchmod: typeof fs.lchmod & typeof fs.lchmod.__promisify__ = universalify(gfs.lchmod);\r\n/**\r\n * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object.\r\n *\r\n * In case of an error, the `err.code` will be one of `Common System Errors`.\r\n *\r\n * {@link stat} follows symbolic links. Use {@link lstat} to look at the\r\n * links themselves.\r\n *\r\n * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended.\r\n * Instead, user code should open/read/write the file directly and handle the\r\n * error raised if the file is not available.\r\n *\r\n * To check if a file exists without manipulating it afterwards, {@link access} is recommended.\r\n *\r\n * For example, given the following directory structure:\r\n *\r\n * ```text\r\n * - txtDir\r\n * -- file.txt\r\n * - app.js\r\n * ```\r\n *\r\n * The next program will check for the stats of the given paths:\r\n *\r\n * ```js\r\n * import { stat } from 'node:fs';\r\n *\r\n * const pathsToCheck = ['./txtDir', './txtDir/file.txt'];\r\n *\r\n * for (let i = 0; i < pathsToCheck.length; i++) {\r\n *   stat(pathsToCheck[i], (err, stats) => {\r\n *     console.log(stats.isDirectory());\r\n *     console.log(stats);\r\n *   });\r\n * }\r\n * ```\r\n *\r\n * The resulting output will resemble:\r\n *\r\n * ```console\r\n * true\r\n * Stats {\r\n *   dev: 16777220,\r\n *   mode: 16877,\r\n *   nlink: 3,\r\n *   uid: 501,\r\n *   gid: 20,\r\n *   rdev: 0,\r\n *   blksize: 4096,\r\n *   ino: 14214262,\r\n *   size: 96,\r\n *   blocks: 0,\r\n *   atimeMs: 1561174653071.963,\r\n *   mtimeMs: 1561174614583.3518,\r\n *   ctimeMs: 1561174626623.5366,\r\n *   birthtimeMs: 1561174126937.2893,\r\n *   atime: 2019-06-22T03:37:33.072Z,\r\n *   mtime: 2019-06-22T03:36:54.583Z,\r\n *   ctime: 2019-06-22T03:37:06.624Z,\r\n *   birthtime: 2019-06-22T03:28:46.937Z\r\n * }\r\n * false\r\n * Stats {\r\n *   dev: 16777220,\r\n *   mode: 33188,\r\n *   nlink: 1,\r\n *   uid: 501,\r\n *   gid: 20,\r\n *   rdev: 0,\r\n *   blksize: 4096,\r\n *   ino: 14214074,\r\n *   size: 8,\r\n *   blocks: 8,\r\n *   atimeMs: 1561174616618.8555,\r\n *   mtimeMs: 1561174614584,\r\n *   ctimeMs: 1561174614583.8145,\r\n *   birthtimeMs: 1561174007710.7478,\r\n *   atime: 2019-06-22T03:36:56.619Z,\r\n *   mtime: 2019-06-22T03:36:54.584Z,\r\n *   ctime: 2019-06-22T03:36:54.584Z,\r\n *   birthtime: 2019-06-22T03:26:47.711Z\r\n * }\r\n * ```\r\n * @since v0.0.2\r\n * @see {@link fs.stat}\r\n * @see {@link fs.promises.stat}\r\n */\r\nexport const stat: typeof fs.stat & typeof fs.stat.__promisify__ = universalify(gfs.stat);\r\n/**\r\n * Invokes the callback with the `fs.Stats` for the file descriptor.\r\n *\r\n * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail.\r\n * @since v0.1.95\r\n * @see {@link fs.fstat}\r\n * @see {@link fs.promises.fstat}\r\n */\r\nexport const fstat: typeof fs.fstat & typeof fs.fstat.__promisify__ = universalify(gfs.fstat);\r\n/**\r\n * Retrieves the `fs.Stats` for the symbolic link referred to by the path.\r\n * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic\r\n * link, then the link itself is stat-ed, not the file that it refers to.\r\n *\r\n * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details.\r\n * @since v0.1.30\r\n * @see {@link fs.lstat}\r\n * @see {@link fs.promises.lstat}\r\n */\r\nexport const lstat: typeof fs.lstat & typeof fs.lstat.__promisify__ = universalify(gfs.lstat);\r\n/**\r\n * Asynchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which\r\n * contains `path`. The callback gets two arguments `(err, stats)` where `stats`is an `fs.StatFs` object.\r\n *\r\n * In case of an error, the `err.code` will be one of `Common System Errors`.\r\n * @since v19.6.0, v18.15.0\r\n * @param path A path to an existing file or directory on the file system to be queried.\r\n * @see {@link fs.statfs}\r\n * @see {@link fs.promises.statfs}\r\n */\r\nexport const statfs: typeof fs.statfs & typeof fs.statfs.__promisify__ = universalify(gfs.statfs);\r\n/**\r\n * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than\r\n * a possible\r\n * exception are given to the completion callback.\r\n * @since v0.1.31\r\n * @see {@link fs.link}\r\n * @see {@link fs.promises.link}\r\n */\r\nexport const link: typeof fs.link & typeof fs.link.__promisify__ = universalify(gfs.link);\r\n/**\r\n * Creates the link called `path` pointing to `target`. No arguments other than a\r\n * possible exception are given to the completion callback.\r\n *\r\n * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details.\r\n *\r\n * The `type` argument is only available on Windows and ignored on other platforms.\r\n * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is\r\n * not a string, Node.js will autodetect `target` type and use `'file'` or `'dir'`.\r\n * If the `target` does not exist, `'file'` will be used. Windows junction points\r\n * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. Junction\r\n * points on NTFS volumes can only point to directories.\r\n *\r\n * Relative targets are relative to the link's parent directory.\r\n *\r\n * ```js\r\n * import { symlink } from 'node:fs';\r\n *\r\n * symlink('./mew', './mewtwo', callback);\r\n * ```\r\n *\r\n * The above example creates a symbolic link `mewtwo` which points to `mew` in the\r\n * same directory:\r\n *\r\n * ```bash\r\n * $ tree .\r\n * .\r\n * ├── mew\r\n * └── mewtwo -> ./mew\r\n * ```\r\n * @since v0.1.31\r\n * @param [type='null']\r\n * @see {@link fs.symlink}\r\n * @see {@link fs.promises.symlink}\r\n */\r\nexport const symlink: typeof fs.symlink & typeof fs.symlink.__promisify__ = universalify(gfs.symlink);\r\n/**\r\n * Reads the contents of the symbolic link referred to by `path`. The callback gets\r\n * two arguments `(err, linkString)`.\r\n *\r\n * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details.\r\n *\r\n * The optional `options` argument can be a string specifying an encoding, or an\r\n * object with an `encoding` property specifying the character encoding to use for\r\n * the link path passed to the callback. If the `encoding` is set to `'buffer'`,\r\n * the link path returned will be passed as a `Buffer` object.\r\n * @since v0.1.31\r\n * @see {@link fs.readlink}\r\n * @see {@link fs.promises.readlink}\r\n */\r\nexport const readlink: typeof fs.readlink & typeof fs.readlink.__promisify__ = universalify(gfs.readlink);\r\n/**\r\n * Asynchronously computes the canonical pathname by resolving `.`, `..`, and\r\n * symbolic links.\r\n *\r\n * A canonical pathname is not necessarily unique. Hard links and bind mounts can\r\n * expose a file system entity through many pathnames.\r\n *\r\n * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions:\r\n *\r\n * 1. No case conversion is performed on case-insensitive file systems.\r\n * 2. The maximum number of symbolic links is platform-independent and generally\r\n * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports.\r\n *\r\n * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths.\r\n *\r\n * Only paths that can be converted to UTF8 strings are supported.\r\n *\r\n * The optional `options` argument can be a string specifying an encoding, or an\r\n * object with an `encoding` property specifying the character encoding to use for\r\n * the path passed to the callback. If the `encoding` is set to `'buffer'`,\r\n * the path returned will be passed as a `Buffer` object.\r\n *\r\n * If `path` resolves to a socket or a pipe, the function will return a system\r\n * dependent name for that object.\r\n * @since v0.1.31\r\n * @see {@link fs.realpath}\r\n * @see {@link fs.promises.realpath}\r\n */\r\nexport const realpath: typeof fs.realpath & typeof fs.realpath.__promisify__ & {\r\n    native: {\r\n        (path: fs.PathLike, options: fs.EncodingOption): Promise<string>;\r\n        (path: fs.PathLike, options: fs.BufferEncodingOption): Promise<Buffer>;\r\n        (path: fs.PathLike, options: fs.EncodingOption): Promise<string | Buffer>;\r\n        (path: fs.PathLike): Promise<string>;\r\n    }\r\n} = universalify(gfs.realpath) as any;\r\n/**\r\n * Asynchronously removes a file or symbolic link. No arguments other than a\r\n * possible exception are given to the completion callback.\r\n *\r\n * ```js\r\n * import { unlink } from 'node:fs';\r\n * // Assuming that 'path/file.txt' is a regular file.\r\n * unlink('path/file.txt', (err) => {\r\n *   if (err) throw err;\r\n *   console.log('path/file.txt was deleted');\r\n * });\r\n * ```\r\n *\r\n * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a\r\n * directory, use {@link rmdir}.\r\n *\r\n * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details.\r\n * @since v0.0.2\r\n * @see {@link fs.unlink}\r\n * @see {@link fs.promises.unlink}\r\n */\r\nexport const unlink: typeof fs.unlink & typeof fs.unlink.__promisify__ = universalify(gfs.unlink);\r\n/**\r\n * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given\r\n * to the completion callback.\r\n *\r\n * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on\r\n * Windows and an `ENOTDIR` error on POSIX.\r\n *\r\n * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`.\r\n * @since v0.0.2\r\n * @see {@link fs.rmdir}\r\n * @see {@link fs.promises.rmdir}\r\n */\r\nexport const rmdir: typeof fs.rmdir & typeof fs.rmdir.__promisify__ = universalify(gfs.rmdir);\r\n/**\r\n * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the\r\n * completion callback.\r\n * @since v14.14.0\r\n * @see {@link fs.rm}\r\n * @see {@link fs.promises.rm}\r\n */\r\nexport const rm: typeof fs.rm & typeof fs.rm.__promisify__ = universalify(gfs.rm);\r\n/**\r\n * Asynchronously creates a directory.\r\n *\r\n * The callback is given a possible exception and, if `recursive` is `true`, the\r\n * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was\r\n * created (for instance, if it was previously created).\r\n *\r\n * The optional `options` argument can be an integer specifying `mode` (permission\r\n * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that\r\n * exists results in an error only\r\n * when `recursive` is false. If `recursive` is false and the directory exists,\r\n * an `EEXIST` error occurs.\r\n *\r\n * ```js\r\n * import { mkdir } from 'node:fs';\r\n *\r\n * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist.\r\n * mkdir('./tmp/a/apple', { recursive: true }, (err) => {\r\n *   if (err) throw err;\r\n * });\r\n * ```\r\n *\r\n * On Windows, using `fs.mkdir()` on the root directory even with recursion will\r\n * result in an error:\r\n *\r\n * ```js\r\n * import { mkdir } from 'node:fs';\r\n *\r\n * mkdir('/', { recursive: true }, (err) => {\r\n *   // => [Error: EPERM: operation not permitted, mkdir 'C:\\']\r\n * });\r\n * ```\r\n *\r\n * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details.\r\n * @since v0.1.8\r\n * @see {@link fs.mkdir}\r\n * @see {@link fs.promises.mkdir}\r\n */\r\nexport const mkdir: typeof fs.mkdir & typeof fs.mkdir.__promisify__ = universalify(gfs.mkdir);\r\n/**\r\n * Creates a unique temporary directory.\r\n *\r\n * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform\r\n * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms,\r\n * notably the BSDs, can return more than six random characters, and replace\r\n * trailing `X` characters in `prefix` with random characters.\r\n *\r\n * The created directory path is passed as a string to the callback's second\r\n * parameter.\r\n *\r\n * The optional `options` argument can be a string specifying an encoding, or an\r\n * object with an `encoding` property specifying the character encoding to use.\r\n *\r\n * ```js\r\n * import { mkdtemp } from 'node:fs';\r\n * import { join } from 'node:path';\r\n * import { tmpdir } from 'node:os';\r\n *\r\n * mkdtemp(join(tmpdir(), 'foo-'), (err, directory) => {\r\n *   if (err) throw err;\r\n *   console.log(directory);\r\n *   // Prints: /tmp/foo-itXde2 or C:\\Users\\...\\AppData\\Local\\Temp\\foo-itXde2\r\n * });\r\n * ```\r\n *\r\n * The `fs.mkdtemp()` method will append the six randomly selected characters\r\n * directly to the `prefix` string. For instance, given a directory `/tmp`, if the\r\n * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator\r\n * (`require('node:path').sep`).\r\n *\r\n * ```js\r\n * import { tmpdir } from 'node:os';\r\n * import { mkdtemp } from 'node:fs';\r\n *\r\n * // The parent directory for the new temporary directory\r\n * const tmpDir = tmpdir();\r\n *\r\n * // This method is *INCORRECT*:\r\n * mkdtemp(tmpDir, (err, directory) => {\r\n *   if (err) throw err;\r\n *   console.log(directory);\r\n *   // Will print something similar to `/tmpabc123`.\r\n *   // A new temporary directory is created at the file system root\r\n *   // rather than *within* the /tmp directory.\r\n * });\r\n *\r\n * // This method is *CORRECT*:\r\n * import { sep } from 'node:path';\r\n * mkdtemp(`${tmpDir}${sep}`, (err, directory) => {\r\n *   if (err) throw err;\r\n *   console.log(directory);\r\n *   // Will print something similar to `/tmp/abc123`.\r\n *   // A new temporary directory is created within\r\n *   // the /tmp directory.\r\n * });\r\n * ```\r\n * @since v5.10.0\r\n * @see {@link fs.mkdtemp}\r\n * @see {@link fs.promises.mkdtemp}\r\n */\r\nexport const mkdtemp: typeof fs.mkdtemp & typeof fs.mkdtemp.__promisify__ = universalify(gfs.mkdtemp);\r\n/**\r\n * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`.\r\n *\r\n * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details.\r\n *\r\n * The optional `options` argument can be a string specifying an encoding, or an\r\n * object with an `encoding` property specifying the character encoding to use for\r\n * the filenames passed to the callback. If the `encoding` is set to `'buffer'`,\r\n * the filenames returned will be passed as `Buffer` objects.\r\n *\r\n * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects.\r\n * @since v0.1.8\r\n * @see {@link fs.readdir}\r\n * @see {@link fs.promises.readdir}\r\n */\r\nexport const readdir: typeof fs.readdir & typeof fs.readdir.__promisify__ = universalify(gfs.readdir);\r\n/**\r\n * Closes the file descriptor. No arguments other than a possible exception are\r\n * given to the completion callback.\r\n *\r\n * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use\r\n * through any other `fs` operation may lead to undefined behavior.\r\n *\r\n * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail.\r\n * @since v0.0.2\r\n * @see {@link fs.close}\r\n * @see {@link fs.promises.close}\r\n */\r\nexport const close: typeof fs.close.__promisify__ & typeof fs.close = universalify(gfs.close); // NB: the order of __promisify__ is reversed here because the callback to fs.close() is marked optional.\r\n/**\r\n * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details.\r\n *\r\n * `mode` sets the file mode (permission and sticky bits), but only if the file was\r\n * created. On Windows, only the write permission can be manipulated; see {@link chmod}.\r\n *\r\n * The callback gets two arguments `(err, fd)`.\r\n *\r\n * Some characters (`< > : \" / \\ | ? *`) are reserved under Windows as documented\r\n * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains\r\n * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).\r\n *\r\n * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc.\r\n * @since v0.0.2\r\n * @param [flags='r'] See `support of file system `flags``.\r\n * @param [mode=0o666]\r\n * @see {@link fs.open}\r\n * @see {@link fs.promises.open}\r\n */\r\nexport const open: typeof fs.open & typeof fs.open.__promisify__ = universalify(gfs.open);\r\n/**\r\n * Change the file system timestamps of the object referenced by `path`.\r\n *\r\n * The `atime` and `mtime` arguments follow these rules:\r\n *\r\n * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`.\r\n * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown.\r\n * @since v0.4.2\r\n * @see {@link fs.utimes}\r\n * @see {@link fs.promises.utimes}\r\n */\r\nexport const utimes: typeof fs.utimes & typeof fs.utimes.__promisify__ = universalify(gfs.utimes);\r\n/**\r\n * Change the file system timestamps of the object referenced by the supplied file\r\n * descriptor. See {@link utimes}.\r\n * @since v0.4.2\r\n * @see {@link fs.futimes}\r\n * @see {@link fs.promises.futimes}\r\n */\r\nexport const futimes: typeof fs.futimes & typeof fs.futimes.__promisify__ = universalify(gfs.futimes);\r\n/**\r\n * Write `buffer` to the file specified by `fd`.\r\n *\r\n * `offset` determines the part of the buffer to be written, and `length` is\r\n * an integer specifying the number of bytes to write.\r\n *\r\n * `position` refers to the offset from the beginning of the file where this data\r\n * should be written. If `typeof position !== 'number'`, the data will be written\r\n * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html).\r\n *\r\n * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`.\r\n *\r\n * If this method is invoked as its `util.promisify()` ed version, it returns\r\n * a promise for an `Object` with `bytesWritten` and `buffer` properties.\r\n *\r\n * It is unsafe to use `fs.write()` multiple times on the same file without waiting\r\n * for the callback. For this scenario, {@link createWriteStream} is\r\n * recommended.\r\n *\r\n * On Linux, positional writes don't work when the file is opened in append mode.\r\n * The kernel ignores the position argument and always appends the data to\r\n * the end of the file.\r\n * @since v0.0.2\r\n * @param [offset=0]\r\n * @param [length=buffer.byteLength - offset]\r\n * @param [position='null']\r\n * @see {@link fs.write}\r\n * @see {@link fs.promises.write}\r\n */\r\nexport const write: typeof fs.write & typeof fs.write.__promisify__ = universalify(gfs.write, (bytesWritten, buffer) => ({bytesWritten, buffer}));\r\n/**\r\n * Read data from the file specified by `fd`.\r\n *\r\n * The callback is given the three arguments, `(err, bytesRead, buffer)`.\r\n *\r\n * If the file is not modified concurrently, the end-of-file is reached when the\r\n * number of bytes read is zero.\r\n *\r\n * If this method is invoked as its `util.promisify()` ed version, it returns\r\n * a promise for an `Object` with `bytesRead` and `buffer` properties.\r\n * @since v0.0.2\r\n * @param buffer The buffer that the data will be written to.\r\n * @param offset The position in `buffer` to write the data to.\r\n * @param length The number of bytes to read.\r\n * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If\r\n * `position` is an integer, the file position will be unchanged.\r\n * @see {@link fs.read}\r\n * @see {@link fs.promises.read}\r\n */\r\nexport const read: typeof fs.read & typeof fs.read.__promisify__ = universalify(gfs.read, (bytesRead, buffer) => ({bytesRead, buffer}));\r\n/**\r\n * Asynchronously reads the entire contents of a file.\r\n *\r\n * ```js\r\n * import { readFile } from 'node:fs';\r\n *\r\n * readFile('/etc/passwd', (err, data) => {\r\n *   if (err) throw err;\r\n *   console.log(data);\r\n * });\r\n * ```\r\n *\r\n * The callback is passed two arguments `(err, data)`, where `data` is the\r\n * contents of the file.\r\n *\r\n * If no encoding is specified, then the raw buffer is returned.\r\n *\r\n * If `options` is a string, then it specifies the encoding:\r\n *\r\n * ```js\r\n * import { readFile } from 'node:fs';\r\n *\r\n * readFile('/etc/passwd', 'utf8', callback);\r\n * ```\r\n *\r\n * When the path is a directory, the behavior of `fs.readFile()` and {@link fs.readFileSync} is platform-specific. On macOS, Linux, and Windows, an\r\n * error will be returned. On FreeBSD, a representation of the directory's contents\r\n * will be returned.\r\n *\r\n * ```js\r\n * import { readFile } from 'node:fs';\r\n *\r\n * // macOS, Linux, and Windows\r\n * readFile('<directory>', (err, data) => {\r\n *   // => [Error: EISDIR: illegal operation on a directory, read <directory>]\r\n * });\r\n *\r\n * //  FreeBSD\r\n * readFile('<directory>', (err, data) => {\r\n *   // => null, <data>\r\n * });\r\n * ```\r\n *\r\n * It is possible to abort an ongoing request using an `AbortSignal`. If a\r\n * request is aborted the callback is called with an `AbortError`:\r\n *\r\n * ```js\r\n * import { readFile } from 'node:fs';\r\n *\r\n * const controller = new AbortController();\r\n * const signal = controller.signal;\r\n * readFile(fileInfo[0].name, { signal }, (err, buf) => {\r\n *   // ...\r\n * });\r\n * // When you want to abort the request\r\n * controller.abort();\r\n * ```\r\n *\r\n * The `fs.readFile()` function buffers the entire file. To minimize memory costs,\r\n * when possible prefer streaming via `fs.createReadStream()`.\r\n *\r\n * Aborting an ongoing request does not abort individual operating\r\n * system requests but rather the internal buffering `fs.readFile` performs.\r\n * @since v0.1.29\r\n * @param path filename or file descriptor\r\n * @see {@link fs.readFile}\r\n * @see {@link fs.promises.readFile}\r\n */\r\nexport const readFile: typeof fs.readFile & typeof fs.readFile.__promisify__ = universalify(gfs.readFile);\r\n/**\r\n * When `file` is a filename, asynchronously writes data to the file, replacing the\r\n * file if it already exists. `data` can be a string or a buffer.\r\n *\r\n * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using\r\n * a file descriptor.\r\n *\r\n * The `encoding` option is ignored if `data` is a buffer.\r\n *\r\n * The `mode` option only affects the newly created file. See {@link open} for more details.\r\n *\r\n * ```js\r\n * import { writeFile } from 'node:fs';\r\n * import { Buffer } from 'node:buffer';\r\n *\r\n * const data = new Uint8Array(Buffer.from('Hello Node.js'));\r\n * writeFile('message.txt', data, (err) => {\r\n *   if (err) throw err;\r\n *   console.log('The file has been saved!');\r\n * });\r\n * ```\r\n *\r\n * If `options` is a string, then it specifies the encoding:\r\n *\r\n * ```js\r\n * import { writeFile } from 'node:fs';\r\n *\r\n * writeFile('message.txt', 'Hello Node.js', 'utf8', callback);\r\n * ```\r\n *\r\n * It is unsafe to use `fs.writeFile()` multiple times on the same file without\r\n * waiting for the callback. For this scenario, {@link createWriteStream} is\r\n * recommended.\r\n *\r\n * Similarly to `fs.readFile` \\- `fs.writeFile` is a convenience method that\r\n * performs multiple `write` calls internally to write the buffer passed to it.\r\n * For performance sensitive code consider using {@link createWriteStream}.\r\n *\r\n * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`.\r\n * Cancelation is \"best effort\", and some amount of data is likely still\r\n * to be written.\r\n *\r\n * ```js\r\n * import { writeFile } from 'node:fs';\r\n * import { Buffer } from 'node:buffer';\r\n *\r\n * const controller = new AbortController();\r\n * const { signal } = controller;\r\n * const data = new Uint8Array(Buffer.from('Hello Node.js'));\r\n * writeFile('message.txt', data, { signal }, (err) => {\r\n *   // When a request is aborted - the callback is called with an AbortError\r\n * });\r\n * // When the request should be aborted\r\n * controller.abort();\r\n * ```\r\n *\r\n * Aborting an ongoing request does not abort individual operating\r\n * system requests but rather the internal buffering `fs.writeFile` performs.\r\n * @since v0.1.29\r\n * @param file filename or file descriptor\r\n * @see {@link fs.writeFile}\r\n * @see {@link fs.promises.writeFile}\r\n */\r\nexport const writeFile: typeof fs.writeFile & typeof fs.writeFile.__promisify__ = universalify(gfs.writeFile);\r\n/**\r\n * Asynchronously append data to a file, creating the file if it does not yet\r\n * exist. `data` can be a string or a `Buffer`.\r\n *\r\n * The `mode` option only affects the newly created file. See {@link open} for more details.\r\n *\r\n * ```js\r\n * import { appendFile } from 'node:fs';\r\n *\r\n * appendFile('message.txt', 'data to append', (err) => {\r\n *   if (err) throw err;\r\n *   console.log('The \"data to append\" was appended to file!');\r\n * });\r\n * ```\r\n *\r\n * If `options` is a string, then it specifies the encoding:\r\n *\r\n * ```js\r\n * import { appendFile } from 'node:fs';\r\n *\r\n * appendFile('message.txt', 'data to append', 'utf8', callback);\r\n * ```\r\n *\r\n * The `path` may be specified as a numeric file descriptor that has been opened\r\n * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will\r\n * not be closed automatically.\r\n *\r\n * ```js\r\n * import { open, close, appendFile } from 'node:fs';\r\n *\r\n * function closeFd(fd) {\r\n *   close(fd, (err) => {\r\n *     if (err) throw err;\r\n *   });\r\n * }\r\n *\r\n * open('message.txt', 'a', (err, fd) => {\r\n *   if (err) throw err;\r\n *\r\n *   try {\r\n *     appendFile(fd, 'data to append', 'utf8', (err) => {\r\n *       closeFd(fd);\r\n *       if (err) throw err;\r\n *     });\r\n *   } catch (err) {\r\n *     closeFd(fd);\r\n *     throw err;\r\n *   }\r\n * });\r\n * ```\r\n * @since v0.6.7\r\n * @param path filename or file descriptor\r\n * @see {@link fs.appendFile}\r\n * @see {@link fs.promises.appendFile}\r\n */\r\nexport const appendFile: typeof fs.appendFile & typeof fs.appendFile.__promisify__ = universalify(gfs.appendFile);\r\n/**\r\n * Tests a user's permissions for the file or directory specified by `path`.\r\n * The `mode` argument is an optional integer that specifies the accessibility\r\n * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK`\r\n * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for\r\n * possible values of `mode`.\r\n *\r\n * The final argument, `callback`, is a callback function that is invoked with\r\n * a possible error argument. If any of the accessibility checks fail, the error\r\n * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable.\r\n *\r\n * ```js\r\n * import { access, constants } from 'node:fs';\r\n *\r\n * const file = 'package.json';\r\n *\r\n * // Check if the file exists in the current directory.\r\n * access(file, constants.F_OK, (err) => {\r\n *   console.log(`${file} ${err ? 'does not exist' : 'exists'}`);\r\n * });\r\n *\r\n * // Check if the file is readable.\r\n * access(file, constants.R_OK, (err) => {\r\n *   console.log(`${file} ${err ? 'is not readable' : 'is readable'}`);\r\n * });\r\n *\r\n * // Check if the file is writable.\r\n * access(file, constants.W_OK, (err) => {\r\n *   console.log(`${file} ${err ? 'is not writable' : 'is writable'}`);\r\n * });\r\n *\r\n * // Check if the file is readable and writable.\r\n * access(file, constants.R_OK | constants.W_OK, (err) => {\r\n *   console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`);\r\n * });\r\n * ```\r\n *\r\n * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing\r\n * so introduces a race condition, since other processes may change the file's\r\n * state between the two calls. Instead, user code should open/read/write the\r\n * file directly and handle the error raised if the file is not accessible.\r\n *\r\n * **write (NOT RECOMMENDED)**\r\n *\r\n * ```js\r\n * import { access, open, close } from 'node:fs';\r\n *\r\n * access('myfile', (err) => {\r\n *   if (!err) {\r\n *     console.error('myfile already exists');\r\n *     return;\r\n *   }\r\n *\r\n *   open('myfile', 'wx', (err, fd) => {\r\n *     if (err) throw err;\r\n *\r\n *     try {\r\n *       writeMyData(fd);\r\n *     } finally {\r\n *       close(fd, (err) => {\r\n *         if (err) throw err;\r\n *       });\r\n *     }\r\n *   });\r\n * });\r\n * ```\r\n *\r\n * **write (RECOMMENDED)**\r\n *\r\n * ```js\r\n * import { open, close } from 'node:fs';\r\n *\r\n * open('myfile', 'wx', (err, fd) => {\r\n *   if (err) {\r\n *     if (err.code === 'EEXIST') {\r\n *       console.error('myfile already exists');\r\n *       return;\r\n *     }\r\n *\r\n *     throw err;\r\n *   }\r\n *\r\n *   try {\r\n *     writeMyData(fd);\r\n *   } finally {\r\n *     close(fd, (err) => {\r\n *       if (err) throw err;\r\n *     });\r\n *   }\r\n * });\r\n * ```\r\n *\r\n * **read (NOT RECOMMENDED)**\r\n *\r\n * ```js\r\n * import { access, open, close } from 'node:fs';\r\n * access('myfile', (err) => {\r\n *   if (err) {\r\n *     if (err.code === 'ENOENT') {\r\n *       console.error('myfile does not exist');\r\n *       return;\r\n *     }\r\n *\r\n *     throw err;\r\n *   }\r\n *\r\n *   open('myfile', 'r', (err, fd) => {\r\n *     if (err) throw err;\r\n *\r\n *     try {\r\n *       readMyData(fd);\r\n *     } finally {\r\n *       close(fd, (err) => {\r\n *         if (err) throw err;\r\n *       });\r\n *     }\r\n *   });\r\n * });\r\n * ```\r\n *\r\n * **read (RECOMMENDED)**\r\n *\r\n * ```js\r\n * import { open, close } from 'node:fs';\r\n *\r\n * open('myfile', 'r', (err, fd) => {\r\n *   if (err) {\r\n *     if (err.code === 'ENOENT') {\r\n *       console.error('myfile does not exist');\r\n *       return;\r\n *     }\r\n *\r\n *     throw err;\r\n *   }\r\n *\r\n *   try {\r\n *     readMyData(fd);\r\n *   } finally {\r\n *     close(fd, (err) => {\r\n *       if (err) throw err;\r\n *     });\r\n *   }\r\n * });\r\n * ```\r\n *\r\n * The \"not recommended\" examples above check for accessibility and then use the\r\n * file; the \"recommended\" examples are better because they use the file directly\r\n * and handle the error, if any.\r\n *\r\n * In general, check for the accessibility of a file only if the file will not be\r\n * used directly, for example when its accessibility is a signal from another\r\n * process.\r\n *\r\n * On Windows, access-control policies (ACLs) on a directory may limit access to\r\n * a file or directory. The `fs.access()` function, however, does not check the\r\n * ACL and therefore may report that a path is accessible even if the ACL restricts\r\n * the user from reading or writing to it.\r\n * @since v0.11.15\r\n * @param [mode=fs.constants.F_OK]\r\n * @see {@link fs.access}\r\n * @see {@link fs.promises.access}\r\n */\r\nexport const access: typeof fs.access & typeof fs.access.__promisify__ = universalify(gfs.access);\r\n/**\r\n * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it\r\n * already exists. No arguments other than a possible exception are given to the\r\n * callback function. Node.js makes no guarantees about the atomicity of the copy\r\n * operation. If an error occurs after the destination file has been opened for\r\n * writing, Node.js will attempt to remove the destination.\r\n *\r\n * `mode` is an optional integer that specifies the behavior\r\n * of the copy operation. It is possible to create a mask consisting of the bitwise\r\n * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`).\r\n *\r\n * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already\r\n * exists.\r\n * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a\r\n * copy-on-write reflink. If the platform does not support copy-on-write, then a\r\n * fallback copy mechanism is used.\r\n * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to\r\n * create a copy-on-write reflink. If the platform does not support\r\n * copy-on-write, then the operation will fail.\r\n *\r\n * ```js\r\n * import { copyFile, constants } from 'node:fs';\r\n *\r\n * function callback(err) {\r\n *   if (err) throw err;\r\n *   console.log('source.txt was copied to destination.txt');\r\n * }\r\n *\r\n * // destination.txt will be created or overwritten by default.\r\n * copyFile('source.txt', 'destination.txt', callback);\r\n *\r\n * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.\r\n * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback);\r\n * ```\r\n * @since v8.5.0\r\n * @param src source filename to copy\r\n * @param dest destination filename of the copy operation\r\n * @param [mode=0] modifiers for copy operation.\r\n * @see {@link fs.copyFile}\r\n * @see {@link fs.promises.copyFile}\r\n */\r\nexport const copyFile: typeof fs.copyFile & typeof fs.copyFile.__promisify__ = universalify(gfs.copyFile);\r\n/**\r\n * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`.\r\n *\r\n * `position` is the offset from the beginning of the file where this data\r\n * should be written. If `typeof position !== 'number'`, the data will be written\r\n * at the current position.\r\n *\r\n * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`.\r\n *\r\n * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties.\r\n *\r\n * It is unsafe to use `fs.writev()` multiple times on the same file without\r\n * waiting for the callback. For this scenario, use {@link createWriteStream}.\r\n *\r\n * On Linux, positional writes don't work when the file is opened in append mode.\r\n * The kernel ignores the position argument and always appends the data to\r\n * the end of the file.\r\n * @since v12.9.0\r\n * @param [position='null']\r\n * @see {@link fs.writev}\r\n * @see {@link fs.promises.writev}\r\n */\r\nexport const writev: typeof fs.writev & typeof fs.writev.__promisify__ = universalify(gfs.writev, (bytesWritten, buffers) => ({bytesWritten, buffers}));\r\n/**\r\n * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s\r\n * using `readv()`.\r\n *\r\n * `position` is the offset from the beginning of the file from where data\r\n * should be read. If `typeof position !== 'number'`, the data will be read\r\n * from the current position.\r\n *\r\n * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file.\r\n *\r\n * If this method is invoked as its `util.promisify()` ed version, it returns\r\n * a promise for an `Object` with `bytesRead` and `buffers` properties.\r\n * @since v13.13.0, v12.17.0\r\n * @param [position='null']\r\n * @see {@link fs.readv}\r\n * @see {@link fs.promises.readv}\r\n */\r\nexport const readv: typeof fs.readv & typeof fs.readv.__promisify__ = universalify(gfs.readv, (bytesRead, buffers) => ({bytesRead, buffers}));\r\n/**\r\n * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for\r\n * more details.\r\n *\r\n * Creates an `fs.Dir`, which contains all further functions for reading from\r\n * and cleaning up the directory.\r\n *\r\n * The `encoding` option sets the encoding for the `path` while opening the\r\n * directory and subsequent read operations.\r\n * @since v12.12.0\r\n * @see {@link fs.opendir}\r\n * @see {@link fs.promises.opendir}\r\n */\r\nexport const opendir: typeof fs.opendir & typeof fs.opendir.__promisify__ = universalify(gfs.opendir);\r\n\r\n/**\r\n * Asynchronously copies the entire directory structure from `src` to `dest`,\r\n * including subdirectories and files.\r\n *\r\n * When copying a directory to another directory, globs are not supported and\r\n * behavior is similar to `cp dir1/ dir2/`.\r\n * @since v16.7.0\r\n * @experimental\r\n * @param src source path to copy.\r\n * @param dest destination path to copy to.\r\n */\r\nexport const cp: typeof fs.cp & {\r\n    cp(source: string | URL, destination: string | URL): Promise<void>;\r\n    cp(source: string | URL, destination: string | URL, opts: fs.CopyOptions): Promise<void>;\r\n} = universalify(gfs.cp) as any;\r\n\r\nif (typeof rfs.realpath.native === 'function') {\r\n    realpath.native = universalify(rfs.realpath.native) as any;\r\n} else {\r\n    process.emitWarning(\r\n        'fs.realpath.native is not a function. Is fs being monkey-patched?',\r\n        'Warning', 'fs-extra-WARN0003'\r\n    );\r\n}\r\n","'use strict';\r\n\r\nimport { sep } from 'path';\r\n\r\nexport default function (thePath: string, potentialParent: string) {\r\n    // For inside-directory checking, we want to allow trailing slashes, so normalize.\r\n    thePath = stripTrailingSep(thePath);\r\n    potentialParent = stripTrailingSep(potentialParent);\r\n\r\n    // Node treats only Windows as case-insensitive in its path module; we follow those conventions.\r\n    if (process.platform === 'win32') {\r\n        thePath = thePath.toLowerCase();\r\n        potentialParent = potentialParent.toLowerCase();\r\n    }\r\n\r\n    return thePath.lastIndexOf(potentialParent, 0) === 0 &&\r\n        (\r\n            thePath[potentialParent.length] === sep ||\r\n            thePath[potentialParent.length] === undefined\r\n        );\r\n}\r\n\r\nfunction stripTrailingSep(thePath: string) {\r\n    if (thePath[thePath.length - 1] === sep) {\r\n        return thePath.slice(0, -1);\r\n    }\r\n    return thePath;\r\n}\r\n","'use strict';\r\n\r\nimport assert from 'assert';\r\nimport { dirname } from 'path';\r\nimport { resolve } from 'path';\r\nimport isInside from './path-is-inside';\r\n\r\nimport { lstat, readdir, unlink, rm, rmdir } from 'graceful-fs';\r\n\r\nimport type { VacuumOptions, ErrorCallback } from '../types';\r\n\r\nconst noop = () => {};\r\n\r\n/**\r\n * Remove the empty branches of a directory tree, optionally up to (but not including) a specified base directory.\r\n * Optionally nukes the leaf directory.\r\n * @param directory Leaf node to remove. **Must be a directory, symlink, or file.**\r\n * @param options Options for `fs-vacuum`.\r\n * @param callback Function to call once vacuuming is complete.\r\n * @example ```\r\n * var logger = require(\"npmlog\");\r\n * var vacuum = require(\"fs-vacuum\");\r\n *\r\n * var options = {\r\n *   base  : \"/path/to/my/tree/root\",\r\n *   purge : true,\r\n *   log   : logger.silly.bind(logger, \"myCleanup\")\r\n * };\r\n *\r\n * // Assuming there are no other files or directories in \"out\", \"to\", or \"my\",\r\n * // the final path will just be \"/path/to/my/tree/root\".\r\n * vacuum(\"/path/to/my/tree/root/out/to/my/files\", function (error) {\r\n *   if (error) console.error(\"Unable to cleanly vacuum:\", error.message);\r\n * });\r\n * ```\r\n */\r\nexport default function vacuum(directory: string, options?: VacuumOptions): Promise<void>;\r\nexport default function vacuum(directory: string, options?: VacuumOptions, callback?: ErrorCallback): void;\r\nexport default function vacuum(leaf: string, options: VacuumOptions = {}, cb?: ErrorCallback): void | Promise<void> {\r\n    if (cb === undefined) {\r\n        return new Promise((resolve, reject) => {\r\n            vacuum(leaf, options, err => err ? reject(err) : resolve());\r\n        });\r\n    }\r\n\r\n    assert(typeof leaf === 'string', 'must pass in path to remove');\r\n    assert(typeof options === 'object', 'options must be an object');\r\n    assert(typeof cb === 'function', 'must pass in callback');\r\n\r\n    const log = options.log ?? noop;\r\n\r\n    leaf = leaf && resolve(leaf);\r\n    var base = options.base && resolve(options.base);\r\n    if (base && !isInside(leaf, base)) {\r\n        return cb(new Error(leaf + ' is not a child of ' + base));\r\n    }\r\n\r\n    lstat(leaf, (error, stat) => {\r\n        if (error) {\r\n            if (error.code === 'ENOENT') return cb(null);\r\n\r\n            log(error.stack);\r\n            return cb(error);\r\n        }\r\n\r\n        if (!(stat && (stat.isDirectory() || stat.isSymbolicLink() || stat.isFile()))) {\r\n            log(leaf, 'is not a directory, file, or link');\r\n            return cb(new Error(leaf + ' is not a directory, file, or link'));\r\n        }\r\n\r\n        if (options.purge) {\r\n            log('purging', leaf);\r\n            rm(leaf, { recursive: true, force: true }, error => {\r\n                if (error) return cb(error);\r\n\r\n                next(dirname(leaf));\r\n            });\r\n        } else if (!stat.isDirectory()) {\r\n            log('removing', leaf);\r\n            unlink(leaf, error => {\r\n                if (error) return cb(error);\r\n\r\n                next(dirname(leaf));\r\n            });\r\n        } else {\r\n            next(leaf);\r\n        }\r\n    });\r\n\r\n    function next(branch: string) {\r\n        branch = branch && resolve(branch);\r\n        // either we've reached the base or we've reached the root\r\n        if ((base && branch === base) || branch === dirname(branch)) {\r\n            log('finished vacuuming up to', branch);\r\n            return cb!(null);\r\n        }\r\n\r\n        readdir(branch, function (error, files) {\r\n            if (error) {\r\n                if (error.code === 'ENOENT') return cb!(null);\r\n\r\n                log('unable to check directory', branch, 'due to', error.message);\r\n                return cb!(error);\r\n            }\r\n\r\n            if (files.length > 0) {\r\n                log('quitting because other entries in', branch);\r\n                return cb!(null);\r\n            }\r\n\r\n            if (branch === process.env.HOME) {\r\n                log('quitting because cannot remove home directory', branch);\r\n                return cb!(null);\r\n            }\r\n\r\n            log('removing', branch);\r\n            lstat(branch, (error, stat) => {\r\n                if (error) {\r\n                    if (error.code === 'ENOENT') return cb!(null);\r\n\r\n                    log('unable to lstat', branch, 'due to', error.message);\r\n                    return cb!(error);\r\n                }\r\n\r\n                var remove = stat.isDirectory() ? rmdir : unlink;\r\n                remove(branch, error => {\r\n                    if (error) {\r\n                        if (error.code === 'ENOENT') {\r\n                            log('quitting because lost the race to remove', branch);\r\n                            return cb!(null);\r\n                        }\r\n                        if (error.code === 'ENOTEMPTY' || error.code === 'EEXIST') {\r\n                            log('quitting because new (racy) entries in', branch);\r\n                            return cb!(null);\r\n                        }\r\n\r\n                        log('unable to remove', branch, 'due to', error.message);\r\n                        return cb!(error);\r\n                    }\r\n\r\n                    next(dirname(branch));\r\n                });\r\n            });\r\n        });\r\n    }\r\n}\r\n","'use strict'\n\nexports.fromCallback = function (fn) {\n  return Object.defineProperty(function (...args) {\n    if (typeof args[args.length - 1] === 'function') fn.apply(this, args)\n    else {\n      return new Promise((resolve, reject) => {\n        args.push((err, res) => (err != null) ? reject(err) : resolve(res))\n        fn.apply(this, args)\n      })\n    }\n  }, 'name', { value: fn.name })\n}\n\nexports.fromPromise = function (fn) {\n  return Object.defineProperty(function (...args) {\n    const cb = args[args.length - 1]\n    if (typeof cb !== 'function') return fn.apply(this, args)\n    else {\n      args.pop()\n      fn.apply(this, args).then(r => cb(null, r), cb)\n    }\n  }, 'name', { value: fn.name })\n}\n","// Adapted from https://github.com/sindresorhus/make-dir\r\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)\r\n// 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:\r\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r\n// 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.\r\n\r\nimport { parse } from 'path';\r\n\r\n// https://github.com/nodejs/node/issues/8987\r\n// https://github.com/libuv/libuv/pull/1088\r\nexport function checkPath(pth) {\r\n    if (process.platform === 'win32') {\r\n        const pathHasInvalidWinCharacters = /[<>:\"|?*]/.test(pth.replace(parse(pth).root, ''));\r\n\r\n        if (pathHasInvalidWinCharacters) {\r\n            const error = new Error(`Path contains invalid characters: ${pth}`);\r\n            error.code = 'EINVAL';\r\n            throw error;\r\n        }\r\n    }\r\n}\r\n","\r\nimport { mkdir, mkdirSync } from '@fs/index';\r\nimport { checkPath } from './utils';\r\n\r\nconst getMode = options => {\r\n    const defaults = { mode: 0o777 };\r\n    if (typeof options === 'number') return options;\r\n    return ({ ...defaults, ...options }).mode;\r\n};\r\n\r\nexport async function makeDir(dir, options) {\r\n    checkPath(dir);\r\n\r\n    return mkdir(dir, {\r\n        mode: getMode(options),\r\n        recursive: true\r\n    });\r\n}\r\n\r\nexport function makeDirSync(dir, options) {\r\n    checkPath(dir);\r\n\r\n    return mkdirSync(dir, {\r\n        mode: getMode(options),\r\n        recursive: true\r\n    });\r\n}\r\n","// @ts-check\r\n\r\nimport { fromPromise as u } from 'universalify';\r\nimport { makeDir as _makeDir } from './make-dir';\r\nexport { makeDirSync as mkdirsSync } from './make-dir';\r\nexport const mkdirs = u(_makeDir);\r\n","import { access } from './index';\r\n\r\n/**\r\n * Test whether or not the given path exists by checking with the file system. Like\r\n * [`fs.exists`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback), but with a normal\r\n * callback signature (err, exists). Uses `fs.access` under the hood.\r\n *\r\n * @example\r\n * import * as fs from 'fs-extra'\r\n *\r\n * const file = '/tmp/this/path/does/not/exist/file.txt'\r\n *\r\n * // With a callback:\r\n * fs.pathExists(file, (err, exists) => {\r\n *   console.log(err) // => null\r\n *   console.log(exists) // => false\r\n * })\r\n *\r\n * // Promise usage:\r\n * fs.pathExists(file)\r\n *   .then(exists => console.log(exists)) // => false\r\n *\r\n * // With async/await:\r\n * async function asyncAwait () {\r\n *   const exists = await fs.pathExists(file)\r\n *\r\n *   console.log(exists) // => false\r\n * }\r\n *\r\n * asyncAwait()\r\n */\r\nexport function exists(path: string): Promise<boolean>;\r\nexport function exists(path: string, callback: (err: NodeJS.ErrnoException | null, exists: boolean) => void): void;\r\nexport function exists(path: string, callback?: (err: NodeJS.ErrnoException | null, exists: boolean) => void): void | Promise<boolean> {\r\n    if (callback) {\r\n        return access(path, err => callback(null, !err));\r\n    }\r\n    return access(path).then(() => true, () => false);\r\n}\r\n","// @ts-check\r\n\r\nimport { open, futimes, close, openSync, futimesSync, closeSync } from '@fs/index';\r\nimport { fromPromise } from 'universalify';\r\n\r\n/**\r\n * @param {import(\"fs\").PathLike} path\r\n * @param {import(\"fs\").TimeLike} atime\r\n * @param {import(\"fs\").TimeLike} mtime\r\n */\r\nasync function _utimesMillis(path, atime, mtime) {\r\n    // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)\r\n    const fd = await open(path, 'r+');\r\n\r\n    let closeErr = null;\r\n\r\n    try {\r\n        await futimes(fd, atime, mtime);\r\n    } finally {\r\n        try {\r\n            await close(fd);\r\n        } catch (e) {\r\n            closeErr = e;\r\n        }\r\n    }\r\n\r\n    if (closeErr) {\r\n        throw closeErr;\r\n    }\r\n}\r\n\r\n/**\r\n * @param {import(\"fs\").PathLike} path\r\n * @param {import(\"fs\").TimeLike} atime\r\n * @param {import(\"fs\").TimeLike} mtime\r\n */\r\nexport function utimesMillisSync(path, atime, mtime) {\r\n    const fd = openSync(path, 'r+');\r\n    futimesSync(fd, atime, mtime);\r\n    return closeSync(fd);\r\n}\r\n\r\nexport const utimesMillis = fromPromise(_utimesMillis);\r\n","// @ts-check\r\n\r\nimport { stat, lstat, statSync, lstatSync } from '@fs/index';\r\nimport { fromPromise } from 'universalify';\r\nimport { basename, resolve, dirname, parse, sep } from 'path';\r\n\r\n/**\r\n * @typedef {import('fs').PathOrFileDescriptor} PathOrFileDescriptor\r\n * @typedef {import('fs').PathLike} PathLike\r\n */\r\n\r\n/**\r\n * @param {PathLike} src\r\n * @param {PathLike} dest\r\n * @param {{ dereference?: boolean }} opts\r\n * @returns\r\n */\r\nasync function getStats(src, dest, opts) {\r\n    /**\r\n     * @type {(file: PathLike) => Promise<import('fs').BigIntStats>}\r\n     */\r\n    const statFunc = opts.dereference\r\n        ? file => stat(file, { bigint: true })\r\n        : file => lstat(file, { bigint: true });\r\n    const [srcStat, destStat] = await Promise.all([\r\n        statFunc(src),\r\n        statFunc(dest).catch(err => {\r\n            if (err.code === 'ENOENT') return null;\r\n            throw err;\r\n        })\r\n    ]);\r\n    return { srcStat, destStat };\r\n}\r\n\r\n/**\r\n * @param {PathLike} src\r\n * @param {PathLike} dest\r\n * @param {{ dereference?: boolean }} opts\r\n * @returns\r\n */\r\nfunction getStatsSync(src, dest, opts) {\r\n    let destStat;\r\n    /**\r\n     * @type {(file: PathLike) => import('fs').BigIntStats}\r\n     */\r\n    const statFunc = opts.dereference\r\n        ? file => statSync(file, { bigint: true })\r\n        : file => lstatSync(file, { bigint: true });\r\n    const srcStat = statFunc(src);\r\n    try {\r\n        destStat = statFunc(dest);\r\n    } catch (err) {\r\n        if (/** @type {NodeJS.ErrnoException} */ (err).code === 'ENOENT') return { srcStat, destStat: null };\r\n        throw err;\r\n    }\r\n    return { srcStat, destStat };\r\n}\r\n\r\n/**\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {string} funcName\r\n * @param {{ dereference?: boolean }} opts\r\n * @returns {Promise<{ srcStat: import('fs').BigIntStats, destStat: import('fs').BigIntStats | null, isChangingCase?: boolean }>}\r\n */\r\nasync function _checkPaths(src, dest, funcName, opts) {\r\n    const { srcStat, destStat } = await getStats(src, dest, opts);\r\n    if (destStat) {\r\n        if (areIdentical(srcStat, destStat)) {\r\n            const srcBaseName = basename(src);\r\n            const destBaseName = basename(dest);\r\n            if (funcName === 'move' && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {\r\n                return { srcStat, destStat, isChangingCase: true };\r\n            }\r\n            throw new Error('Source and destination must not be the same.');\r\n        }\r\n        if (srcStat.isDirectory() && !destStat.isDirectory()) {\r\n            throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);\r\n        }\r\n        if (!srcStat.isDirectory() && destStat.isDirectory()) {\r\n            throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);\r\n        }\r\n    }\r\n\r\n    if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\r\n        throw new Error(errMsg(src, dest, funcName));\r\n    }\r\n\r\n    return { srcStat, destStat };\r\n}\r\n\r\n/**\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {string} funcName\r\n * @param {{ dereference?: boolean }} opts\r\n */\r\nexport function checkPathsSync(src, dest, funcName, opts) {\r\n    const { srcStat, destStat } = getStatsSync(src, dest, opts);\r\n\r\n    if (destStat) {\r\n        if (areIdentical(srcStat, destStat)) {\r\n            const srcBaseName = basename(src);\r\n            const destBaseName = basename(dest);\r\n            if (funcName === 'move'\r\n                && srcBaseName !== destBaseName\r\n                && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {\r\n                return { srcStat, destStat, isChangingCase: true };\r\n            }\r\n            throw new Error('Source and destination must not be the same.');\r\n        }\r\n        if (srcStat.isDirectory() && !destStat.isDirectory()) {\r\n            throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);\r\n        }\r\n        if (!srcStat.isDirectory() && destStat.isDirectory()) {\r\n            throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);\r\n        }\r\n    }\r\n\r\n    if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\r\n        throw new Error(errMsg(src, dest, funcName));\r\n    }\r\n    return { srcStat, destStat };\r\n}\r\n\r\n// recursively check if dest parent is a subdirectory of src.\r\n// It works for all file types including symlinks since it\r\n// checks the src and dest inodes. It starts from the deepest\r\n// parent and stops once it reaches the src parent or the root path.\r\n/**\r\n *\r\n * @param {string} src\r\n * @param {import('fs').BigIntStats} srcStat\r\n * @param {string} dest\r\n * @param {string} funcName\r\n * @returns {Promise<void>}\r\n */\r\nasync function _checkParentPaths(src, srcStat, dest, funcName) {\r\n    const srcParent = resolve(dirname(src));\r\n    const destParent = resolve(dirname(dest));\r\n    if (destParent === srcParent || destParent === parse(destParent).root) return;\r\n\r\n    let destStat;\r\n    try {\r\n        destStat = await stat(destParent, { bigint: true });\r\n    } catch (err) {\r\n        if (/** @type {NodeJS.ErrnoException} */ (err).code === 'ENOENT') return;\r\n        throw err;\r\n    }\r\n\r\n    if (areIdentical(srcStat, destStat)) {\r\n        throw new Error(errMsg(src, dest, funcName));\r\n    }\r\n\r\n    return checkParentPaths(src, srcStat, destParent, funcName);\r\n}\r\n\r\n/**\r\n *\r\n * @param {string} src\r\n * @param {import('fs').BigIntStats} srcStat\r\n * @param {string} dest\r\n * @param {string} funcName\r\n * @returns\r\n */\r\nexport function checkParentPathsSync(src, srcStat, dest, funcName) {\r\n    const srcParent = resolve(dirname(src));\r\n    const destParent = resolve(dirname(dest));\r\n    if (destParent === srcParent || destParent === parse(destParent).root) return;\r\n    let destStat;\r\n    try {\r\n        destStat = statSync(destParent, { bigint: true });\r\n    } catch (err) {\r\n        if (/** @type {NodeJS.ErrnoException} */ (err).code === 'ENOENT') return;\r\n        throw err;\r\n    }\r\n    if (areIdentical(srcStat, destStat)) {\r\n        throw new Error(errMsg(src, dest, funcName));\r\n    }\r\n    return checkParentPathsSync(src, srcStat, destParent, funcName);\r\n}\r\n\r\n/**\r\n *\r\n * @param {import('fs').BigIntStats} srcStat\r\n * @param {import('fs').BigIntStats} destStat\r\n * @returns {boolean}\r\n */\r\nexport function areIdentical(srcStat, destStat) {\r\n    return !!destStat.ino && !!destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;\r\n}\r\n\r\n// return true if dest is a subdir of src, otherwise false.\r\n// It only checks the path strings.\r\n/**\r\n * @param {string} src\r\n * @param {string} dest\r\n * @returns\r\n */\r\nexport function isSrcSubdir(src, dest) {\r\n    const srcArr = resolve(src).split(sep).filter(i => i);\r\n    const destArr = resolve(dest).split(sep).filter(i => i);\r\n    return srcArr.every((cur, i) => destArr[i] === cur);\r\n}\r\n\r\n/**\r\n *\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {string} funcName\r\n * @returns\r\n */\r\nfunction errMsg(src, dest, funcName) {\r\n    return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;\r\n}\r\n\r\n// checkPaths\r\nexport const checkPaths = fromPromise(_checkPaths);\r\n// checkParent\r\nexport const checkParentPaths = fromPromise(_checkParentPaths);\r\n","// @ts-check\r\n\r\nimport { stat as _stat, lstat, unlink, copyFile as _copyFile, chmod, mkdir, readdir, readlink, symlink } from '@fs/index';\r\nimport { dirname, join, resolve } from 'path';\r\nimport { mkdirs } from '../mkdirs';\r\nimport { exists as pathExists } from '@fs/exists';\r\nimport { utimesMillis } from '../util/utimes';\r\nimport { checkPaths, checkParentPaths, isSrcSubdir } from '../util/stat';\r\n\r\nimport { fromPromise } from 'universalify';\r\n\r\n/**\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {import('fs-extra').CopyOptions & { clobber?: boolean, overwrite?: boolean }} [opts]\r\n */\r\nexport default fromPromise(async function copy(src, dest, opts = {}) {\r\n    if (typeof opts === 'function') {\r\n        opts = { filter: opts };\r\n    }\r\n\r\n    opts.clobber = 'clobber' in opts ? !!opts.clobber : true; // default to true for now\r\n    opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber; // overwrite falls back to clobber\r\n\r\n    // Warn about using preserveTimestamps on 32-bit node\r\n    if (opts.preserveTimestamps && process.arch === 'ia32') {\r\n        process.emitWarning(\r\n            'Using the preserveTimestamps option in 32-bit node is not recommended;\\n\\n'\r\n            + '\\tsee https://github.com/jprichardson/node-fs-extra/issues/269',\r\n            'Warning', 'fs-extra-WARN0001'\r\n        );\r\n    }\r\n\r\n    const { srcStat, destStat } = await checkPaths(src, dest, 'copy', opts);\r\n\r\n    await checkParentPaths(src, srcStat, dest, 'copy');\r\n\r\n    const include = await runFilter(src, dest, opts);\r\n\r\n    if (!include) return;\r\n\r\n    // check if the parent of dest exists, and create it if it doesn't exist\r\n    const destParent = dirname(dest);\r\n    const dirExists = await pathExists(destParent);\r\n    if (!dirExists) {\r\n        await mkdirs(destParent);\r\n    }\r\n\r\n    await getStatsAndPerformCopy(destStat, src, dest, opts);\r\n});\r\n\r\n/**\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {import('fs-extra').CopyOptions & { clobber?: boolean, overwrite?: boolean }} opts\r\n */\r\nasync function runFilter(src, dest, opts) {\r\n    if (!opts.filter) return true;\r\n    return opts.filter(src, dest);\r\n}\r\n\r\n/**\r\n * @param {import(\"fs\").BigIntStats | null} destStat\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {import('fs-extra').CopyOptions & { clobber?: boolean, overwrite?: boolean }} opts\r\n */\r\nasync function getStatsAndPerformCopy(destStat, src, dest, opts) {\r\n    const statFn = opts.dereference ? _stat : lstat;\r\n    const srcStat = await statFn(src);\r\n\r\n    if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);\r\n\r\n    if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())\r\n        return onFile(srcStat, destStat, src, dest, opts);\r\n\r\n    if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);\r\n    if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);\r\n    if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);\r\n    throw new Error(`Unknown file: ${src}`);\r\n}\r\n\r\n/**\r\n * @param {import(\"fs\").Stats} srcStat\r\n * @param {any} destStat\r\n * @param {any} src\r\n * @param {import(\"fs\").PathLike} dest\r\n * @param {import('fs-extra').CopyOptions & { clobber?: boolean, overwrite?: boolean }} opts\r\n */\r\nasync function onFile(srcStat, destStat, src, dest, opts) {\r\n    if (!destStat) return copyFile(srcStat, src, dest, opts);\r\n\r\n    if (opts.overwrite) {\r\n        await unlink(dest);\r\n        return copyFile(srcStat, src, dest, opts);\r\n    }\r\n    if (opts.errorOnExist) {\r\n        throw new Error(`'${dest}' already exists`);\r\n    }\r\n}\r\n\r\n/**\r\n * @param {{ mode: number; }} srcStat\r\n * @param {import(\"fs\").PathLike} src\r\n * @param {import(\"fs\").PathLike} dest\r\n * @param {import('fs-extra').CopyOptions & { clobber?: boolean, overwrite?: boolean }} opts\r\n */\r\nasync function copyFile(srcStat, src, dest, opts) {\r\n    await _copyFile(src, dest);\r\n    if (opts.preserveTimestamps) {\r\n        // Make sure the file is writable before setting the timestamp\r\n        // otherwise open fails with EPERM when invoked with 'r+'\r\n        // (through utimes call)\r\n        if (fileIsNotWritable(srcStat.mode)) {\r\n            await makeFileWritable(dest, srcStat.mode);\r\n        }\r\n\r\n        // Set timestamps and mode correspondingly\r\n\r\n        // Note that The initial srcStat.atime cannot be trusted\r\n        // because it is modified by the read(2) system call\r\n        // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\r\n        const updatedSrcStat = await _stat(src);\r\n        await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\r\n    }\r\n\r\n    return chmod(dest, srcStat.mode);\r\n}\r\n\r\n/**\r\n * @param {number} srcMode\r\n */\r\nfunction fileIsNotWritable(srcMode) {\r\n    return (srcMode & 0o200) === 0;\r\n}\r\n\r\n/**\r\n * @param {import(\"fs\").PathLike} dest\r\n * @param {number} srcMode\r\n */\r\nfunction makeFileWritable(dest, srcMode) {\r\n    return chmod(dest, srcMode | 0o200);\r\n}\r\n\r\n/**\r\n * @param {import(\"fs\").Stats} srcStat\r\n * @param {any} destStat\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {{ dereference?: boolean | undefined; }} opts\r\n */\r\nasync function onDir(srcStat, destStat, src, dest, opts) {\r\n    // the dest directory might not exist, create it\r\n    if (!destStat) {\r\n        await mkdir(dest);\r\n    }\r\n\r\n    const items = await readdir(src);\r\n\r\n    // loop through the files in the current directory to copy everything\r\n    await Promise.all(items.map(async item => {\r\n        const srcItem = join(src, item);\r\n        const destItem = join(dest, item);\r\n\r\n        // skip the item if it is matches by the filter function\r\n        const include = await runFilter(srcItem, destItem, opts);\r\n        if (!include) return;\r\n\r\n        const { destStat } = await checkPaths(srcItem, destItem, 'copy', opts);\r\n\r\n        // If the item is a copyable file, `getStatsAndPerformCopy` will copy it\r\n        // If the item is a directory, `getStatsAndPerformCopy` will call `onDir` recursively\r\n        return getStatsAndPerformCopy(destStat, srcItem, destItem, opts);\r\n    }));\r\n\r\n    if (!destStat) {\r\n        await chmod(dest, srcStat.mode);\r\n    }\r\n}\r\n\r\n/**\r\n * @param {any} destStat\r\n * @param {import(\"fs\").PathLike} src\r\n * @param {import(\"fs\").PathLike} dest\r\n * @param {import('fs-extra').CopyOptions & { clobber?: boolean, overwrite?: boolean }} opts\r\n */\r\nasync function onLink(destStat, src, dest, opts) {\r\n    let resolvedSrc = await readlink(src);\r\n    if (opts.dereference) {\r\n        resolvedSrc = resolve(process.cwd(), resolvedSrc);\r\n    }\r\n    if (!destStat) {\r\n        return symlink(resolvedSrc, dest);\r\n    }\r\n\r\n    let resolvedDest = null;\r\n    try {\r\n        resolvedDest = await readlink(dest);\r\n    } catch (e) {\r\n        // dest exists and is a regular file or directory,\r\n        // Windows may throw UNKNOWN error. If dest already exists,\r\n        // fs throws error anyway, so no need to guard against it here.\r\n        if (/** @type {NodeJS.ErrnoException} */ (e).code === 'EINVAL' || /** @type {NodeJS.ErrnoException} */ (e).code === 'UNKNOWN') return symlink(resolvedSrc, dest);\r\n        throw e;\r\n    }\r\n    if (opts.dereference) {\r\n        resolvedDest = resolve(process.cwd(), resolvedDest);\r\n    }\r\n    if (isSrcSubdir(resolvedSrc, resolvedDest)) {\r\n        throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);\r\n    }\r\n\r\n    // do not copy if src is a subdir of dest since unlinking\r\n    // dest in this case would result in removing src contents\r\n    // and therefore a broken symlink would be created.\r\n    if (isSrcSubdir(resolvedDest, resolvedSrc)) {\r\n        throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);\r\n    }\r\n\r\n    // copy the link\r\n    await unlink(dest);\r\n    return symlink(resolvedSrc, dest);\r\n}\r\n","// @ts-check\r\n\r\nimport { existsSync, statSync as _statSync, lstatSync, unlinkSync, copyFileSync, chmodSync, mkdirSync, readdirSync, readlinkSync, symlinkSync } from 'graceful-fs';\r\nimport { dirname, join, resolve } from 'path';\r\nimport { mkdirsSync } from '../mkdirs';\r\nimport { utimesMillisSync } from '../util/utimes';\r\nimport { checkPathsSync, checkParentPathsSync, isSrcSubdir } from '../util/stat';\r\n\r\n/**\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {import('fs-extra').CopyOptions & { clobber?: boolean }} opts\r\n */\r\nfunction copySync(src, dest, opts) {\r\n    if (typeof opts === 'function') {\r\n        opts = { filter: opts };\r\n    }\r\n\r\n    opts = opts || {};\r\n    opts.clobber = 'clobber' in opts ? !!opts.clobber : true; // default to true for now\r\n    opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber; // overwrite falls back to clobber\r\n\r\n    // Warn about using preserveTimestamps on 32-bit node\r\n    if (opts.preserveTimestamps && process.arch === 'ia32') {\r\n        process.emitWarning(\r\n            'Using the preserveTimestamps option in 32-bit node is not recommended;\\n\\n'\r\n            + '\\tsee https://github.com/jprichardson/node-fs-extra/issues/269',\r\n            'Warning', 'fs-extra-WARN0002'\r\n        );\r\n    }\r\n\r\n    const { srcStat, destStat } = checkPathsSync(src, dest, 'copy', opts);\r\n    checkParentPathsSync(src, srcStat, dest, 'copy');\r\n    if (opts.filter && !opts.filter(src, dest)) return;\r\n    const destParent = dirname(dest);\r\n    if (!existsSync(destParent)) mkdirsSync(destParent);\r\n    return getStats(destStat, src, dest, opts);\r\n}\r\n\r\n/**\r\n * @param {import(\"fs\").BigIntStats | null} destStat\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {import(\"fs-extra\").CopyOptions & { clobber?: boolean | undefined; }} opts\r\n */\r\nfunction getStats(destStat, src, dest, opts) {\r\n    const statSync = opts.dereference ? _statSync : lstatSync;\r\n    const srcStat = statSync(src);\r\n\r\n    if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);\r\n    else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);\r\n    else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);\r\n    else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);\r\n    else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);\r\n    throw new Error(`Unknown file: ${src}`);\r\n}\r\n\r\n/**\r\n * @param {import(\"fs\").Stats} srcStat\r\n * @param {import(\"fs\").BigIntStats | null} destStat\r\n * @param {import(\"fs\").PathLike} src\r\n * @param {string} dest\r\n * @param {import(\"fs-extra\").CopyOptions & { clobber?: boolean | undefined; }} opts\r\n */\r\nfunction onFile(srcStat, destStat, src, dest, opts) {\r\n    if (!destStat) return copyFile(srcStat, src, dest, opts);\r\n    return mayCopyFile(srcStat, src, dest, opts);\r\n}\r\n\r\n/**\r\n * @param {any} srcStat\r\n * @param {any} src\r\n * @param {import(\"fs\").PathLike} dest\r\n * @param {import(\"fs-extra\").CopyOptions & { clobber?: boolean | undefined; }} opts\r\n */\r\nfunction mayCopyFile(srcStat, src, dest, opts) {\r\n    if (opts.overwrite) {\r\n        unlinkSync(dest);\r\n        return copyFile(srcStat, src, dest, opts);\r\n    } else if (opts.errorOnExist) {\r\n        throw new Error(`'${dest}' already exists`);\r\n    }\r\n}\r\n\r\n/**\r\n * @param {{ mode: any; }} srcStat\r\n * @param {import(\"fs\").PathLike} src\r\n * @param {import(\"fs\").PathLike} dest\r\n * @param {{ preserveTimestamps?: boolean; }} opts\r\n */\r\nfunction copyFile(srcStat, src, dest, opts) {\r\n    copyFileSync(src, dest);\r\n    if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);\r\n    return setDestMode(dest, srcStat.mode);\r\n}\r\n\r\n/**\r\n * @param {any} srcMode\r\n * @param {any} src\r\n * @param {any} dest\r\n */\r\nfunction handleTimestamps(srcMode, src, dest) {\r\n    // Make sure the file is writable before setting the timestamp\r\n    // otherwise open fails with EPERM when invoked with 'r+'\r\n    // (through utimes call)\r\n    if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode);\r\n    return setDestTimestamps(src, dest);\r\n}\r\n\r\n/**\r\n * @param {number} srcMode\r\n */\r\nfunction fileIsNotWritable(srcMode) {\r\n    return (srcMode & 0o200) === 0;\r\n}\r\n\r\n/**\r\n * @param {any} dest\r\n * @param {number} srcMode\r\n */\r\nfunction makeFileWritable(dest, srcMode) {\r\n    return setDestMode(dest, srcMode | 0o200);\r\n}\r\n\r\n/**\r\n * @param {import(\"fs\").PathLike} dest\r\n * @param {import(\"fs\").Mode} srcMode\r\n */\r\nfunction setDestMode(dest, srcMode) {\r\n    return chmodSync(dest, srcMode);\r\n}\r\n\r\n/**\r\n * @param {import(\"fs\").PathLike} src\r\n * @param {import(\"fs\").PathLike} dest\r\n */\r\nfunction setDestTimestamps(src, dest) {\r\n    // The initial srcStat.atime cannot be trusted\r\n    // because it is modified by the read(2) system call\r\n    // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\r\n    const updatedSrcStat = _statSync(src);\r\n    return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\r\n}\r\n\r\n/**\r\n * @param {import(\"fs\").Stats} srcStat\r\n * @param {import(\"fs\").BigIntStats | null} destStat\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {import(\"fs-extra\").CopyOptions & { clobber?: boolean | undefined; }} opts\r\n */\r\nfunction onDir(srcStat, destStat, src, dest, opts) {\r\n    if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts);\r\n    return copyDir(src, dest, opts);\r\n}\r\n\r\n/**\r\n * @param {import(\"fs\").Mode} srcMode\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {import(\"fs-extra\").CopyOptions & { clobber?: boolean | undefined; }} opts\r\n */\r\nfunction mkDirAndCopy(srcMode, src, dest, opts) {\r\n    mkdirSync(dest);\r\n    copyDir(src, dest, opts);\r\n    return setDestMode(dest, srcMode);\r\n}\r\n\r\n/**\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {import(\"fs-extra\").CopyOptions & { clobber?: boolean | undefined; }} opts\r\n */\r\nfunction copyDir(src, dest, opts) {\r\n    readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts));\r\n}\r\n\r\n/**\r\n * @param {string} item\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {import(\"fs-extra\").CopyOptions & { clobber?: boolean | undefined; }} opts\r\n */\r\nfunction copyDirItem(item, src, dest, opts) {\r\n    const srcItem = join(src, item);\r\n    const destItem = join(dest, item);\r\n    if (opts.filter && !opts.filter(srcItem, destItem)) return;\r\n    const { destStat } = checkPathsSync(srcItem, destItem, 'copy', opts);\r\n    return getStats(destStat, srcItem, destItem, opts);\r\n}\r\n\r\n/**\r\n * @param {import(\"fs\").BigIntStats | null} destStat\r\n * @param {import(\"fs\").PathLike} src\r\n * @param {import(\"fs\").PathLike} dest\r\n * @param {import(\"fs-extra\").CopyOptions & { clobber?: boolean | undefined; }} opts\r\n */\r\nfunction onLink(destStat, src, dest, opts) {\r\n    let resolvedSrc = readlinkSync(src);\r\n    if (opts.dereference) {\r\n        resolvedSrc = resolve(process.cwd(), resolvedSrc);\r\n    }\r\n\r\n    if (!destStat) {\r\n        return symlinkSync(resolvedSrc, dest);\r\n    } else {\r\n        let resolvedDest;\r\n        try {\r\n            resolvedDest = readlinkSync(dest);\r\n        } catch (err) {\r\n            // dest exists and is a regular file or directory,\r\n            // Windows may throw UNKNOWN error. If dest already exists,\r\n            // fs throws error anyway, so no need to guard against it here.\r\n            if (/** @type {NodeJS.ErrnoException} */ (err).code === 'EINVAL' || /** @type {NodeJS.ErrnoException} */ (err).code === 'UNKNOWN') return symlinkSync(resolvedSrc, dest);\r\n            throw err;\r\n        }\r\n        if (opts.dereference) {\r\n            resolvedDest = resolve(process.cwd(), resolvedDest);\r\n        }\r\n        if (isSrcSubdir(resolvedSrc, resolvedDest)) {\r\n            throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);\r\n        }\r\n\r\n        // prevent copy if src is a subdir of dest since unlinking\r\n        // dest in this case would result in removing src contents\r\n        // and therefore a broken symlink would be created.\r\n        if (isSrcSubdir(resolvedDest, resolvedSrc)) {\r\n            throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);\r\n        }\r\n        return copyLink(resolvedSrc, dest);\r\n    }\r\n}\r\n\r\n/**\r\n * @param {import(\"fs\").PathLike} resolvedSrc\r\n * @param {import(\"fs\").PathLike} dest\r\n */\r\nfunction copyLink(resolvedSrc, dest) {\r\n    unlinkSync(dest);\r\n    return symlinkSync(resolvedSrc, dest);\r\n}\r\n\r\nexport default copySync;\r\n","// @ts-check\r\n\r\nimport { rm, rmSync } from '@fs/index';\r\nimport { fromPromise } from 'universalify';\r\n\r\nexport const remove = fromPromise(function remove(path) {\r\n    return rm(path, { recursive: true, force: true });\r\n});\r\n\r\n/**\r\n * @param {import('fs').PathLike} path\r\n */\r\nexport function removeSync(path) {\r\n    rmSync(path, { recursive: true, force: true });\r\n}\r\n","// @ts-check\r\n\r\nimport { fromPromise as u } from 'universalify';\r\nimport { readdir, readdirSync } from '@fs/index';\r\nimport { join } from 'path';\r\nimport { mkdirs, mkdirsSync } from '../mkdirs';\r\nimport { remove as _remove, removeSync } from '../remove';\r\n\r\nexport const emptyDir = u(async function emptyDir(dir) {\r\n    let items;\r\n    try {\r\n        items = await readdir(dir);\r\n    } catch {\r\n        return mkdirs(dir);\r\n    }\r\n\r\n    return Promise.all(items.map(item => _remove(join(dir, item))));\r\n});\r\n\r\n/**\r\n * @param {string} dir\r\n * @returns\r\n */\r\nexport function emptyDirSync(dir) {\r\n    let items;\r\n    try {\r\n        items = readdirSync(dir);\r\n    } catch {\r\n        return mkdirsSync(dir);\r\n    }\r\n\r\n    items.forEach(item => {\r\n        item = join(dir, item);\r\n        removeSync(item);\r\n    });\r\n}\r\n","\r\nimport { fromPromise } from 'universalify';\r\nimport { dirname } from 'path';\r\nimport { writeFile, stat, readdir, statSync, readdirSync, writeFileSync } from '@fs/index';\r\nimport { mkdirs, mkdirsSync } from '../mkdirs';\r\n\r\nasync function _createFile(file) {\r\n    let stats;\r\n    try {\r\n        stats = await stat(file);\r\n    } catch { }\r\n    if (stats && stats.isFile()) return;\r\n\r\n    const dir = dirname(file);\r\n\r\n    let dirStats = null;\r\n    try {\r\n        dirStats = await stat(dir);\r\n    } catch (err) {\r\n        // if the directory doesn't exist, make it\r\n        if (err.code === 'ENOENT') {\r\n            await mkdirs(dir);\r\n            await writeFile(file, '');\r\n            return;\r\n        } else {\r\n            throw err;\r\n        }\r\n    }\r\n\r\n    if (dirStats.isDirectory()) {\r\n        await writeFile(file, '');\r\n    } else {\r\n        // parent is not a directory\r\n        // This is just to cause an internal ENOTDIR error to be thrown\r\n        await readdir(dir);\r\n    }\r\n}\r\nexport const createFile = fromPromise(_createFile);\r\n\r\nexport function createFileSync(file) {\r\n    let stats;\r\n    try {\r\n        stats = statSync(file);\r\n    } catch { }\r\n    if (stats && stats.isFile()) return;\r\n\r\n    const dir = dirname(file);\r\n    try {\r\n        if (!statSync(dir).isDirectory()) {\r\n            // parent is not a directory\r\n            // This is just to cause an internal ENOTDIR error to be thrown\r\n            readdirSync(dir);\r\n        }\r\n    } catch (err) {\r\n        // If the stat call above failed because the directory doesn't exist, create it\r\n        if (err && err.code === 'ENOENT') mkdirsSync(dir);\r\n        else throw err;\r\n    }\r\n\r\n    writeFileSync(file, '');\r\n}\r\n","import { fromPromise } from 'universalify';\r\nimport { dirname } from 'path';\r\nimport { link, lstat, lstatSync, existsSync, linkSync } from '@fs/index';\r\nimport { mkdirs, mkdirsSync } from '../mkdirs';\r\nimport { exists as pathExists } from '@fs/exists';\r\nimport { areIdentical } from '../util/stat';\r\n\r\nasync function _createLink(srcpath, dstpath) {\r\n    let dstStat;\r\n    try {\r\n        dstStat = await lstat(dstpath);\r\n    } catch {\r\n        // ignore error\r\n    }\r\n\r\n    let srcStat;\r\n    try {\r\n        srcStat = await lstat(srcpath);\r\n    } catch (err) {\r\n        err.message = err.message.replace('lstat', 'ensureLink');\r\n        throw err;\r\n    }\r\n\r\n    if (dstStat && areIdentical(srcStat, dstStat)) return;\r\n\r\n    const dir = dirname(dstpath);\r\n\r\n    const dirExists = await pathExists(dir);\r\n\r\n    if (!dirExists) {\r\n        await mkdirs(dir);\r\n    }\r\n\r\n    await link(srcpath, dstpath);\r\n}\r\n\r\nexport const createLink = fromPromise(_createLink);\r\n\r\nexport function createLinkSync(srcpath, dstpath) {\r\n    let dstStat;\r\n    try {\r\n        dstStat = lstatSync(dstpath);\r\n    } catch { }\r\n\r\n    try {\r\n        const srcStat = lstatSync(srcpath);\r\n        if (dstStat && areIdentical(srcStat, dstStat)) return;\r\n    } catch (err) {\r\n        err.message = err.message.replace('lstat', 'ensureLink');\r\n        throw err;\r\n    }\r\n\r\n    const dir = dirname(dstpath);\r\n    const dirExists = existsSync(dir);\r\n    if (dirExists) return linkSync(srcpath, dstpath);\r\n    mkdirsSync(dir);\r\n\r\n    return linkSync(srcpath, dstpath);\r\n}\r\n","import { isAbsolute, dirname, join, relative } from 'path';\r\nimport { lstat, existsSync } from '@fs/index';\r\nimport { exists as pathExists } from '@fs/exists';\r\nimport { fromPromise } from 'universalify';\r\n\r\n/**\r\n * Function that returns two types of paths, one relative to symlink, and one\r\n * relative to the current working directory. Checks if path is absolute or\r\n * relative. If the path is relative, this function checks if the path is\r\n * relative to symlink or relative to current working directory. This is an\r\n * initiative to find a smarter `srcpath` to supply when building symlinks.\r\n * This allows you to determine which path to use out of one of three possible\r\n * types of source paths. The first is an absolute path. This is detected by\r\n * `path.isAbsolute()`. When an absolute path is provided, it is checked to\r\n * see if it exists. If it does it's used, if not an error is returned\r\n * (callback)/ thrown (sync). The other two options for `srcpath` are a\r\n * relative url. By default Node's `fs.symlink` works by creating a symlink\r\n * using `dstpath` and expects the `srcpath` to be relative to the newly\r\n * created symlink. If you provide a `srcpath` that does not exist on the file\r\n * system it results in a broken symlink. To minimize this, the function\r\n * checks to see if the 'relative to symlink' source file exists, and if it\r\n * does it will use it. If it does not, it checks if there's a file that\r\n * exists that is relative to the current working directory, if does its used.\r\n * This preserves the expectations of the original fs.symlink spec and adds\r\n * the ability to pass in `relative to current working direcotry` paths.\r\n */\r\n\r\nasync function _symlinkPaths(srcpath, dstpath) {\r\n    if (isAbsolute(srcpath)) {\r\n        try {\r\n            await lstat(srcpath);\r\n        } catch (err) {\r\n            err.message = err.message.replace('lstat', 'ensureSymlink');\r\n            throw err;\r\n        }\r\n\r\n        return {\r\n            toCwd: srcpath,\r\n            toDst: srcpath\r\n        };\r\n    }\r\n\r\n    const dstdir = dirname(dstpath);\r\n    const relativeToDst = join(dstdir, srcpath);\r\n\r\n    const exists = await pathExists(relativeToDst);\r\n    if (exists) {\r\n        return {\r\n            toCwd: relativeToDst,\r\n            toDst: srcpath\r\n        };\r\n    }\r\n\r\n    try {\r\n        await lstat(srcpath);\r\n    } catch (err) {\r\n        err.message = err.message.replace('lstat', 'ensureSymlink');\r\n        throw err;\r\n    }\r\n\r\n    return {\r\n        toCwd: srcpath,\r\n        toDst: relative(dstdir, srcpath)\r\n    };\r\n}\r\n\r\nexport const symlinkPaths = fromPromise(_symlinkPaths);\r\n\r\nexport function symlinkPathsSync(srcpath, dstpath) {\r\n    if (isAbsolute(srcpath)) {\r\n        const exists = existsSync(srcpath);\r\n        if (!exists) throw new Error('absolute srcpath does not exist');\r\n        return {\r\n            toCwd: srcpath,\r\n            toDst: srcpath\r\n        };\r\n    }\r\n\r\n    const dstdir = dirname(dstpath);\r\n    const relativeToDst = join(dstdir, srcpath);\r\n    const exists = existsSync(relativeToDst);\r\n    if (exists) {\r\n        return {\r\n            toCwd: relativeToDst,\r\n            toDst: srcpath\r\n        };\r\n    }\r\n\r\n    const srcExists = existsSync(srcpath);\r\n    if (!srcExists) throw new Error('relative srcpath does not exist');\r\n    return {\r\n        toCwd: srcpath,\r\n        toDst: relative(dstdir, srcpath)\r\n    };\r\n}\r\n","import { lstat, lstatSync } from '@fs/index';\r\nimport { fromPromise } from 'universalify';\r\n\r\nasync function _symlinkType(srcpath, type) {\r\n    if (type) return type;\r\n\r\n    let stats;\r\n    try {\r\n        stats = await lstat(srcpath);\r\n    } catch {\r\n        return 'file';\r\n    }\r\n\r\n    return (stats && stats.isDirectory()) ? 'dir' : 'file';\r\n}\r\n\r\nexport const symlinkType = fromPromise(_symlinkType);\r\n\r\nexport function symlinkTypeSync(srcpath, type) {\r\n    if (type) return type;\r\n\r\n    let stats;\r\n    try {\r\n        stats = lstatSync(srcpath);\r\n    } catch {\r\n        return 'file';\r\n    }\r\n    return (stats && stats.isDirectory()) ? 'dir' : 'file';\r\n}\r\n\r\n","import { fromPromise } from 'universalify';\r\nimport { dirname } from 'path';\r\nimport { lstat, stat, symlink, lstatSync, statSync, existsSync, symlinkSync } from '@fs/index';\r\nimport { mkdirs, mkdirsSync } from '../mkdirs';\r\n\r\nimport { symlinkPaths, symlinkPathsSync } from './symlink-paths';\r\n\r\nimport { symlinkType, symlinkTypeSync } from './symlink-type';\r\n\r\nimport { exists as pathExists } from '@fs/exists';\r\n\r\nimport { areIdentical } from '../util/stat';\r\n\r\nasync function _createSymlink(srcpath, dstpath, type) {\r\n    let stats;\r\n    try {\r\n        stats = await lstat(dstpath);\r\n    } catch { }\r\n\r\n    if (stats && stats.isSymbolicLink()) {\r\n        const [srcStat, dstStat] = await Promise.all([\r\n            stat(srcpath),\r\n            stat(dstpath)\r\n        ]);\r\n\r\n        if (areIdentical(srcStat, dstStat)) return;\r\n    }\r\n\r\n    const relative = await symlinkPaths(srcpath, dstpath);\r\n    srcpath = relative.toDst;\r\n    const toType = await symlinkType(relative.toCwd, type);\r\n    const dir = dirname(dstpath);\r\n\r\n    if (!(await pathExists(dir))) {\r\n        await mkdirs(dir);\r\n    }\r\n\r\n    return symlink(srcpath, dstpath, toType);\r\n}\r\n\r\nexport const createSymlink = fromPromise(_createSymlink);\r\n\r\nexport function createSymlinkSync(srcpath, dstpath, type) {\r\n    let stats;\r\n    try {\r\n        stats = lstatSync(dstpath);\r\n    } catch { }\r\n    if (stats && stats.isSymbolicLink()) {\r\n        const srcStat = statSync(srcpath);\r\n        const dstStat = statSync(dstpath);\r\n        if (areIdentical(srcStat, dstStat)) return;\r\n    }\r\n    const relative = symlinkPathsSync(srcpath, dstpath);\r\n    srcpath = relative.toDst;\r\n    type = symlinkTypeSync(relative.toCwd, type);\r\n    const dir = dirname(dstpath);\r\n    const exists = existsSync(dir);\r\n    if (exists) return symlinkSync(srcpath, dstpath, type);\r\n    mkdirsSync(dir);\r\n    return symlinkSync(srcpath, dstpath, type);\r\n}\r\n\r\n","// @ts-check\r\n\r\nimport { rename as _rename } from '@fs/index';\r\nimport { dirname, parse } from 'path';\r\nimport { copy } from '../copy';\r\nimport { remove } from '../remove';\r\nimport { mkdirs } from '../mkdirs';\r\nimport { exists as pathExists } from '@fs/exists';\r\nimport * as stat from '../util/stat';\r\nimport { fromPromise } from 'universalify';\r\n\r\n/**\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {import('fs-extra').MoveOptions & { clobber?: boolean }} opts\r\n */\r\nasync function _move(src, dest, opts = {}) {\r\n    const overwrite = opts.overwrite || opts.clobber || false;\r\n\r\n    const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, 'move', opts);\r\n\r\n    await stat.checkParentPaths(src, srcStat, dest, 'move');\r\n\r\n    // If the parent of dest is not root, make sure it exists before proceeding\r\n    const destParent = dirname(dest);\r\n    const parsedParentPath = parse(destParent);\r\n    if (parsedParentPath.root !== destParent) {\r\n        await mkdirs(destParent);\r\n    }\r\n\r\n    return doRename(src, dest, overwrite, isChangingCase);\r\n}\r\n\r\nexport default fromPromise(_move);\r\n\r\n/**\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {boolean} overwrite\r\n * @param {boolean} isChangingCase\r\n * @returns\r\n */\r\nasync function doRename(src, dest, overwrite, isChangingCase) {\r\n    if (!isChangingCase) {\r\n        if (overwrite) {\r\n            await remove(dest);\r\n        } else if (await pathExists(dest)) {\r\n            throw new Error('dest already exists.');\r\n        }\r\n    }\r\n\r\n    try {\r\n        // Try w/ rename first, and try copy + remove if EXDEV\r\n        await _rename(src, dest);\r\n    } catch (err) {\r\n        if (/** @type {NodeJS.ErrnoException} */ (err).code !== 'EXDEV') {\r\n            throw err;\r\n        }\r\n        await moveAcrossDevice(src, dest, overwrite);\r\n    }\r\n}\r\n\r\n/**\r\n * @param {string} src\r\n * @param {string} dest\r\n * @param {boolean} overwrite\r\n */\r\nasync function moveAcrossDevice(src, dest, overwrite) {\r\n    const opts = {\r\n        overwrite,\r\n        errorOnExist: true,\r\n        preserveTimestamps: true\r\n    };\r\n\r\n    await copy(src, dest, opts);\r\n    return remove(src);\r\n}\r\n","\r\n\r\nimport { existsSync, renameSync } from 'graceful-fs';\r\nimport { dirname, parse } from 'path';\r\nimport { copySync } from '../copy';\r\nimport { removeSync } from '../remove';\r\nimport { mkdirsSync } from '../mkdirs';\r\nimport { checkPathsSync, checkParentPathsSync } from '../util/stat';\r\n\r\nexport default function moveSync(src, dest, opts) {\r\n    opts = opts || {};\r\n    const overwrite = opts.overwrite || opts.clobber || false;\r\n\r\n    const { srcStat, isChangingCase = false } = checkPathsSync(src, dest, 'move', opts);\r\n    checkParentPathsSync(src, srcStat, dest, 'move');\r\n    if (!isParentRoot(dest)) mkdirsSync(dirname(dest));\r\n    return doRename(src, dest, overwrite, isChangingCase);\r\n}\r\n\r\nfunction isParentRoot(dest) {\r\n    const parent = dirname(dest);\r\n    const parsedPath = parse(parent);\r\n    return parsedPath.root === parent;\r\n}\r\n\r\nfunction doRename(src, dest, overwrite, isChangingCase) {\r\n    if (isChangingCase) return rename(src, dest, overwrite);\r\n    if (overwrite) {\r\n        removeSync(dest);\r\n        return rename(src, dest, overwrite);\r\n    }\r\n    if (existsSync(dest)) throw new Error('dest already exists.');\r\n    return rename(src, dest, overwrite);\r\n}\r\n\r\nfunction rename(src, dest, overwrite) {\r\n    try {\r\n        renameSync(src, dest);\r\n    } catch (err) {\r\n        if (err.code !== 'EXDEV') throw err;\r\n        return moveAcrossDevice(src, dest, overwrite);\r\n    }\r\n}\r\n\r\nfunction moveAcrossDevice(src, dest, overwrite) {\r\n    const opts = {\r\n        overwrite,\r\n        errorOnExist: true,\r\n        preserveTimestamps: true\r\n    };\r\n    copySync(src, dest, opts);\r\n    return removeSync(src);\r\n}\r\n","// @ts-check\r\n\r\nimport { fromPromise } from 'universalify';\r\nimport { writeFile, existsSync, writeFileSync } from '@fs/index';\r\nimport { dirname } from 'path';\r\nimport { mkdirs, mkdirsSync } from '../mkdirs';\r\nimport { exists as pathExists } from '@fs/exists';\r\n\r\n/**\r\n * @param {string} file\r\n * @param {string | NodeJS.ArrayBufferView} data\r\n * @param {import('fs').WriteFileOptions} encoding\r\n * @returns\r\n */\r\nasync function _outputFile(file, data, encoding = 'utf-8') {\r\n    const dir = dirname(file);\r\n\r\n    if (!(await pathExists(dir))) {\r\n        await mkdirs(dir);\r\n    }\r\n\r\n    return writeFile(file, data, encoding);\r\n}\r\nexport const outputFile = fromPromise(_outputFile);\r\n\r\n/**\r\n * @param {string} file\r\n * @param {[string | NodeJS.ArrayBufferView, import('fs').WriteFileOptions | undefined]} args\r\n */\r\nexport function outputFileSync(file, ...args) {\r\n    const dir = dirname(file);\r\n    if (!existsSync(dir)) {\r\n        mkdirsSync(dir);\r\n    }\r\n\r\n    writeFileSync(file, ...args);\r\n}\r\n","import { resolve as pathResolve } from 'path';\r\nimport type { ReadFileOptions, MapStructureResult, ErrorCallback, DiveActionCallback, DiveActionPromise, DiveOptions, MapChildrenFunction, MapStructureFunction } from '../types';\r\nimport * as fs from './index';\r\n\r\nfunction matches(str: string, test: string | RegExp) {\r\n    if (typeof test === 'string') {\r\n        return str.includes(test);\r\n    } else {\r\n        return test.test(str);\r\n    }\r\n}\r\n\r\n/**\r\n * @internal\r\n * @param directory\r\n * @param options\r\n */\r\nexport async function* _diveWorker(directory: string, options: DiveOptions = {}): AsyncGenerator<[file: string, stat: fs.Stats]> {\r\n    const children = await fs.readdir(directory, { withFileTypes: true });\r\n\r\n    if (children.length === 0) {\r\n        if (options.directories) {\r\n            yield [directory, await fs.stat(directory)];\r\n        }\r\n    }\r\n\r\n    for (const item of children) {\r\n        if (!options.all && item.name.startsWith('.')) {\r\n            continue;\r\n        }\r\n\r\n        const path = pathResolve(item.path ?? directory, item.name);\r\n        if (item.isDirectory()) {\r\n            if (options.recursive) {\r\n                yield* _diveWorker(path, options);\r\n            } else if (options.directories) {\r\n                if (!options.ignore || !matches(path, options.ignore)) {\r\n                    yield [path, await fs.stat(path)];\r\n                }\r\n            }\r\n        } else if (options.files) {\r\n            if (!options.ignore || !matches(path, options.ignore)) {\r\n                yield [path, await fs.stat(path)];\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\nasync function _diveHelper(directory: string, action: DiveActionPromise, options: DiveOptions = {}) {\r\n    for await (const [file, stat] of _diveWorker(directory, options)) {\r\n        await action(file, stat);\r\n    }\r\n}\r\n\r\nasync function _diveWorkerCallback(directory: string, action: DiveActionCallback, options: DiveOptions = {}) {\r\n    let children: fs.Dirent[] | undefined;\r\n    let err: Error | undefined;\r\n    try {\r\n        children = await fs.readdir(directory, { withFileTypes: true });\r\n    } catch (err1) {\r\n        err = err1 as Error;\r\n    }\r\n\r\n    if (!children || children.length === 0) {\r\n        if (options.directories) {\r\n            action(null, directory, await fs.stat(directory));\r\n        }\r\n    }\r\n\r\n    if (err) {\r\n        action(err);\r\n        return;\r\n    }\r\n\r\n    for (const item of children!) {\r\n        if (!options.all && item.name.startsWith('.')) {\r\n            continue;\r\n        }\r\n\r\n        try {\r\n            const path = pathResolve(item.path ?? directory, item.name);\r\n            if (item.isDirectory()) {\r\n                if (options.recursive) {\r\n                    await _diveWorkerCallback(path, action, options);\r\n                } else if (options.directories) {\r\n                    if (!options.ignore || !matches(path, options.ignore)) {\r\n                        action(null, path, await fs.stat(path));\r\n                    }\r\n                }\r\n            } else if (options.files) {\r\n                if (!options.ignore || !matches(path, options.ignore)) {\r\n                    action(null, path, await fs.stat(path));\r\n                }\r\n            }\r\n        } catch (err) {\r\n            action(err as Error);\r\n        }\r\n    }\r\n}\r\n\r\n// dive(directory[, options], action[, complete]);\r\n/**\r\n * Recursively walk (“dive”) a directory tree.\r\n * @param directory the pathname of a readable directory\r\n * @param options an object that defines some of the properties\r\n * @param action function that is called on each file\r\n * @param complete defines a second callback, that is called, when all files have been processed. It takes no arguments.\r\n * @example\r\n * Default:\r\n * ```\r\n * var dive = require('dive');\r\n *\r\n * dive(process.cwd(), function(err, file) {\r\n *\r\n * });```\r\n *\r\n * All files and a callback in the end:\r\n * ```\r\n * var dive = require('dive');\r\n *\r\n * dive(process.cwd(), { all: true }, function(err, file, stat) {\r\n *   if (err) throw err;\r\n *   console.log(file);\r\n * }, function() {\r\n *   console.log('complete');\r\n * });```\r\n *\r\n * Directories only:\r\n * ```\r\n * var dive = require('dive');\r\n *\r\n * dive(process.cwd(), { directories: true, files: false }, function(err, dir) {\r\n *   if (err) throw err;\r\n *   console.log(dir);\r\n * });```\r\n */\r\nexport function dive(directory: string, options: DiveOptions, action: DiveActionCallback, complete: () => void): void;\r\nexport function dive(directory: string, options: DiveOptions, action: DiveActionPromise): Promise<void>;\r\nexport function dive(directory: string, action: DiveActionCallback, complete: () => void): void;\r\nexport function dive(directory: string, action: DiveActionPromise): Promise<void>;\r\nexport function dive(directory: string, o1: DiveOptions | DiveActionCallback | DiveActionPromise, o2?: DiveActionCallback | DiveActionPromise | (() => void), o3?: () => void): void | Promise<void> {\r\n    let options = typeof o1 == 'object' ? o1 : undefined;\r\n    const action = (!options ? o1 : o2) as DiveActionCallback | DiveActionPromise;\r\n    const complete = (!options ? o2 : o3) as (() => void) | undefined;\r\n\r\n    options = {\r\n        recursive: true,\r\n        all: true,\r\n        files: true,\r\n        ...options\r\n    };\r\n\r\n    if (!complete) {\r\n        return _diveHelper(directory, action as DiveActionPromise, options);\r\n    }\r\n\r\n    void _diveWorkerCallback(directory, action as DiveActionCallback, options)\r\n        .finally(complete);\r\n}\r\n\r\nfunction* _diveSyncWorker(directory: string, options: DiveOptions = {}): Generator<string> {\r\n    const children = fs.readdirSync(directory, { withFileTypes: true });\r\n\r\n    if (children.length === 0) {\r\n        if (options.directories) {\r\n            yield directory;\r\n        }\r\n    }\r\n\r\n    for (const item of children) {\r\n        if (!options.all && item.name.startsWith('.')) {\r\n            continue;\r\n        }\r\n\r\n        const path = pathResolve(item.path ?? directory, item.name);\r\n        if (item.isDirectory()) {\r\n            if (options.recursive) {\r\n                yield* _diveSyncWorker(path, options);\r\n            } else if (options.directories) {\r\n                if (!options.ignore || !matches(path, options.ignore)) {\r\n                    yield path;\r\n                }\r\n            }\r\n        } else if (options.files) {\r\n            if (!options.ignore || !matches(path, options.ignore)) {\r\n                yield path;\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n// diveSync(dir[, opt])\r\n/**\r\n * The synchronous version of [[dive]]. Improved version of the `diveSync` module.\r\n * @param path the pathname of a readable directory\r\n * @param options an object that defines some of the properties\r\n * @returns an array of the found file paths\r\n * @example ```\r\n * const files = fs.diveSync(process.cwd());\r\n *\r\n * for (let i in files) {\r\n *\r\n * }\r\n *\r\n * for (let file of files) {\r\n *\r\n * }\r\n *\r\n * files.forEach(function(file, i) {\r\n *\r\n * });\r\n *\r\n * for (let i = 0; i < files.length; i++) {\r\n *\r\n * }\r\n * ```\r\n */\r\nexport function diveSync(directory: string, options: DiveOptions = {}): string[] {\r\n    options = {\r\n        recursive: true,\r\n        all: true,\r\n        files: true,\r\n\r\n        ...options\r\n    };\r\n\r\n    return [..._diveSyncWorker(directory, options)];\r\n}\r\n","// eslint-disable-next-line camelcase\r\nimport * as fs from './index';\r\nimport type { ErrorCallback } from '../types';\r\n\r\nasync function _forEachChildHelper(path: string, options: (({ encoding: BufferEncoding | null } | BufferEncoding | null | undefined) & ({ encoding: 'buffer' } | 'buffer')) | undefined, func: (filename: string | Buffer) => void | Promise<void>) {\r\n    const children: string[] | Buffer[] = await fs.readdir(path, options);\r\n    for (const child of children) {\r\n        const ret = func(child);\r\n        if (ret instanceof Promise) {\r\n            await ret;\r\n        }\r\n    }\r\n}\r\n\r\n// forEachChild(path[, options], function(file)[, callback])\r\n/**\r\n * Iterate through every child of a folder, asynchronously. This function will not recurse into subdirectories.\r\n * @param path folder path to iterate through\r\n * @param options options to pass through to [[readdir]]\r\n * @param func iterate function, called for every child\r\n * @param callback function to call after the operation finishes\r\n */\r\nexport function forEachChild(path: string, options: { encoding: BufferEncoding | null } | BufferEncoding | null | undefined | Record<string, never>, func: (filename: string) => void | Promise<void>): Promise<void>;\r\nexport function forEachChild(path: string, options: { encoding: 'buffer' } | 'buffer', func: (filename: Buffer) => void | Promise<void>): Promise<void>;\r\nexport function forEachChild(path: string, func: (filename: string) => void | Promise<void>): Promise<void>;\r\nexport function forEachChild(path: string, options: { encoding: BufferEncoding | null } | BufferEncoding | null | undefined | Record<string, never>, func: (filename: string) => void, callback: ErrorCallback): void;\r\nexport function forEachChild(path: string, options: { encoding: 'buffer' } | 'buffer', func: (filename: Buffer) => void, callback: ErrorCallback): void;\r\nexport function forEachChild(path: string, func: (filename: string) => void, callback: ErrorCallback): void;\r\nexport function forEachChild(\r\n    path: string,\r\n    o1: (\r\n        | ({ encoding: BufferEncoding | null } | BufferEncoding | null | undefined | Record<string, never>)\r\n        | ({ encoding: 'buffer' } | 'buffer')\r\n        | ((filename: string) => void | Promise<void>)\r\n        | ((filename: Buffer) => void | Promise<void>)\r\n    ),\r\n    o2?: (\r\n        | ((filename: string) => void | Promise<void>)\r\n        | ((filename: Buffer) => void | Promise<void>)\r\n        | ErrorCallback\r\n    ),\r\n    o3?: ErrorCallback,\r\n): void | Promise<void> {\r\n    const options = typeof o1 == 'object' ? (o1 as ({ encoding: BufferEncoding | null } | BufferEncoding | null | undefined) & ({ encoding: 'buffer' } | 'buffer')) : undefined;\r\n    const func = (!options ? o1 : o2) as (filename: string | Buffer) => void | Promise<void>;\r\n    const callback = (!options ? o2 : o3) as ErrorCallback | undefined;\r\n\r\n    // promise\r\n    if (!callback) {\r\n        return _forEachChildHelper(path, options, func);\r\n    }\r\n    // legacy\r\n    fs.readdir(path, options, (err, children) => {\r\n        if (err) {\r\n            callback(err);\r\n        } else {\r\n            for (const child of children) {\r\n                (func as (filename: string | Buffer) => void)(child);\r\n            }\r\n            callback();\r\n        }\r\n    });\r\n}\r\n\r\n// forEachChildSync(function(file)[, options])\r\n/**\r\n * Iterate through every child of a folder, synchronously. This function will not recurse into subdirectories.\r\n * @param path folder path to iterate through\r\n * @param func iterate function, called for every child\r\n * @param options options to pass through to [[readdirSync]]\r\n */\r\nexport function forEachChildSync(path: string, func: (filename: string) => void, options: { encoding: BufferEncoding | null } | BufferEncoding | null | undefined | Record<string, never>): void;\r\nexport function forEachChildSync(path: string, func: (filename: Buffer) => void, options?: { encoding: 'buffer' } | 'buffer'): void;\r\nexport function forEachChildSync(\r\n    path: string,\r\n    func: (filename: string & Buffer) => void,\r\n    options?: (\r\n        | ({ encoding: 'buffer' } | 'buffer')\r\n        | ({ encoding: BufferEncoding | null } | BufferEncoding | null | undefined | Record<string, never>)\r\n    )\r\n) {\r\n    const children: string[] | Buffer[] = fs.readdirSync(path, options as (({ encoding: 'buffer' } | 'buffer') & ({ encoding: BufferEncoding | null } | BufferEncoding | null | undefined)) | undefined);\r\n    for (const child of children) {\r\n        (func as (filename: string | Buffer) => void)(child);\r\n    }\r\n}\r\n","import * as fs from './index';\r\n\r\nasync function _isDirectoryHelper(path: string) {\r\n    return (await fs.stat(path)).isDirectory();\r\n}\r\n\r\n// check if file path is directory, from https://github.com/overlookmotel/fs-extra-promise\r\n/**\r\n * Check if the file at a path is a directory.\r\n * @param path the path to the file to check\r\n * @param callback callback function to call with whether or not the file is a directory, or a value for `err` if the\r\n * operation fails\r\n */\r\nexport function isDirectory(path: string, callback: (err: NodeJS.ErrnoException | null, text?: boolean) => void): void;\r\nexport function isDirectory(path: string): Promise<boolean>;\r\nexport function isDirectory(path: string, callback?: (err: NodeJS.ErrnoException | null, text?: boolean) => void): void | Promise<boolean> {\r\n    if (!callback) {\r\n        return _isDirectoryHelper(path);\r\n    }\r\n    // legacy (non-promise)\r\n    fs.stat(path, (err, stats) => {\r\n        if (err) return callback(err);\r\n\r\n        callback(null, stats.isDirectory());\r\n    });\r\n}\r\n\r\n/**\r\n * Check if the file at a path is a directory.\r\n * @param path the path to the file to check\r\n * @returns whether or not the file is a directory\r\n */\r\nexport function isDirectorySync(path: string): boolean {\r\n    return fs.statSync(path).isDirectory();\r\n}\r\n","// eslint-disable-next-line @typescript-eslint/unbound-method, camelcase\r\nexport const Array_fromAsync = Array.fromAsync ?? async function fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>, mapperFn: (value: Awaited<T>) => U | PromiseLike<U>): Promise<Awaited<U | T>[]> {\r\n    const items: Awaited<U | T>[] = [];\r\n    if (mapperFn) {\r\n        if (Symbol.asyncIterator in iterableOrArrayLike) {\r\n            for await (const item of iterableOrArrayLike) {\r\n                items.push(await mapperFn(item));\r\n            }\r\n        } else if (Symbol.iterator in iterableOrArrayLike) {\r\n            for (const item of iterableOrArrayLike) {\r\n                items.push(await mapperFn(await item));\r\n            }\r\n        } else {\r\n            const length = iterableOrArrayLike.length;\r\n            for (let i = 0; i < length; i++) {\r\n                const item = await iterableOrArrayLike[i];\r\n                items.push(await mapperFn(item));\r\n            }\r\n        }\r\n    } else {\r\n        if (Symbol.asyncIterator in iterableOrArrayLike) {\r\n            for await (const item of iterableOrArrayLike) {\r\n                items.push(item);\r\n            }\r\n        } else if (Symbol.iterator in iterableOrArrayLike) {\r\n            for (const item of iterableOrArrayLike) {\r\n                items.push(await item);\r\n            }\r\n        } else {\r\n            const length = iterableOrArrayLike.length;\r\n            for (let i = 0; i < length; i++) {\r\n                const item = await iterableOrArrayLike[i];\r\n                items.push(item);\r\n            }\r\n        }\r\n    }\r\n    return items;\r\n};\r\n","// eslint-disable-next-line camelcase\r\nimport { Array_fromAsync } from '../helpers';\r\nimport type { MapChildrenFunction } from '../types';\r\nimport * as fs from './index';\r\nimport { isDirectory } from './is-directory';\r\n\r\nasync function* _asyncFilter<T>(iterable: Iterable<T> | (ArrayLike<T> & Iterable<T>), condition: (value: T, index: number, iterable: Iterable<T> | (ArrayLike<T> & Iterable<T>)) => boolean | Promise<boolean>) {\r\n    let i = 0;\r\n    for (const value of iterable) {\r\n        if (await condition(value, i++, iterable)) {\r\n            yield value;\r\n        }\r\n    }\r\n}\r\n\r\n/**\r\n * Iterate through every file child of a folder, call a mapper function with each file's contents and write the returned\r\n * value of the mapper to the files. This will not recurse into subdirectories.\r\n * @param path folder path to iterate through\r\n * @param mapper mapping function to call on each file\r\n * @param readOptions options to pass to [[readFile]]\r\n * @param writeOptions options to pass to [[writeFile]]\r\n * @returns a [[Promise]] resolving to an array of the children files, once the mapping is finished.\r\n */\r\nexport async function mapChildren(\r\n    path: string,\r\n    mapper: MapChildrenFunction<string>,\r\n    readOptions: { encoding: BufferEncoding } | BufferEncoding,\r\n    writeOptions?: fs.WriteFileOptions | BufferEncoding\r\n): Promise<string[]>;\r\nexport async function mapChildren(\r\n    path: string,\r\n    mapper: MapChildrenFunction<Buffer>,\r\n    readOptions?: { encoding?: null | 'buffer' } | 'buffer' | null | undefined,\r\n    writeOptions?: fs.WriteFileOptions | BufferEncoding\r\n): Promise<string[]>;\r\nexport async function mapChildren(\r\n    path: string,\r\n    mapper: MapChildrenFunction<string> | MapChildrenFunction<Buffer>,\r\n    readOptions?: { encoding: BufferEncoding } | BufferEncoding | { encoding?: null | 'buffer' } | 'buffer' | null | undefined,\r\n    writeOptions?: fs.WriteFileOptions | BufferEncoding\r\n): Promise<string[]> {\r\n    const children = await Array_fromAsync(_asyncFilter((await fs.readdir(path)).map(child => path + '/' + child), async e => !await isDirectory(e)));\r\n    for (const e of children) {\r\n        const contents = await (fs.readFile as any)(e, readOptions);\r\n        const filename = e.slice(e.lastIndexOf('/') + 1);\r\n        let result = mapper(contents, filename, path, e);\r\n        if (result instanceof Promise) {\r\n            result = await result;\r\n        }\r\n        if (result != contents) {\r\n            await fs.writeFile(e, result, writeOptions);\r\n        }\r\n    }\r\n    return children;\r\n}\r\n","// eslint-disable-next-line camelcase\r\nimport * as fs from './index';\r\nimport type { ReadFileOptions, MapStructureResult, MapStructureFunction } from '../types';\r\nimport { _diveWorker, dive } from './dive';\r\n\r\nasync function _mapStructureProcessFile(file: string, stat: fs.Stats, mapper: MapStructureFunction<string> | MapStructureFunction<Buffer>, readOptions: ReadFileOptions | BufferEncoding | undefined, writeOptions: fs.WriteFileOptions | BufferEncoding | undefined) {\r\n    const contents = await fs.readFile(file, readOptions);\r\n    let result = mapper(contents as any, file, stat);\r\n    if (result instanceof Promise) {\r\n        result = await result;\r\n    }\r\n    if (result != contents) {\r\n        await fs.writeFile(file, result, writeOptions);\r\n    }\r\n}\r\n\r\n/**\r\n * Iterate through every file child of a folder recursively, call a mapper function with each file's contents and write\r\n * the returned value of the mapper to the files. **when passing [[MapStructureFunctionAsync]] as a parameter,\r\n * operations are done in parallel; to avoid running out of file handles, or to maintain the order (as provided by\r\n * `dive`), use [[mapStructureOrdered]].**\r\n * @param path folder path to iterate through\r\n * @param mapper mapping function to call on each file\r\n * @param readOptions options to pass to [[readFile]]\r\n * @param writeOptions options to pass to [[writeFile]]\r\n * @returns a [[Promise]] resolving to an array of all processed files\r\n */\r\nexport async function mapStructure(\r\n    path: string,\r\n    mapper: MapStructureFunction<string>,\r\n    readOptions: { encoding: BufferEncoding } | BufferEncoding,\r\n    writeOptions?: fs.WriteFileOptions | BufferEncoding\r\n): Promise<MapStructureResult[]>;\r\nexport async function mapStructure(\r\n    path: string,\r\n    mapper: MapStructureFunction<Buffer>,\r\n    readOptions?: { encoding?: null | 'buffer' } | 'buffer' | null | undefined,\r\n    writeOptions?: fs.WriteFileOptions | BufferEncoding\r\n): Promise<MapStructureResult[]>;\r\nexport async function mapStructure(\r\n    path: string,\r\n    mapper: MapStructureFunction<string> | MapStructureFunction<Buffer>,\r\n    readOptions?: { encoding: BufferEncoding } | BufferEncoding | { encoding?: null | 'buffer' } | 'buffer' | null | undefined,\r\n    writeOptions?: fs.WriteFileOptions | BufferEncoding\r\n): Promise<MapStructureResult[]> {\r\n    const promiseArr: Promise<void>[] = [];\r\n    const results: { file: string, stat: fs.Stats }[] = [];\r\n\r\n    await dive(path, { all: true }, (file, stat) => {\r\n        promiseArr.push(_mapStructureProcessFile(file, stat, mapper, readOptions as any, writeOptions));\r\n        results.push({ file, stat });\r\n    });\r\n\r\n    await Promise.all(promiseArr);\r\n\r\n    return results;\r\n}\r\n\r\n/**\r\n * Iterate through every file child of a folder recursively, call a mapper function with each file's contents and write\r\n * the returned value of the mapper to the files. **Mapper functions are invoked one at a time; to run them all at once,\r\n * use [[mapStructure]].**\r\n * @param path folder path to iterate through\r\n * @param mapper mapping function to call on each file\r\n * @param readOptions options to pass to [[readFile]]\r\n * @param writeOptions options to pass to [[writeFile]]\r\n * @returns a [[Promise]] resolving to an array of all processed files\r\n */\r\nexport async function mapStructureOrdered(\r\n    path: string,\r\n    mapper: MapStructureFunction<string>,\r\n    readOptions: { encoding: BufferEncoding } | BufferEncoding,\r\n    writeOptions?: fs.WriteFileOptions | BufferEncoding\r\n): Promise<MapStructureResult[]>;\r\nexport async function mapStructureOrdered(\r\n    path: string,\r\n    mapper: MapStructureFunction<Buffer>,\r\n    readOptions?: { encoding?: null | 'buffer' } | 'buffer' | null | undefined,\r\n    writeOptions?: fs.WriteFileOptions | BufferEncoding\r\n): Promise<MapStructureResult[]>;\r\nexport async function mapStructureOrdered(\r\n    path: string,\r\n    mapper: MapStructureFunction<string> | MapStructureFunction<Buffer>,\r\n    readOptions?: { encoding: BufferEncoding } | BufferEncoding | { encoding?: null | 'buffer' } | 'buffer' | null | undefined,\r\n    writeOptions?: fs.WriteFileOptions | BufferEncoding\r\n): Promise<MapStructureResult[]> {\r\n    const entries: { file: string, stat: fs.Stats }[] = [];\r\n\r\n    for await (const [file, stat] of _diveWorker(path)) {\r\n        entries.push({ file, stat });\r\n        await _mapStructureProcessFile(file, stat, mapper, readOptions as any, writeOptions);\r\n    }\r\n\r\n    return entries;\r\n}\r\n","import type { ReadFileOptions, MapStructureResult, ErrorCallback, DiveActionCallback, DiveActionPromise, DiveOptions, MapChildrenFunction, MapStructureFunction } from '../types';\r\nimport * as fs from './index';\r\n\r\nfunction _readLinesHelper(path: fs.PathOrFileDescriptor, encoding: BufferEncoding, resolve: (data: string[]) => void, reject: (err: NodeJS.ErrnoException | null) => void) {\r\n    fs.readFile(path, encoding, (err, data) => {\r\n        if (err) {\r\n            reject(err);\r\n        } else if (data.indexOf('\\r\\n') > -1) {\r\n            resolve(data.split('\\r\\n'));\r\n        } else if (data.indexOf('\\n') > -1) {\r\n            resolve(data.split('\\n'));\r\n        } else resolve([data]);\r\n    });\r\n}\r\n\r\n// readLines(path[, encoding][, callback])\r\n/**\r\n * Read a file into a string array of its lines.\r\n * @param path the path to the file to read\r\n * @param encoding the encoding to use to read the file\r\n * @param callback callback function to call with the file's lines, or a value for `err` if the operation fails\r\n */\r\nexport function readLines(path: string, encoding: BufferEncoding, callback: (err: NodeJS.ErrnoException | null, lines?: string[]) => void): void;\r\nexport function readLines(path: string, callback: (err: NodeJS.ErrnoException | null, lines?: string[]) => void): void;\r\nexport function readLines(path: string, encoding?: BufferEncoding): Promise<string[]>;\r\nexport function readLines(path: string, o1?: BufferEncoding | ((err: NodeJS.ErrnoException | null, lines?: string[]) => void), o2?: (err: NodeJS.ErrnoException | null, lines?: string[]) => void): void | Promise<string[]> {\r\n    const encoding = typeof o1 == 'string' ? o1 : 'utf8';\r\n    const callback = typeof o1 == 'string' ? o2 : o1;\r\n    if (!callback) {\r\n        return new Promise((resolve, reject) => {\r\n            _readLinesHelper(path, encoding, resolve, reject);\r\n        });\r\n    }\r\n    // legacy (non-promise)\r\n    _readLinesHelper(path, encoding, e => callback(null, e), callback);\r\n}\r\n\r\n// readLinesSync(path[, encoding])\r\n/**\r\n * Synchronously read a file into a string array of its lines.\r\n * @param path the path to the file to read\r\n * @param encoding the encoding to use to read the file, default is UTF-8\r\n * @returns the file's lines\r\n */\r\nexport function readLinesSync(path: string, encoding: BufferEncoding = 'utf8'): string[] {\r\n    const data = fs.readFileSync(path, encoding);\r\n    if (data.indexOf('\\r\\n') > -1) {\r\n        return data.split('\\r\\n');\r\n    }\r\n    if (data.indexOf('\\n') > -1) {\r\n        return data.split('\\n');\r\n    }\r\n    return [data];\r\n}\r\n","import * as fs from './index';\r\n\r\n/**\r\n * Shorter version of [[readFile]] where the encoding is UTF-8.\r\n * @param path the path to the file to read\r\n * @param callback callback function to call with the file's text contents, or a value for `err` if the operation fails\r\n */\r\nexport function readText(path: string, callback: (err: NodeJS.ErrnoException | null, text: string) => void): void;\r\nexport function readText(path: string): Promise<string>;\r\nexport function readText(path: string, callback?: (err: NodeJS.ErrnoException | null, text: string) => void): void | Promise<string> {\r\n    if (!callback) {\r\n        return fs.readFile(path, 'utf8');\r\n    }\r\n    // legacy (non-promise)\r\n    fs.readFile(path, 'utf8', callback);\r\n}\r\n\r\n/**\r\n * Shorter version of [[readFileSync]] where the encoding is UTF-8.\r\n * @param path the path to the file to read\r\n * @returns the file's text contents\r\n */\r\nexport function readTextSync(path: string) {\r\n    return fs.readFileSync(path, 'utf8');\r\n}\r\n","import { ReadableStream } from 'stream/web';\r\nimport type * as fs from './index';\r\nimport { Readable, isReadable } from 'stream';\r\nimport { fromPromise } from 'universalify';\r\nimport { finished } from 'stream/promises';\r\nimport type * as streamWeb from 'stream/web';\r\nimport { createWriteStream, writeFile as _writeFile } from 'graceful-fs';\r\nimport { universalify } from './universalify';\r\n\r\nconst backingWriteFile = universalify(_writeFile);\r\n\r\nconst _writeFileStreamHelper = fromPromise(async (\r\n    path: fs.PathOrFileDescriptor,\r\n    data: NodeJS.ReadableStream,\r\n    options?: fs.WriteFileOptions\r\n) => {\r\n    interface CreateWriteStreamFSImplementation {\r\n        open?: (...args: any[]) => any;\r\n        close?: (...args: any[]) => any;\r\n        write: (...args: any[]) => any;\r\n        writev?: (...args: any[]) => any;\r\n    }\r\n    interface StreamOptions {\r\n        flags?: string | undefined;\r\n        encoding?: BufferEncoding | undefined;\r\n        fd?: number | import('fs/promises').FileHandle | undefined;\r\n        mode?: number | undefined;\r\n        autoClose?: boolean | undefined;\r\n        emitClose?: boolean | undefined;\r\n        start?: number | undefined;\r\n        signal?: AbortSignal | null | undefined;\r\n        highWaterMark?: number | undefined;\r\n\r\n        fs?: CreateWriteStreamFSImplementation | null | undefined;\r\n        flush?: boolean | undefined;\r\n    }\r\n\r\n    function getOptions(options?: fs.WriteFileOptions): StreamOptions | undefined {\r\n        return options ? typeof options === 'string' ? { encoding: options } : {\r\n            encoding: options.encoding || undefined,\r\n            mode: typeof options.mode === 'string' ? parseInt(options.mode, 8) : options.mode,\r\n            flush: options.flush,\r\n        } : undefined;\r\n    }\r\n\r\n    let stream: fs.WriteStream;\r\n    if (typeof path === 'number') {\r\n        stream = createWriteStream('', {...getOptions(options), fd: path});\r\n    } else {\r\n        stream = createWriteStream(path, getOptions(options));\r\n    }\r\n    await finished(data.pipe(stream));\r\n});\r\n\r\n/**\r\n * When `file` is a filename, asynchronously writes data to the file, replacing the\r\n * file if it already exists. `data` can be a string or a buffer.\r\n *\r\n * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using\r\n * a file descriptor.\r\n *\r\n * The `encoding` option is ignored if `data` is a buffer.\r\n *\r\n * The `mode` option only affects the newly created file. See {@link open} for more details.\r\n *\r\n * ```js\r\n * import { writeFile } from 'node:fs';\r\n * import { Buffer } from 'node:buffer';\r\n *\r\n * const data = new Uint8Array(Buffer.from('Hello Node.js'));\r\n * writeFile('message.txt', data, (err) => {\r\n *   if (err) throw err;\r\n *   console.log('The file has been saved!');\r\n * });\r\n * ```\r\n *\r\n * If `options` is a string, then it specifies the encoding:\r\n *\r\n * ```js\r\n * import { writeFile } from 'node:fs';\r\n *\r\n * writeFile('message.txt', 'Hello Node.js', 'utf8', callback);\r\n * ```\r\n *\r\n * It is unsafe to use `fs.writeFile()` multiple times on the same file without\r\n * waiting for the callback. For this scenario, {@link createWriteStream} is\r\n * recommended.\r\n *\r\n * Similarly to `fs.readFile` \\- `fs.writeFile` is a convenience method that\r\n * performs multiple `write` calls internally to write the buffer passed to it.\r\n * For performance sensitive code consider using {@link createWriteStream}.\r\n *\r\n * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`.\r\n * Cancelation is \"best effort\", and some amount of data is likely still\r\n * to be written.\r\n *\r\n * ```js\r\n * import { writeFile } from 'node:fs';\r\n * import { Buffer } from 'node:buffer';\r\n *\r\n * const controller = new AbortController();\r\n * const { signal } = controller;\r\n * const data = new Uint8Array(Buffer.from('Hello Node.js'));\r\n * writeFile('message.txt', data, { signal }, (err) => {\r\n *   // When a request is aborted - the callback is called with an AbortError\r\n * });\r\n * // When the request should be aborted\r\n * controller.abort();\r\n * ```\r\n *\r\n * Aborting an ongoing request does not abort individual operating\r\n * system requests but rather the internal buffering `fs.writeFile` performs.\r\n * @since v0.1.29\r\n * @param file filename or file descriptor\r\n * @param data The data to write. If a stream is provided, it will be read to completion.\r\n * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.\r\n * If `encoding` is not supplied, the default of `'utf8'` is used.\r\n * If `mode` is not supplied, the default of `0o666` is used.\r\n * If `mode` is a string, it is parsed as an octal integer.\r\n * If `flag` is not supplied, the default of `'w'` is used.\r\n * @since Web Streams API support since Node v17.0.0\r\n */\r\nexport function writeFile(\r\n    file: fs.PathOrFileDescriptor,\r\n    data: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer | NodeJS.ReadableStream | streamWeb.ReadableStream,\r\n    options: fs.WriteFileOptions,\r\n    callback: fs.NoParamCallback,\r\n): void;\r\n/**\r\n * Asynchronously writes data to a file, replacing the file if it already exists.\r\n * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.\r\n * If a file descriptor is provided, the underlying file will _not_ be closed automatically.\r\n * @param data The data to write. If a stream is provided, it will be read to completion.\r\n * @since Web Streams API support since Node v17.0.0\r\n */\r\nexport function writeFile(\r\n    path: fs.PathOrFileDescriptor,\r\n    data: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer | NodeJS.ReadableStream | streamWeb.ReadableStream,\r\n    callback: fs.NoParamCallback,\r\n): void;\r\n\r\n/**\r\n * Asynchronously writes data to a file, replacing the file if it already exists.\r\n * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.\r\n * URL support is _experimental_.\r\n * If a file descriptor is provided, the underlying file will _not_ be closed automatically.\r\n * @param data The data to write. If a stream is provided, it will be read to completion.\r\n * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.\r\n * If `encoding` is not supplied, the default of `'utf8'` is used.\r\n * If `mode` is not supplied, the default of `0o666` is used.\r\n * If `mode` is a string, it is parsed as an octal integer.\r\n * If `flag` is not supplied, the default of `'w'` is used.\r\n * @since Web Streams API support since Node v17.0.0\r\n */\r\nexport function writeFile(\r\n    path: fs.PathOrFileDescriptor,\r\n    data: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer | NodeJS.ReadableStream | streamWeb.ReadableStream,\r\n    options?: fs.WriteFileOptions,\r\n): Promise<void>;\r\n\r\nexport function writeFile(\r\n    path: fs.PathOrFileDescriptor,\r\n    data: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer | NodeJS.ReadableStream | streamWeb.ReadableStream,\r\n    optionsOrCallback?: fs.WriteFileOptions | fs.NoParamCallback,\r\n    optionalCallback?: fs.NoParamCallback\r\n): void | Promise<void> {\r\n    const options = typeof optionsOrCallback !== 'function' ? optionsOrCallback : undefined;\r\n    const callback: fs.NoParamCallback | undefined = optionalCallback ?? (typeof optionsOrCallback === 'function' ? optionsOrCallback : undefined);\r\n\r\n    if (data instanceof ReadableStream) {\r\n        data = Readable.fromWeb(data);\r\n    }\r\n\r\n    if (isNodeReadableStream(data)) {\r\n        return _writeFileStreamHelper(path, data, options, callback!);\r\n    }\r\n\r\n    if (data instanceof SharedArrayBuffer || data instanceof ArrayBuffer) {\r\n        data = new Uint8Array(data);\r\n    }\r\n\r\n    // @ts-expect-error\r\n    return backingWriteFile(path, data as string | NodeJS.ArrayBufferView, optionsOrCallback, optionalCallback);\r\n}\r\n\r\nfunction isNodeReadableStream(stream: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer | NodeJS.ReadableStream | streamWeb.ReadableStream): stream is NodeJS.ReadableStream {\r\n    return typeof stream === 'object' && 'readable' in stream && isReadable(stream);\r\n}\r\n","import type { JsonReadOptions, JsonWriteOptions } from './types';\r\nimport type { ReadCallback, WriteCallback } from 'jsonfile';\r\nimport type { JsonOutputOptions } from 'fs-extra';\r\n\r\nimport { outputFile, outputFileSync } from '../lib/output-file';\r\nimport { universalify } from './fs/universalify';\r\nimport * as fs from './fs';\r\nimport {\r\n    readFileSync, writeFileSync,\r\n} from 'graceful-fs';\r\n\r\nasync function _readJson<T>(file: fs.PathOrFileDescriptor, options: JsonReadOptions): Promise<T | null> {\r\n    if (typeof options === 'string') {\r\n        options = { encoding: options };\r\n    }\r\n\r\n    const _readFile = options?.fs?.readFile ? universalify(options.fs.readFile) : fs.readFile;\r\n\r\n    const data = stripBom(await _readFile(file, options));\r\n\r\n    let obj: T;\r\n    try {\r\n        obj = JSON.parse(data, options?.reviver);\r\n    } catch (err) {\r\n        const shouldThrow = options?.throws ?? true;\r\n\r\n        if (shouldThrow) {\r\n            if (err instanceof Error) {\r\n                (err as { message: string }).message = `${file}: ${err.message}`;\r\n                throw err;\r\n            } else {\r\n                throw new Error(`${file}: ${err}`);\r\n            }\r\n        } else {\r\n            return null;\r\n        }\r\n    }\r\n\r\n    return obj;\r\n}\r\n\r\n/**\r\n * Reads a JSON file and then parses it into an object.\r\n *\r\n * @example\r\n * import * as fs from 'fs-extra'\r\n *\r\n * // With a callback:\r\n * fs.readJson('./package.json', (err, packageObj) => {\r\n *   if (err) console.error(err)\r\n *   console.log(packageObj.version) // => 0.1.3\r\n * })\r\n *\r\n * // With Promises:\r\n * fs.readJson('./package.json')\r\n *   .then(packageObj => {\r\n *     console.log(packageObj.version) // => 0.1.3\r\n *   })\r\n *   .catch(err => {\r\n *     console.error(err)\r\n *   })\r\n *\r\n * // With async/await:\r\n * async function asyncAwait () {\r\n *   try {\r\n *     const packageObj = await fs.readJson('./package.json')\r\n *     console.log(packageObj.version) // => 0.1.3\r\n *   } catch (err) {\r\n *     console.error(err)\r\n *   }\r\n * }\r\n *\r\n * asyncAwait()\r\n *\r\n * // `readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example:\r\n * const file = '/tmp/some-invalid.json'\r\n * const data = '{not valid JSON'\r\n * fs.writeFileSync(file, data)\r\n *\r\n * // With a callback:\r\n * fs.readJson(file, { throws: false }, (err, obj) => {\r\n *   if (err) console.error(err)\r\n *   console.log(obj) // => null\r\n * })\r\n *\r\n * // With Promises:\r\n * fs.readJson(file, { throws: false })\r\n *   .then(obj => {\r\n *     console.log(obj) // => null\r\n *   })\r\n *   .catch(err => {\r\n *     console.error(err) // Not called\r\n *   })\r\n *\r\n * // With async/await:\r\n * async function asyncAwaitThrows () {\r\n *   const obj = await fs.readJson(file, { throws: false })\r\n *   console.log(obj) // => null\r\n * }\r\n *\r\n * asyncAwaitThrows()\r\n *\r\n * @see {@link https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback}\r\n */\r\nexport function readJson(file: fs.PathOrFileDescriptor, options: JsonReadOptions, callback: ReadCallback): void;\r\nexport function readJson(file: fs.PathOrFileDescriptor, callback: ReadCallback): void;\r\nexport function readJson(file: fs.PathOrFileDescriptor, options?: JsonReadOptions): Promise<any>;\r\nexport function readJson(file: fs.PathOrFileDescriptor, o1?: JsonReadOptions | ReadCallback, o2?: ReadCallback): void | Promise<any> {\r\n    const options = (o2 ?? (typeof o1 !== 'function' ? o1 : undefined)) as JsonReadOptions;\r\n    const callback = (o2 ?? (options === undefined ? o1 : undefined)) as ReadCallback | undefined;\r\n\r\n    if (!callback) {\r\n        return _readJson(file, options);\r\n    }\r\n\r\n    return _readJson(file, options)\r\n        .then(result => callback(null, result), error => callback(error, undefined));\r\n}\r\n\r\nfunction stringify(obj: unknown, { EOL = '\\n', finalEOL = true, replacer = undefined, spaces = undefined }: Extract<JsonWriteOptions, object>) {\r\n    const EOF = finalEOL ? EOL : '';\r\n    const str = JSON.stringify(obj, replacer, spaces);\r\n\r\n    return str.replace(/\\n/g, EOL) + EOF;\r\n}\r\n\r\nfunction stripBom(content: string | Buffer): string {\r\n    // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified\r\n    if (Buffer.isBuffer(content)) content = content.toString('utf8');\r\n    return content.replace(/^\\uFEFF/, '');\r\n}\r\n\r\n/**\r\n * Reads a JSON file and then parses it into an object.\r\n *\r\n * @example\r\n * import * as fs from 'fs-extra'\r\n *\r\n * const packageObj = fs.readJsonSync('./package.json')\r\n * console.log(packageObj.version) // => 2.0.0\r\n *\r\n * // `readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example:\r\n * const file = '/tmp/some-invalid.json'\r\n * const data = '{not valid JSON'\r\n * fs.writeFileSync(file, data)\r\n *\r\n * const obj = fs.readJsonSync(file, { throws: false })\r\n * console.log(obj) // => null\r\n *\r\n * @see {@link https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options}\r\n */\r\nexport function readJsonSync(file: fs.PathOrFileDescriptor, options?: JsonReadOptions): any {\r\n    if (typeof options === 'string') {\r\n        options = { encoding: options };\r\n    }\r\n\r\n    const _readFileSync = options?.fs?.readFileSync ?? readFileSync;\r\n\r\n    try {\r\n        const content = stripBom(_readFileSync(file, options));\r\n        return JSON.parse(content, options?.reviver);\r\n    } catch (err) {\r\n        const shouldThrow = options?.throws ?? true;\r\n\r\n        if (shouldThrow) {\r\n            if (err instanceof Error) {\r\n                (err as { message: string }).message = `${file}: ${err.message}`;\r\n                throw err;\r\n            } else {\r\n                throw new Error(`${file}: ${err}`);\r\n            }\r\n        } else {\r\n            return null;\r\n        }\r\n    }\r\n}\r\n\r\nasync function _writeJson(file: fs.PathOrFileDescriptor, obj: any, options?: JsonWriteOptions) {\r\n    if (typeof options === 'string') {\r\n        options = { encoding: options };\r\n    }\r\n\r\n    const _writeFile = options?.fs?.writeFile ? universalify(options.fs.writeFile) : fs.writeFile;\r\n\r\n    const str = stringify(obj, options ?? {});\r\n\r\n    await _writeFile(file, str, options);\r\n}\r\n\r\n/**\r\n * Writes an object to a JSON file.\r\n *\r\n * @example\r\n * import * as fs from 'fs-extra'\r\n *\r\n * // With a callback:\r\n * fs.writeJson('./package.json', {name: 'fs-extra'}, err => {\r\n *   if (err) return console.error(err)\r\n *   console.log('success!')\r\n * })\r\n *\r\n * // With Promises:\r\n * fs.writeJson('./package.json', {name: 'fs-extra'})\r\n *   .then(() => {\r\n *     console.log('success!')\r\n *   })\r\n *   .catch(err => {\r\n *     console.error(err)\r\n *   })\r\n *\r\n * // With async/await:\r\n * async function asyncAwait () {\r\n *   try {\r\n *     await fs.writeJson('./package.json', {name: 'fs-extra'})\r\n *     console.log('success!')\r\n *   } catch (err) {\r\n *     console.error(err)\r\n *   }\r\n * }\r\n *\r\n * asyncAwait()\r\n *\r\n * @see {@link https://github.com/jprichardson/node-jsonfile#writefilefilename-obj-options-callback}\r\n */\r\nexport function writeJson(file: fs.PathOrFileDescriptor, obj: any, options: JsonWriteOptions, callback: WriteCallback): void;\r\nexport function writeJson(file: fs.PathOrFileDescriptor, obj: any, callback: WriteCallback): void;\r\nexport function writeJson(file: fs.PathOrFileDescriptor, obj: any, options?: JsonWriteOptions): Promise<void>;\r\nexport function writeJson(file: fs.PathOrFileDescriptor, obj: any, o1?: WriteCallback | JsonWriteOptions, o2?: WriteCallback): Promise<void> {\r\n    const options = (o2 ?? (typeof o1 !== 'function' ? o1 : undefined)) as JsonWriteOptions;\r\n    const callback = (o2 ?? (options === undefined ? o1 : undefined)) as WriteCallback | undefined;\r\n\r\n    if (!callback) {\r\n        return _writeJson(file, obj, options);\r\n    }\r\n\r\n    return _writeJson(file, obj, options)\r\n        .then(() => callback(null), error => callback(error));\r\n}\r\n\r\n/**\r\n * Writes an object to a JSON file.\r\n *\r\n * @example\r\n * import * as fs from 'fs-extra'\r\n *\r\n * fs.writeJsonSync('./package.json', {name: 'fs-extra'})\r\n *\r\n * @see {@link https://github.com/jprichardson/node-jsonfile#writefilesyncfilename-obj-options}\r\n */\r\nexport function writeJsonSync(file: fs.PathOrFileDescriptor, obj: any, options?: JsonWriteOptions): void {\r\n    if (typeof options === 'string') {\r\n        options = { encoding: options };\r\n    }\r\n\r\n    const _writeFileSync = options?.fs?.writeFileSync ?? writeFileSync;\r\n\r\n    const str = stringify(obj, options ?? {});\r\n    _writeFileSync(file, str, options);\r\n}\r\n\r\n/**\r\n * Almost the same as `writeJson`, except that if the directory does not exist, it's created.\r\n *\r\n * @example\r\n * import * as fs from 'fs-extra'\r\n *\r\n * const file = '/tmp/this/path/does/not/exist/file.json'\r\n *\r\n * // With a callback:\r\n * fs.outputJson(file, {name: 'JP'}, err => {\r\n *   console.log(err) // => null\r\n *\r\n *   fs.readJson(file, (err, data) => {\r\n *     if (err) return console.error(err)\r\n *     console.log(data.name) // => JP\r\n *   })\r\n * })\r\n *\r\n * // With Promises:\r\n * fs.outputJson(file, {name: 'JP'})\r\n *   .then(() => fs.readJson(file))\r\n *   .then(data => {\r\n *     console.log(data.name) // => JP\r\n *   })\r\n *   .catch(err => {\r\n *     console.error(err)\r\n *   })\r\n *\r\n * // With async/await:\r\n * async function asyncAwait () {\r\n *   try {\r\n *     await fs.outputJson(file, {name: 'JP'})\r\n *\r\n *     const data = await fs.readJson(file)\r\n *\r\n *     console.log(data.name) // => JP\r\n *   } catch (err) {\r\n *     console.error(err)\r\n *   }\r\n * }\r\n *\r\n * asyncAwait()\r\n */\r\nexport function outputJson(file: string, data: any, options?: JsonOutputOptions): Promise<void>;\r\nexport function outputJson(file: string, data: any, options: JsonOutputOptions, callback: fs.NoParamCallback): void;\r\nexport function outputJson(file: string, data: any, callback: fs.NoParamCallback): void;\r\nexport function outputJson(file: string, data: any, optionsOrCallback?: JsonOutputOptions | fs.NoParamCallback, callback?: fs.NoParamCallback): void | Promise<void> {\r\n    callback = callback ?? (typeof optionsOrCallback === 'function' ? optionsOrCallback : undefined);\r\n    const options = typeof optionsOrCallback === 'object' ? optionsOrCallback : {};\r\n\r\n    if (!callback) {\r\n        return new Promise((resolve, reject) => {\r\n            outputJson(file, data, options, err => err ? reject(err) : resolve());\r\n        });\r\n    }\r\n\r\n    const str = stringify(data, options);\r\n    outputFile(file, str, options, callback);\r\n}\r\n\r\n/**\r\n * Almost the same as `writeJsonSync`, except that if the directory does not exist, it's created.\r\n *\r\n * @example\r\n * import * as fs from 'fs-extra'\r\n *\r\n * const file = '/tmp/this/path/does/not/exist/file.json'\r\n * fs.outputJsonSync(file, {name: 'JP'})\r\n *\r\n * const data = fs.readJsonSync(file)\r\n * console.log(data.name) // => JP\r\n */\r\nexport function outputJsonSync(file: string, data: any, options: JsonOutputOptions = {}): void {\r\n    const str = stringify(data, options);\r\n    outputFileSync(file, str, options);\r\n}\r\n","// export types\r\nexport type * from './types';\r\nexport type { CopyOptions, CopyOptionsSync, EnsureDirOptions, SymlinkType, MoveOptions, JsonOutputOptions } from 'fs-extra';\r\nexport * from './fs';\r\n\r\n// export other stuff\r\nexport { default as vacuum } from './external/vacuum';\r\nexport { copy, copySync } from '../lib/copy';\r\nexport { emptyDir, emptyDirSync } from '../lib/empty';\r\nexport { ensureFile, ensureFileSync, ensureLink, ensureLinkSync, ensureSymlink, ensureSymlinkSync } from '../lib/ensure';\r\nexport { mkdirs, mkdirsSync, mkdirs as ensureDir, mkdirsSync as ensureDirSync } from '../lib/mkdirs';\r\nexport { move, moveSync } from '../lib/move';\r\nexport { outputFile, outputFileSync } from '../lib/output-file';\r\nexport { remove, removeSync } from '../lib/remove';\r\nexport { exists } from './fs/exists';\r\nexport { dive, diveSync } from './fs/dive';\r\nexport { forEachChild, forEachChildSync } from './fs/for-each-child';\r\nexport { isDirectory, isDirectorySync } from './fs/is-directory';\r\nexport { mapChildren } from './fs/map-children';\r\nexport { mapStructure, mapStructureOrdered } from './fs/map-structure';\r\nexport { readLines, readLinesSync } from './fs/read-lines';\r\nexport { readText, readTextSync } from './fs/read-text';\r\nexport { writeFile } from './fs/write-file';\r\n\r\nimport * as fs from './fs';\r\n\r\nexport * from './json';\r\n\r\n/**\r\n * Resolve a child file of a folder.\r\n * @param path The parent folder path\r\n * @param child The child filesystem entry path (can be a file or folder)\r\n * @returns `path` and `child` concatenated, delimited by whatever path separator is already used in the string,\r\n * defaulting to `/`; a delimiter is never added if it's not necessary.\r\n */\r\nexport function resolve(path: string, child: string): string {\r\n    if (path.endsWith('/') || path.endsWith('\\\\')) {\r\n        return path + child;\r\n    }\r\n    if (path.indexOf('/') > -1) {\r\n        return `${path}/${child}`;\r\n    }\r\n    if (path.indexOf('\\\\') > -1) {\r\n        return `${path}\\\\${child}`;\r\n    }\r\n    return `${path}/${child}`;\r\n}\r\n\r\n/**\r\n * Check if the file at a path is a symbolic link.\r\n * @param path the path to the file to check\r\n * @param callback callback function to call with whether or not the file is a symbolic link, or a value for `err` if the\r\n * operation fails\r\n */\r\nexport function isSymlink(file: string): Promise<boolean>;\r\nexport function isSymlink(file: string, callback?: (err: NodeJS.ErrnoException | null, isSymblink?: boolean) => void): void;\r\nexport function isSymlink(file: string, callback?: (err: NodeJS.ErrnoException | null, isSymblink?: boolean) => void): Promise<boolean> | void {\r\n    return callback\r\n        ? fs.lstat(file, (err, stats) => err ? callback(err) : callback(null, stats.isSymbolicLink()))\r\n        : fs.lstat(file).then(stats => stats.isSymbolicLink());\r\n}\r\n\r\nfunction combine<T extends unknown[]>(fn1?: (...args: T) => boolean, fn2?: (...args: T) => boolean): (...args: T) => boolean {\r\n    if (fn1) {\r\n        if (fn2) return (...args) => fn1(...args) && fn2(...args);\r\n        return fn1;\r\n    } else {\r\n        if (fn2) return fn2;\r\n        return () => true;\r\n    }\r\n}\r\n"],"names":["constants","require$$0","origCwd","process","cwd","platform","env","GRACEFUL_FS_PLATFORM","call","er","chdir","d","Object","setPrototypeOf","gracefulQueue","previousSymbol","Stream","getPrototypeOf","obj","__proto__","fs","polyfills","chmodFix","orig","target","mode","cb","chownErOk","apply","this","arguments","chmodFixSync","chownFix","uid","gid","chownFixSync","statFix","options","callback","stats","statFixSync","code","getuid","fs$readSync","hasOwnProperty","version","match","lchmod","path","open","O_WRONLY","O_SYMLINK","err","fd","fchmod","close","err2","lchmodSync","ret","openSync","threw","fchmodSync","closeSync","patchLchmod","lutimes","futimes","at","mt","er2","lutimesSync","futimesSync","_a","_b","_c","nextTick","patchLutimes","chown","fchown","lchown","chmod","chownSync","fchownSync","lchownSync","chmodSync","stat","fstat","lstat","statSync","fstatSync","lstatSync","rename","fs$rename","from","to","start","Date","now","backoff","CB","setTimeout","stater","st","read","fs$read","buffer","offset","length","position","callback_","eagCounter","_","__","readSync","legacy","ReadStream","self","readable","paused","flags","bufferSize","keys","index","key","encoding","setEncoding","undefined","TypeError","end","Infinity","Error","pos","emit","_read","WriteStream","writable","bytesWritten","busy","_queue","_open","push","flush","util","require$$4","publishQueue","context","queue","defineProperty","get","Symbol","for","debug","debuglog","test","NODE_DEBUG","m","format","split","join","console","error","global","fs$close","resetQueue","value","fs$closeSync","on","require$$5","equal","retryTimer","gracefulFs","patch","copy","create","getOwnPropertyNames","forEach","getOwnPropertyDescriptor","clone","gracefulify","createReadStream","createWriteStream","fs$readFile","readFile","go$readFile","startTime","enqueue","fs$writeFile","writeFile","data","go$writeFile","fs$appendFile","appendFile","go$appendFile","fs$copyFile","copyFile","src","dest","go$copyFile","fs$readdir","readdir","go$readdir","noReaddirOptionVersions","fs$readdirCallback","files","sort","substr","legStreams","fs$ReadStream","prototype","that","autoClose","destroy","fs$WriteStream","set","val","enumerable","configurable","FileReadStream","FileWriteStream","fs$open","go$open","elem","name","retry","i","clearTimeout","shift","fn","args","lastTime","pop","sinceAttempt","sinceStart","Math","max","min","concat","promisifyFallback","fallbackObjectCreator","promisify","custom","Promise","resolve","reject","results","TEST_GRACEFUL_FS_GLOBAL_PATCH","__patched","universalifiedSymbol","universalify","fallbackMultiResultObjectCreator","promisified","f","attr","gfs","truncate","ftruncate","statfs","link","symlink","readlink","realpath","unlink","rmdir","rm","mkdir","mkdtemp","utimes","write","bytesRead","access","writev","buffers","readv","opendir","cp","stripTrailingSep","thePath","sep","slice","rfs","native","emitWarning","noop","vacuum","leaf","base","next","branch","dirname","log","message","HOME","isDirectory","assert","potentialParent","toLowerCase","lastIndexOf","stack","isSymbolicLink","isFile","purge","recursive","force","fromPromise","then","r","checkPath","pth","replace","parse","root","getMode","makeDirSync","dir","mkdirSync","mkdirs","u","async","exists","utimesMillisSync","atime","mtime","utimesMillis","closeErr","e","getStats","opts","statFunc","dereference","file","bigint","srcStat","destStat","all","catch","getStatsSync","errMsg","funcName","checkPathsSync","areIdentical","srcBaseName","basename","destBaseName","isChangingCase","isSrcSubdir","checkParentPathsSync","srcParent","destParent","ino","dev","srcArr","filter","destArr","every","cur","checkPaths","checkParentPaths","runFilter","getStatsAndPerformCopy","statFn","_stat","onDir","isCharacterDevice","isBlockDevice","onFile","onLink","isSocket","isFIFO","overwrite","errorOnExist","_copyFile","preserveTimestamps","srcMode","makeFileWritable","updatedSrcStat","items","map","item","srcItem","destItem","resolvedSrc","resolvedDest","clobber","arch","pathExists","copySync","existsSync","mkdirsSync","_statSync","mayCopyFile","unlinkSync","copyFileSync","handleTimestamps","setDestMode","fileIsNotWritable","setDestTimestamps","copyDir","mkDirAndCopy","readdirSync","copyDirItem","readlinkSync","symlinkSync","copyLink","remove","removeSync","rmSync","emptyDir","_remove","emptyDirSync","createFile","dirStats","createFileSync","writeFileSync","createLink","srcpath","dstpath","dstStat","createLinkSync","linkSync","symlinkPaths","isAbsolute","toCwd","toDst","dstdir","relativeToDst","relative","symlinkPathsSync","symlinkType","type","symlinkTypeSync","createSymlink","toType","createSymlinkSync","doRename","_rename","moveAcrossDevice","parsedParentPath","isParentRoot","parent","parsedPath","renameSync","moveSync","outputFile","outputFileSync","matches","str","includes","_diveHelper","directory","action","_diveWorker","_diveWorkerCallback","children","withFileTypes","err1","directories","startsWith","pathResolve","ignore","_diveSyncWorker","dive","o1","o2","o3","complete","finally","diveSync","_forEachChildHelper","func","child","forEachChild","forEachChildSync","_isDirectoryHelper","isDirectorySync","Array_fromAsync","Array","fromAsync","iterableOrArrayLike","mapperFn","asyncIterator","iterator","_asyncFilter","iterable","condition","mapChildren","mapper","readOptions","writeOptions","contents","result","_mapStructureProcessFile","mapStructure","promiseArr","mapStructureOrdered","entries","_readLinesHelper","indexOf","readLines","readLinesSync","readText","readTextSync","readFileSync","backingWriteFile","_writeFile","_writeFileStreamHelper","stream","getOptions","parseInt","finished","pipe","optionsOrCallback","optionalCallback","ReadableStream","Readable","fromWeb","isReadable","SharedArrayBuffer","ArrayBuffer","Uint8Array","_readJson","_readFile","stripBom","JSON","reviver","throws","stringify","EOL","finalEOL","replacer","spaces","EOF","content","Buffer","isBuffer","toString","_writeJson","readJson","readJsonSync","_readFileSync","writeJson","writeJsonSync","outputJson","outputJsonSync","endsWith","isSymlink"],"mappings":";;;;;;;;;;;;;;EAAIA,SAAYC,GAAAA,UAAAA;EAEZC,OAAUC,GAAAA,OAAAA,CAAQC,GAClBA;EAAAA,GAAAA,GAAM;EAENC,QAAWF,GAAAA,OAAAA,CAAQG,GAAIC,CAAAA,oBAAAA,IAAwBJ,OAAQE,CAAAA,QAAAA;AAE3DF,OAAAA,CAAQC,GAAM,GAAA,YAAA;EAGZ,OAFKA,GACHA,KAAAA,GAAAA,GAAMF,OAAQM,CAAAA,IAAAA,CAAKL,OACdC,CAAAA,CAAAA,EAAAA,GAAAA;AACT,CAAA;AACA,IAAA;EACED,OAAQC,CAAAA,GAAAA,CAAAA,CAAAA;AACV,CAAA,CAAE,OAAOK,EAAM,EAAA,CAAA;AAGf,IAA6B,UAAA,IAAA,OAAlBN,QAAQO,KAAsB,EAAA;EACvC,IAAIA,QAAQP,OAAQO,CAAAA,KAAAA;EACpBP,OAAAA,CAAQO,QAAQ,UAAUC,CAAAA,EAAAA;IACxBP,GAAM,GAAA,IAAA,EACNM,KAAMF,CAAAA,IAAAA,CAAKL,OAASQ,EAAAA,CAA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