npm-check-updates
Version:
Find newer versions of dependencies than what your package.json allows
1 lines • 424 kB
Source Map (JSON)
{"version":3,"file":"index-D3Mtu-Hr.js","sources":["../node_modules/graceful-fs/polyfills.js","../node_modules/graceful-fs/legacy-streams.js","../node_modules/graceful-fs/clone.js","../node_modules/graceful-fs/graceful-fs.js","../node_modules/xdg-basedir/index.js","../node_modules/stubborn-fs/dist/attemptify.js","../node_modules/stubborn-fs/dist/constants.js","../node_modules/stubborn-fs/dist/handlers.js","../node_modules/stubborn-fs/dist/retryify_queue.js","../node_modules/stubborn-fs/dist/retryify.js","../node_modules/stubborn-fs/dist/index.js","../node_modules/atomically/dist/constants.js","../node_modules/atomically/dist/utils/lang.js","../node_modules/when-exit/dist/node/constants.js","../node_modules/when-exit/dist/node/signals.js","../node_modules/when-exit/dist/node/interceptor.js","../node_modules/when-exit/dist/node/index.js","../node_modules/atomically/dist/utils/temp.js","../node_modules/atomically/dist/index.js","../node_modules/dot-prop/index.js","../node_modules/configstore/index.js","../node_modules/ky/distribution/errors/HTTPError.js","../node_modules/ky/distribution/errors/TimeoutError.js","../node_modules/ky/distribution/utils/is.js","../node_modules/ky/distribution/utils/merge.js","../node_modules/ky/distribution/core/constants.js","../node_modules/ky/distribution/utils/normalize.js","../node_modules/ky/distribution/utils/timeout.js","../node_modules/ky/distribution/utils/delay.js","../node_modules/ky/distribution/utils/options.js","../node_modules/ky/distribution/core/Ky.js","../node_modules/ky/distribution/index.js","../node_modules/rc/node_modules/ini/ini.js","../node_modules/rc/node_modules/strip-json-comments/index.js","../node_modules/rc/lib/utils.js","../node_modules/deep-extend/lib/deep-extend.js","../node_modules/minimist/index.js","../node_modules/rc/index.js","../node_modules/registry-url/index.js","../node_modules/@pnpm/network.ca-file/node_modules/graceful-fs/polyfills.js","../node_modules/@pnpm/network.ca-file/node_modules/graceful-fs/legacy-streams.js","../node_modules/@pnpm/network.ca-file/node_modules/graceful-fs/clone.js","../node_modules/@pnpm/network.ca-file/node_modules/graceful-fs/graceful-fs.js","../node_modules/@pnpm/network.ca-file/dist/ca-file.js","../node_modules/@pnpm/network.ca-file/dist/index.js","../node_modules/proto-list/proto-list.js","../node_modules/config-chain/node_modules/ini/ini.js","../node_modules/config-chain/index.js","../node_modules/@pnpm/npm-conf/lib/envKeyToSetting.js","../node_modules/@pnpm/config.env-replace/dist/env-replace.js","../node_modules/@pnpm/config.env-replace/dist/index.js","../node_modules/@pnpm/npm-conf/lib/util.js","../node_modules/@pnpm/npm-conf/lib/types.js","../node_modules/@pnpm/npm-conf/lib/conf.js","../node_modules/@pnpm/npm-conf/lib/defaults.js","../node_modules/@pnpm/npm-conf/index.js","../node_modules/registry-auth-token/index.js","../node_modules/package-json/index.js","../node_modules/latest-version/index.js","../node_modules/is-npm/index.js","../node_modules/global-directory/node_modules/ini/lib/ini.js","../node_modules/global-directory/index.js","../node_modules/is-installed-globally/node_modules/is-path-inside/index.js","../node_modules/is-installed-globally/index.js","../node_modules/get-east-asian-width/lookup.js","../node_modules/get-east-asian-width/index.js","../node_modules/update-notifier/node_modules/emoji-regex/index.mjs","../node_modules/update-notifier/node_modules/string-width/index.js","../node_modules/update-notifier/node_modules/widest-line/index.js","../node_modules/cli-boxes/index.js","../node_modules/update-notifier/node_modules/camelcase/index.js","../node_modules/ansi-align/node_modules/ansi-regex/index.js","../node_modules/ansi-align/node_modules/strip-ansi/index.js","../node_modules/ansi-align/node_modules/emoji-regex/index.js","../node_modules/ansi-align/node_modules/string-width/index.js","../node_modules/ansi-align/index.js","../node_modules/update-notifier/node_modules/ansi-styles/index.js","../node_modules/update-notifier/node_modules/wrap-ansi/index.js","../node_modules/update-notifier/node_modules/boxen/index.js","../node_modules/is-in-ci/index.js","../node_modules/escape-goat/index.js","../node_modules/pupa/index.js","../node_modules/update-notifier/update-notifier.js","../node_modules/update-notifier/index.js"],"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 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","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","import os from 'os';\nimport path from 'path';\n\nconst homeDirectory = os.homedir();\nconst {env} = process;\n\nexport const xdgData = env.XDG_DATA_HOME ||\n\t(homeDirectory ? path.join(homeDirectory, '.local', 'share') : undefined);\n\nexport const xdgConfig = env.XDG_CONFIG_HOME ||\n\t(homeDirectory ? path.join(homeDirectory, '.config') : undefined);\n\nexport const xdgState = env.XDG_STATE_HOME ||\n\t(homeDirectory ? path.join(homeDirectory, '.local', 'state') : undefined);\n\nexport const xdgCache = env.XDG_CACHE_HOME || (homeDirectory ? path.join(homeDirectory, '.cache') : undefined);\n\nexport const xdgRuntime = env.XDG_RUNTIME_DIR || undefined;\n\nexport const xdgDataDirectories = (env.XDG_DATA_DIRS || '/usr/local/share/:/usr/share/').split(':');\n\nif (xdgData) {\n\txdgDataDirectories.unshift(xdgData);\n}\n\nexport const xdgConfigDirectories = (env.XDG_CONFIG_DIRS || '/etc/xdg').split(':');\n\nif (xdgConfig) {\n\txdgConfigDirectories.unshift(xdgConfig);\n}\n","/* MAIN */\n//FIXME: The return type of these functions is wrong, it doesn't account for returning \"undefined\", but a correct type cannot be written because generics cannot be extended properly, it seems\nconst attemptifyAsync = (fn, onError) => {\n return function attemptified(...args) {\n return fn.apply(undefined, args).catch(onError);\n };\n};\nconst attemptifySync = (fn, onError) => {\n return function attemptified(...args) {\n try {\n return fn.apply(undefined, args);\n }\n catch (error) {\n return onError(error);\n }\n };\n};\n/* EXPORT */\nexport { attemptifyAsync, attemptifySync };\n","/* IMPORT */\nimport process from 'node:process';\n/* MAIN */\nconst IS_USER_ROOT = process.getuid ? !process.getuid() : false;\nconst LIMIT_FILES_DESCRIPTORS = 10000; //TODO: Fetch the real limit from the filesystem, somehow\nconst NOOP = () => undefined;\n/* EXPORT */\nexport { IS_USER_ROOT, LIMIT_FILES_DESCRIPTORS, NOOP };\n","/* IMPORT */\nimport { IS_USER_ROOT } from './constants.js';\n/* MAIN */\nconst Handlers = {\n /* API */\n isChangeErrorOk: (error) => {\n if (!Handlers.isNodeError(error))\n return false;\n const { code } = error;\n if (code === 'ENOSYS')\n return true;\n if (!IS_USER_ROOT && (code === 'EINVAL' || code === 'EPERM'))\n return true;\n return false;\n },\n isNodeError: (error) => {\n return (error instanceof Error);\n },\n isRetriableError: (error) => {\n if (!Handlers.isNodeError(error))\n return false;\n const { code } = error;\n if (code === 'EMFILE' || code === 'ENFILE' || code === 'EAGAIN' || code === 'EBUSY' || code === 'EACCESS' || code === 'EACCES' || code === 'EACCS' || code === 'EPERM')\n return true;\n return false;\n },\n onChangeError: (error) => {\n if (!Handlers.isNodeError(error))\n throw error;\n if (Handlers.isChangeErrorOk(error))\n return;\n throw error;\n }\n};\n/* EXPORT */\nexport default Handlers;\n","/* IMPORT */\nimport { LIMIT_FILES_DESCRIPTORS } from './constants.js';\n/* MAIN */\nclass RetryfyQueue {\n constructor() {\n /* VARIABLES */\n this.interval = 25;\n this.intervalId = undefined;\n this.limit = LIMIT_FILES_DESCRIPTORS;\n this.queueActive = new Set();\n this.queueWaiting = new Set();\n /* LIFECYCLE API */\n this.init = () => {\n if (this.intervalId)\n return;\n this.intervalId = setInterval(this.tick, this.interval);\n };\n this.reset = () => {\n if (!this.intervalId)\n return;\n clearInterval(this.intervalId);\n delete this.intervalId;\n };\n /* API */\n this.add = (fn) => {\n this.queueWaiting.add(fn);\n if (this.queueActive.size < (this.limit / 2)) { // Active queue not under preassure, executing immediately\n this.tick();\n }\n else {\n this.init();\n }\n };\n this.remove = (fn) => {\n this.queueWaiting.delete(fn);\n this.queueActive.delete(fn);\n };\n this.schedule = () => {\n return new Promise(resolve => {\n const cleanup = () => this.remove(resolver);\n const resolver = () => resolve(cleanup);\n this.add(resolver);\n });\n };\n this.tick = () => {\n if (this.queueActive.size >= this.limit)\n return;\n if (!this.queueWaiting.size)\n return this.reset();\n for (const fn of this.queueWaiting) {\n if (this.queueActive.size >= this.limit)\n break;\n this.queueWaiting.delete(fn);\n this.queueActive.add(fn);\n fn();\n }\n };\n }\n}\n;\n/* EXPORT */\nexport default new RetryfyQueue();\n","/* IMPORT */\nimport RetryfyQueue from './retryify_queue.js';\n/* MAIN */\n//FIXME: There are a boatload of anys here, but apparently generics cannot be extended properly, so...\nconst retryifyAsync = (fn, isRetriableError) => {\n return function retrified(timestamp) {\n return function attempt(...args) {\n return RetryfyQueue.schedule().then(cleanup => {\n const onResolve = (result) => {\n cleanup();\n return result;\n };\n const onReject = (error) => {\n cleanup();\n if (Date.now() >= timestamp)\n throw error;\n if (isRetriableError(error)) {\n const delay = Math.round(100 * Math.random());\n const delayPromise = new Promise(resolve => setTimeout(resolve, delay));\n return delayPromise.then(() => attempt.apply(undefined, args));\n }\n throw error;\n };\n return fn.apply(undefined, args).then(onResolve, onReject);\n });\n };\n };\n};\nconst retryifySync = (fn, isRetriableError) => {\n return function retrified(timestamp) {\n return function attempt(...args) {\n try {\n return fn.apply(undefined, args);\n }\n catch (error) {\n if (Date.now() > timestamp)\n throw error;\n if (isRetriableError(error))\n return attempt.apply(undefined, args);\n throw error;\n }\n };\n };\n};\n/* EXPORT */\nexport { retryifyAsync, retryifySync };\n","/* IMPORT */\nimport fs from 'node:fs';\nimport { promisify } from 'node:util';\nimport { attemptifyAsync, attemptifySync } from './attemptify.js';\nimport { NOOP } from './constants.js';\nimport Handlers from './handlers.js';\nimport { retryifyAsync, retryifySync } from './retryify.js';\n/* MAIN */\nconst FS = {\n attempt: {\n /* ASYNC */\n chmod: attemptifyAsync(promisify(fs.chmod), Handlers.onChangeError),\n chown: attemptifyAsync(promisify(fs.chown), Handlers.onChangeError),\n close: attemptifyAsync(promisify(fs.close), NOOP),\n fsync: attemptifyAsync(promisify(fs.fsync), NOOP),\n mkdir: attemptifyAsync(promisify(fs.mkdir), NOOP),\n realpath: attemptifyAsync(promisify(fs.realpath), NOOP),\n stat: attemptifyAsync(promisify(fs.stat), NOOP),\n unlink: attemptifyAsync(promisify(fs.unlink), NOOP),\n /* SYNC */\n chmodSync: attemptifySync(fs.chmodSync, Handlers.onChangeError),\n chownSync: attemptifySync(fs.chownSync, Handlers.onChangeError),\n closeSync: attemptifySync(fs.closeSync, NOOP),\n existsSync: attemptifySync(fs.existsSync, NOOP),\n fsyncSync: attemptifySync(fs.fsync, NOOP),\n mkdirSync: attemptifySync(fs.mkdirSync, NOOP),\n realpathSync: attemptifySync(fs.realpathSync, NOOP),\n statSync: attemptifySync(fs.statSync, NOOP),\n unlinkSync: attemptifySync(fs.unlinkSync, NOOP)\n },\n retry: {\n /* ASYNC */\n close: retryifyAsync(promisify(fs.close), Handlers.isRetriableError),\n fsync: retryifyAsync(promisify(fs.fsync), Handlers.isRetriableError),\n open: retryifyAsync(promisify(fs.open), Handlers.isRetriableError),\n readFile: retryifyAsync(promisify(fs.readFile), Handlers.isRetriableError),\n rename: retryifyAsync(promisify(fs.rename), Handlers.isRetriableError),\n stat: retryifyAsync(promisify(fs.stat), Handlers.isRetriableError),\n write: retryifyAsync(promisify(fs.write), Handlers.isRetriableError),\n writeFile: retryifyAsync(promisify(fs.writeFile), Handlers.isRetriableError),\n /* SYNC */\n closeSync: retryifySync(fs.closeSync, Handlers.isRetriableError),\n fsyncSync: retryifySync(fs.fsyncSync, Handlers.isRetriableError),\n openSync: retryifySync(fs.openSync, Handlers.isRetriableError),\n readFileSync: retryifySync(fs.readFileSync, Handlers.isRetriableError),\n renameSync: retryifySync(fs.renameSync, Handlers.isRetriableError),\n statSync: retryifySync(fs.statSync, Handlers.isRetriableError),\n writeSync: retryifySync(fs.writeSync, Handlers.isRetriableError),\n writeFileSync: retryifySync(fs.writeFileSync, Handlers.isRetriableError)\n }\n};\n/* EXPORT */\nexport default FS;\n","/* IMPORT */\nimport os from 'node:os';\nimport process from 'node:process';\n/* MAIN */\nconst DEFAULT_ENCODING = 'utf8';\nconst DEFAULT_FILE_MODE = 0o666;\nconst DEFAULT_FOLDER_MODE = 0o777;\nconst DEFAULT_READ_OPTIONS = {};\nconst DEFAULT_WRITE_OPTIONS = {};\nconst DEFAULT_USER_UID = os.userInfo().uid;\nconst DEFAULT_USER_GID = os.userInfo().gid;\nconst DEFAULT_TIMEOUT_ASYNC = 7500;\nconst DEFAULT_TIMEOUT_SYNC = 1000;\nconst IS_POSIX = !!process.getuid;\nconst IS_USER_ROOT = process.getuid ? !process.getuid() : false;\nconst LIMIT_BASENAME_LENGTH = 128; //TODO: Fetch the real limit from the filesystem //TODO: Fetch the whole-path length limit too\nconst LIMIT_FILES_DESCRIPTORS = 10000; //TODO: Fetch the real limit from the filesystem\nconst NOOP = () => { };\n/* EXPORT */\nexport { DEFAULT_ENCODING, DEFAULT_FILE_MODE, DEFAULT_FOLDER_MODE, DEFAULT_READ_OPTIONS, DEFAULT_WRITE_OPTIONS, DEFAULT_USER_UID, DEFAULT_USER_GID, DEFAULT_TIMEOUT_ASYNC, DEFAULT_TIMEOUT_SYNC, IS_POSIX, IS_USER_ROOT, LIMIT_BASENAME_LENGTH, LIMIT_FILES_DESCRIPTORS, NOOP };\n","/* IMPORT */\n/* MAIN */\nconst isException = (value) => {\n return (value instanceof Error) && ('code' in value);\n};\nconst isFunction = (value) => {\n return (typeof value === 'function');\n};\nconst isString = (value) => {\n return (typeof value === 'string');\n};\nconst isUndefined = (value) => {\n return (value === undefined);\n};\n/* EXPORT */\nexport { isException, isFunction, isString, isUndefined };\n","/* IMPORT */\nimport process from 'node:process';\n/* MAIN */\nconst IS_LINUX = (process.platform === 'linux');\nconst IS_WINDOWS = (process.platform === 'win32');\n/* EXPORT */\nexport { IS_LINUX, IS_WINDOWS };\n","/* IMPORT */\nimport { IS_LINUX, IS_WINDOWS } from './constants.js';\n/* MAIN */\n//URL: https://github.com/tapjs/signal-exit/blob/03dd77a96caa309c6a02c59274d58c812a2dce45/signals.js\nconst Signals = ['SIGABRT', 'SIGALRM', 'SIGHUP', 'SIGINT', 'SIGTERM'];\nif (!IS_WINDOWS) {\n Signals.push('SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT');\n}\nif (IS_LINUX) {\n Signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT', 'SIGUNUSED');\n}\n/* EXPORT */\nexport default Signals;\n","/* IMPORT */\nimport process from 'node:process';\nimport { IS_WINDOWS } from './constants.js';\nimport Signals from './signals.js';\n/* MAIN */\nclass Interceptor {\n /* CONSTRUCTOR */\n constructor() {\n /* VARIABLES */\n this.callbacks = new Set();\n this.exited = false;\n /* API */\n this.exit = (signal) => {\n if (this.exited)\n return;\n this.exited = true;\n for (const callback of this.callbacks) {\n callback();\n }\n if (signal) {\n if (IS_WINDOWS && (signal !== 'SIGINT' && signal !== 'SIGTERM' && signal !== 'SIGKILL')) { // Windows doesn't support POSIX signals, but Node emulates these 3 signals for us\n process.kill(process.pid, 'SIGTERM');\n }\n else {\n process.kill(process.pid, signal);\n }\n }\n };\n this.hook = () => {\n process.once('exit', () => this.exit());\n for (const signal of Signals) {\n try {\n process.once(signal, () => this.exit(signal));\n }\n catch {\n // Sometimes \"process.once\" can throw...\n }\n }\n };\n this.register = (callback) => {\n this.callbacks.add(callback);\n return () => {\n this.callbacks.delete(callback);\n };\n };\n this.hook();\n }\n}\n/* EXPORT */\nexport default new Interceptor();\n","/* IMPORT */\nimport Interceptor from './interceptor.js';\n/* MAIN */\nconst whenExit = Interceptor.register;\n/* EXPORT */\nexport default whenExit;\n","/* IMPORT */\nimport path from 'node:path';\nimport fs from 'stubborn-fs';\nimport whenExit from 'when-exit';\nimport { LIMIT_BASENAME_LENGTH } from '../constants.js';\n/* MAIN */\n//TODO: Maybe publish this as a standalone package\nconst Temp = {\n /* VARIABLES */\n store: {},\n /* API */\n create: (filePath) => {\n const randomness = `000000${Math.floor(Math.random() * 16777215).toString(16)}`.slice(-6); // 6 random-enough hex characters\n const timestamp = Date.now().toString().slice(-10); // 10 precise timestamp digits\n const prefix = 'tmp-';\n const suffix = `.${prefix}${timestamp}${randomness}`;\n const tempPath = `${filePath}${suffix}`;\n return tempPath;\n },\n get: (filePath, creator, purge = true) => {\n const tempPath = Temp.truncate(creator(filePath));\n if (tempPath in Temp.store)\n return Temp.get(filePath, creator, purge); // Collision found, try again\n Temp.store[tempPath] = purge;\n const disposer = () => delete Temp.store[tempPath];\n return [tempPath, disposer];\n },\n purge: (filePath) => {\n if (!Temp.store[filePath])\n return;\n delete Temp.store[filePath];\n fs.attempt.unlink(filePath);\n },\n purgeSync: (filePath) => {\n if (!Temp.store[filePath])\n return;\n delete Temp.store[filePath];\n fs.attempt.unlinkSync(filePath);\n },\n purgeSyncAll: () => {\n for (const filePath in Temp.store) {\n Temp.purgeSync(filePath);\n }\n },\n truncate: (filePath) => {\n const basename = path.basename(filePath);\n if (basename.length <= LIMIT_BASENAME_LENGTH)\n return filePath; //FIXME: Rough and quick attempt at detecting ok lengths\n const truncable = /^(\\.?)(.*?)((?:\\.[^.]+)?(?:\\.tmp-\\d{10}[a-f0-9]{6})?)$/.exec(basename);\n if (!truncable)\n return filePath; //FIXME: No truncable part detected, can't really do much without also changing the parent path, which is unsafe, hoping for the best here\n const truncationLength = basename.length - LIMIT_BASENAME_LENGTH;\n return `${filePath.slice(0, -basename.length)}${truncable[1]}${truncable[2].slice(0, -truncationLength)}${truncable[3]}`; //FIXME: The truncable part might be shorter than needed here\n }\n};\n/* INIT */\nwhenExit(Temp.purgeSyncAll); // Ensuring purgeable temp files are purged on exit\n/* EXPORT */\nexport default Temp;\n","/* IMPORT */\nimport path from 'node:path';\nimport fs from 'stubborn-fs';\nimport { DEFAULT_ENCODING, DEFAULT_FILE_MODE, DEFAULT_FOLDER_MODE, DEFAULT_READ_OPTIONS, DEFAULT_WRITE_OPTIONS, DEFAULT_USER_UID, DEFAULT_USER_GID, DEFAULT_TIMEOUT_ASYNC, DEFAULT_TIMEOUT_SYNC, IS_POSIX } from './constants.js';\nimport { isException, isFunction, isString, isUndefined } from './utils/lang.js';\nimport Scheduler from './utils/scheduler.js';\nimport Temp from './utils/temp.js';\nfunction readFile(filePath, options = DEFAULT_READ_OPTIONS) {\n if (isString(options))\n return readFile(filePath, { encoding: options });\n const timeout = Date.now() + ((options.timeout ?? DEFAULT_TIMEOUT_ASYNC) || -1);\n return fs.retry.readFile(timeout)(filePath, options);\n}\nfunction readFileSync(filePath, options = DEFAULT_READ_OPTIONS) {\n if (isString(options))\n return readFileSync(filePath, { encoding: options });\n const timeout = Date.now() + ((options.timeout ?? DEFAULT_TIMEOUT_SYNC) || -1);\n return fs.retry.readFileSync(timeout)(filePath, options);\n}\nfunction writeFile(filePath, data, options, callback) {\n if (isFunction(options))\n return writeFile(filePath, data, DEFAULT_WRITE_OPTIONS, options);\n const promise = writeFileAsync(filePath, data, options);\n if (callback)\n promise.then(callback, callback);\n return promise;\n}\nasync function writeFileAsync(filePath, data, options = DEFAULT_WRITE_OPTIONS) {\n if (isString(options))\n return writeFileAsync(filePath, data, { encoding: options });\n const timeout = Date.now() + ((options.timeout ?? DEFAULT_TIMEOUT_ASYNC) || -1);\n let schedulerCustomDisposer = null;\n let schedulerDisposer = null;\n let tempDisposer = null;\n let tempPath = null;\n let fd = null;\n try {\n if (options.schedule)\n schedulerCustomDisposer = await options.schedule(filePath);\n schedulerDisposer = await Scheduler.schedule(filePath);\n const filePathReal = await fs.attempt.realpath(filePath);\n const filePathExists = !!filePathReal;\n filePath = filePathReal || filePath;\n [tempPath, tempDisposer] = Temp.get(filePath, options.tmpCreate || Temp.create, !(options.tmpPurge === false));\n const useStatChown = IS_POSIX && isUndefined(options.chown);\n const useStatMode = isUndefined(options.mode);\n if (filePathExists && (useStatChown || useStatMode)) {\n const stats = await fs.attempt.stat(filePath);\n