diff -Nru node-mock-fs-5.1.2/benchmarks/read-integration-mock.js node-mock-fs-5.1.4/benchmarks/read-integration-mock.js --- node-mock-fs-5.1.2/benchmarks/read-integration-mock.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/benchmarks/read-integration-mock.js 2022-08-04 03:14:53.000000000 +0000 @@ -8,12 +8,12 @@ * test time. * @param {function(Error)} done Callback. */ -exports.test = function(done) { +exports.test = function (done) { mock({ - 'foo-mock.txt': 'foo' + 'foo-mock.txt': 'foo', }); - fs.readFile('foo-mock.txt', 'utf8', function(err, str) { + fs.readFile('foo-mock.txt', 'utf8', function (err, str) { assert.ifError(err); assert.equal(str, 'foo'); diff -Nru node-mock-fs-5.1.2/benchmarks/read-integration-real.js node-mock-fs-5.1.4/benchmarks/read-integration-real.js --- node-mock-fs-5.1.2/benchmarks/read-integration-real.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/benchmarks/read-integration-real.js 2022-08-04 03:14:53.000000000 +0000 @@ -11,13 +11,13 @@ * test time. * @param {function(Error)} done Callback. */ -exports.test = function(done) { - fs.mkdir(tmpPath, function(mkdirErr) { +exports.test = function (done) { + fs.mkdir(tmpPath, function (mkdirErr) { assert.ifError(mkdirErr); const tmpFile = path.join(tmpPath, 'foo-real.txt'); - fs.writeFile(tmpFile, 'foo', function(writeErr) { + fs.writeFile(tmpFile, 'foo', function (writeErr) { assert.ifError(writeErr); - fs.readFile(tmpFile, 'utf8', function(readErr, str) { + fs.readFile(tmpFile, 'utf8', function (readErr, str) { assert.ifError(readErr); assert.equal(str, 'foo'); rimraf(tmpPath, done); diff -Nru node-mock-fs-5.1.2/benchmarks/read-mock.js node-mock-fs-5.1.4/benchmarks/read-mock.js --- node-mock-fs-5.1.2/benchmarks/read-mock.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/benchmarks/read-mock.js 2022-08-04 03:14:53.000000000 +0000 @@ -6,9 +6,9 @@ /** * Test setup. Not timed. */ -exports.beforeEach = function() { +exports.beforeEach = function () { mock({ - 'foo-mock.txt': 'foo' + 'foo-mock.txt': 'foo', }); }; @@ -16,8 +16,8 @@ * Timed test. * @param {function(Error)} done Callback. */ -exports.test = function(done) { - fs.readFile('foo-mock.txt', 'utf8', function(err, str) { +exports.test = function (done) { + fs.readFile('foo-mock.txt', 'utf8', function (err, str) { assert.ifError(err); assert.equal(str, 'foo'); done(); @@ -27,6 +27,6 @@ /** * Test teardown. Not timed. */ -exports.afterEach = function() { +exports.afterEach = function () { mock.restore(); }; diff -Nru node-mock-fs-5.1.2/benchmarks/read-real.js node-mock-fs-5.1.4/benchmarks/read-real.js --- node-mock-fs-5.1.2/benchmarks/read-real.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/benchmarks/read-real.js 2022-08-04 03:14:53.000000000 +0000 @@ -10,8 +10,8 @@ * Test setup. Not timed. * @param {function(Error)} done Callback. */ -exports.beforeEach = function(done) { - fs.mkdir(tmpPath, function(err) { +exports.beforeEach = function (done) { + fs.mkdir(tmpPath, function (err) { if (err) { return done(err); } @@ -23,8 +23,8 @@ * Timed test. * @param {function(Error)} done Callback. */ -exports.test = function(done) { - fs.readFile(path.join(tmpPath, 'foo-real.txt'), 'utf8', function(err, str) { +exports.test = function (done) { + fs.readFile(path.join(tmpPath, 'foo-real.txt'), 'utf8', function (err, str) { assert.ifError(err); assert.equal(str, 'foo'); done(); @@ -35,6 +35,6 @@ * Test teardown. Not timed. * @param {function(Error)} done Callback. */ -exports.afterEach = function(done) { +exports.afterEach = function (done) { rimraf(tmpPath, done); }; diff -Nru node-mock-fs-5.1.2/benchmarks/write-integration-mock.js node-mock-fs-5.1.4/benchmarks/write-integration-mock.js --- node-mock-fs-5.1.2/benchmarks/write-integration-mock.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/benchmarks/write-integration-mock.js 2022-08-04 03:14:53.000000000 +0000 @@ -8,10 +8,10 @@ * test time. * @param {function(Error)} done Callback. */ -exports.test = function(done) { +exports.test = function (done) { mock(); - fs.writeFile('foo-mock.txt', 'foo', function(err) { + fs.writeFile('foo-mock.txt', 'foo', function (err) { assert.ifError(err); mock.restore(); diff -Nru node-mock-fs-5.1.2/benchmarks/write-integration-real.js node-mock-fs-5.1.4/benchmarks/write-integration-real.js --- node-mock-fs-5.1.2/benchmarks/write-integration-real.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/benchmarks/write-integration-real.js 2022-08-04 03:14:53.000000000 +0000 @@ -11,10 +11,10 @@ * test time. * @param {function(Error)} done Callback. */ -exports.test = function(done) { - fs.mkdir(tmpPath, function(mkdirErr) { +exports.test = function (done) { + fs.mkdir(tmpPath, function (mkdirErr) { assert.ifError(mkdirErr); - fs.writeFile(path.join(tmpPath, 'foo-real.txt'), 'foo', function(err) { + fs.writeFile(path.join(tmpPath, 'foo-real.txt'), 'foo', function (err) { assert.ifError(err); rimraf(tmpPath, done); }); diff -Nru node-mock-fs-5.1.2/benchmarks/write-mock.js node-mock-fs-5.1.4/benchmarks/write-mock.js --- node-mock-fs-5.1.2/benchmarks/write-mock.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/benchmarks/write-mock.js 2022-08-04 03:14:53.000000000 +0000 @@ -5,7 +5,7 @@ /** * Test setup. Not timed. */ -exports.beforeEach = function() { +exports.beforeEach = function () { mock(); }; @@ -13,13 +13,13 @@ * Timed test. * @param {function(Error)} done Callback. */ -exports.test = function(done) { +exports.test = function (done) { fs.writeFile('foo-mock.txt', 'foo', done); }; /** * Test teardown. Not timed. */ -exports.afterEach = function() { +exports.afterEach = function () { mock.restore(); }; diff -Nru node-mock-fs-5.1.2/benchmarks/write-real.js node-mock-fs-5.1.4/benchmarks/write-real.js --- node-mock-fs-5.1.2/benchmarks/write-real.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/benchmarks/write-real.js 2022-08-04 03:14:53.000000000 +0000 @@ -9,7 +9,7 @@ * Test setup. Not timed. * @param {function(Error)} done Callback. */ -exports.beforeEach = function(done) { +exports.beforeEach = function (done) { fs.mkdir(tmpPath, done); }; @@ -17,7 +17,7 @@ * Timed test. * @param {function(Error)} done Callback. */ -exports.test = function(done) { +exports.test = function (done) { fs.writeFile(path.join(tmpPath, 'foo-real.txt'), 'foo', done); }; @@ -25,6 +25,6 @@ * Test teardown. Not timed. * @param {function(Error)} done Callback. */ -exports.afterEach = function(done) { +exports.afterEach = function (done) { rimraf(tmpPath, done); }; diff -Nru node-mock-fs-5.1.2/changelog.md node-mock-fs-5.1.4/changelog.md --- node-mock-fs-5.1.2/changelog.md 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/changelog.md 2022-08-04 03:14:53.000000000 +0000 @@ -1,5 +1,13 @@ # Change Log +## 5.1.4 + + * Fix for BigInt stats in Node 16.7 (thanks @ahippler, see [#363][#363]) + +## 5.1.3 + + * Fix for BigInt stats in Node 18.7 (thanks @3cp, see [#361][#361]) + ## 5.1.2 * Avoid open `FSREQCALLBACK` file handles (thanks @jloleysens, see [#342][#342]) @@ -334,3 +342,5 @@ [#335]: https://github.com/tschaub/mock-fs/pull/335 [#337]: https://github.com/tschaub/mock-fs/pull/337 [#342]: https://github.com/tschaub/mock-fs/pull/342 +[#361]: https://github.com/tschaub/mock-fs/pull/361 +[#363]: https://github.com/tschaub/mock-fs/pull/363 diff -Nru node-mock-fs-5.1.2/debian/changelog node-mock-fs-5.1.4/debian/changelog --- node-mock-fs-5.1.2/debian/changelog 2021-11-18 23:20:55.000000000 +0000 +++ node-mock-fs-5.1.4/debian/changelog 2022-08-14 07:01:31.000000000 +0000 @@ -1,3 +1,21 @@ +node-mock-fs (5.1.4-1) unstable; urgency=medium + + [ upstream ] + * new release(s) + + [ Jonas Smedegaard ] + * declare compliance with Debian Policy 4.6.1 + * update git-buildpackage config: + + use DEP-14 git branches + + enable automatic DEP-14 branch name handling + + add usage config + * fix lintian overrides + * update copyright info: update coverage + * generate documentation with cmark-gfm (not pandoc); + build-depend on cmark-gfm (not pandoc) + + -- Jonas Smedegaard Sun, 14 Aug 2022 09:01:31 +0200 + node-mock-fs (5.1.2-1) unstable; urgency=medium [ upstream ] diff -Nru node-mock-fs-5.1.2/debian/control node-mock-fs-5.1.4/debian/control --- node-mock-fs-5.1.2/debian/control 2021-11-18 23:16:37.000000000 +0000 +++ node-mock-fs-5.1.4/debian/control 2022-08-14 06:59:02.000000000 +0000 @@ -5,12 +5,12 @@ Uploaders: Jonas Smedegaard , Build-Depends: + cmark-gfm , debhelper-compat (= 13), mocha , node-chai , node-semver , - pandoc , -Standards-Version: 4.6.0 +Standards-Version: 4.6.1 Homepage: https://github.com/tschaub/mock-fs Vcs-Browser: https://salsa.debian.org/js-team/node-mock-fs Vcs-Git: https://salsa.debian.org/js-team/node-mock-fs.git diff -Nru node-mock-fs-5.1.2/debian/copyright node-mock-fs-5.1.4/debian/copyright --- node-mock-fs-5.1.2/debian/copyright 2021-11-18 23:19:28.000000000 +0000 +++ node-mock-fs-5.1.4/debian/copyright 2022-08-14 06:55:57.000000000 +0000 @@ -12,7 +12,7 @@ Files: debian/* Copyright: - 2019-2021 Jonas Smedegaard + 2019-2022 Jonas Smedegaard License-Grant: This packaging is free software; you can redistribute it and/or modify it diff -Nru node-mock-fs-5.1.2/debian/copyright_hints node-mock-fs-5.1.4/debian/copyright_hints --- node-mock-fs-5.1.2/debian/copyright_hints 2021-11-18 23:20:39.000000000 +0000 +++ node-mock-fs-5.1.4/debian/copyright_hints 2022-08-14 06:55:39.000000000 +0000 @@ -22,6 +22,7 @@ debian/patches/series debian/rules debian/source/format + debian/source/lintian-overrides debian/tests/control debian/watch lib/binding.js @@ -78,7 +79,7 @@ test/lib/fs.writeFile.spec.js test/lib/index.spec.js test/lib/item.spec.js - test/lib/readfilecontext.js + test/lib/readfilecontext.spec.js Copyright: NONE License: UNKNOWN FIXME @@ -95,9 +96,3 @@ License: Expat FIXME -Files: debian/source/lintian-overrides -Copyright: debian/copyright GPL-3+ - debian/copyright gpl-3+ -License: UNKNOWN - FIXME - diff -Nru node-mock-fs-5.1.2/debian/gbp.conf node-mock-fs-5.1.4/debian/gbp.conf --- node-mock-fs-5.1.2/debian/gbp.conf 2019-10-16 09:14:53.000000000 +0000 +++ node-mock-fs-5.1.4/debian/gbp.conf 2022-04-27 06:23:42.000000000 +0000 @@ -1,7 +1,15 @@ -# Configuration file for git-buildpackage and friends +# clone this source: gbp clone $PKG_GIT_URL +# track upstream source: git remote add upstream-git $UPSTREAM_GIT_URL +# update this source: gbp pull +# update upstream source: git fetch upstream-git --tags +# import upstream release: gbp import-orig --upstream-vcs-tag=$VERSION --uscan +# build package: gbp buildpackage +# publish source release: gbp tag && gbp push [DEFAULT] pristine-tar = True sign-tags = True filter = */.git* -debian-branch = debian/master +debian-branch = debian/latest +upstream-branch = upstream/latest +dist = DEP14 diff -Nru node-mock-fs-5.1.2/debian/rules node-mock-fs-5.1.4/debian/rules --- node-mock-fs-5.1.2/debian/rules 2020-04-23 00:43:41.000000000 +0000 +++ node-mock-fs-5.1.4/debian/rules 2022-08-14 06:58:46.000000000 +0000 @@ -13,6 +13,15 @@ MOCHA = mocha --reporter dot --no-colors endif +%: + dh $@ + +%.html: %.md + cmark-gfm $< > $@ + +%.txt: %.md + cmark-gfm --to plaintext $< > $@ + override_dh_auto_build: $(DOCS) $(CHANGELOGS) override_dh_auto_test: @@ -26,12 +35,3 @@ override_dh_clean: dh_clean -- $(DOCS) $(CHANGELOGS) - -%.html: %.md - pandoc --from gfm-raw_html --to html --standalone --output $@ $< - -%.txt: %.md - pandoc --from gfm-raw_html --to plain --output $@ $< - -%: - dh $@ diff -Nru node-mock-fs-5.1.2/debian/source/lintian-overrides node-mock-fs-5.1.4/debian/source/lintian-overrides --- node-mock-fs-5.1.2/debian/source/lintian-overrides 2021-11-18 23:18:53.000000000 +0000 +++ node-mock-fs-5.1.4/debian/source/lintian-overrides 2022-08-14 06:55:29.000000000 +0000 @@ -1,3 +1,3 @@ # License is in Reference field (see bug#786450) -missing-license-paragraph-in-dep5-copyright debian/copyright gpl-3\+ * -missing-license-text-in-dep5-copyright debian/copyright GPL-3\+ * +missing-license-paragraph-in-dep5-copyright gpl-3\+ * +missing-license-text-in-dep5-copyright GPL-3\+ * diff -Nru node-mock-fs-5.1.2/.github/workflows/publish.yml node-mock-fs-5.1.4/.github/workflows/publish.yml --- node-mock-fs-5.1.2/.github/workflows/publish.yml 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/.github/workflows/publish.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -name: Publish - -on: - push: - branches: - - main - -jobs: - publish-npm: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: '16' - registry-url: 'https://registry.npmjs.org' - - name: Install dependencies - run: npm ci - - name: Publish - run: | - VERSION=$(node tasks/next-dev-version.js) - npm --no-git-tag-version version ${VERSION} - npm publish --tag dev - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff -Nru node-mock-fs-5.1.2/.github/workflows/test.yml node-mock-fs-5.1.4/.github/workflows/test.yml --- node-mock-fs-5.1.2/.github/workflows/test.yml 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/.github/workflows/test.yml 2022-08-04 03:14:53.000000000 +0000 @@ -27,6 +27,7 @@ - 12 - 14 - 16 + - 18 steps: - name: Clone repository diff -Nru node-mock-fs-5.1.2/lib/binding.js node-mock-fs-5.1.4/lib/binding.js --- node-mock-fs-5.1.2/lib/binding.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/lib/binding.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,14 +1,13 @@ 'use strict'; const path = require('path'); - -const File = require('./file'); -const FileDescriptor = require('./descriptor'); -const Directory = require('./directory'); -const SymbolicLink = require('./symlink'); -const {FSError} = require('./error'); +const File = require('./file.js'); +const FileDescriptor = require('./descriptor.js'); +const Directory = require('./directory.js'); +const SymbolicLink = require('./symlink.js'); +const {FSError} = require('./error.js'); const constants = require('constants'); -const getPathParts = require('./filesystem').getPathParts; +const getPathParts = require('./filesystem.js').getPathParts; const MODE_TO_KTYPE = { [constants.S_IFREG]: constants.UV_DIRENT_FILE, @@ -17,7 +16,7 @@ [constants.S_IFCHR]: constants.UV_DIRENT_CHAR, [constants.S_IFLNK]: constants.UV_DIRENT_LINK, [constants.S_IFIFO]: constants.UV_DIRENT_FIFO, - [constants.S_IFSOCK]: constants.UV_DIRENT_SOCKET + [constants.S_IFSOCK]: constants.UV_DIRENT_SOCKET, }; /** Workaround for optimizations in node 8+ */ @@ -36,8 +35,8 @@ * Call the provided function and either return the result or call the callback * with it (depending on if a callback is provided). * @param {function()} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. - * @param {Object} thisArg This argument for the following function. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @param {object} thisArg This argument for the following function. * @param {function()} func Function to call. * @return {*} Return (if callback is not provided). */ @@ -52,8 +51,8 @@ } catch (e) { err = e; } - return new Promise(function(resolve, reject) { - process.nextTick(function() { + return new Promise(function (resolve, reject) { + process.nextTick(function () { if (err) { reject(err); } else { @@ -67,7 +66,7 @@ } catch (e) { err = e; } - process.nextTick(function() { + process.nextTick(function () { if (val === undefined) { callback(err); } else { @@ -89,8 +88,8 @@ /** * set syscall property on context object, only for nodejs v10+. - * @param {Object} ctx Context object (optional), only for nodejs v10+. - * @param {String} syscall Name of syscall. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @param {string} syscall Name of syscall. */ function markSyscall(ctx, syscall) { if (ctx && typeof ctx === 'object') { @@ -132,7 +131,7 @@ /** * Create a new binding with the given file system. * @param {FileSystem} system Mock file system. - * @constructor + * @class */ function Binding(system) { /** @@ -143,7 +142,7 @@ /** * Lookup of open files. - * @type {Object.} + * @type {Object} */ this._openFiles = {}; @@ -170,7 +169,7 @@ * Get the file system underlying this binding. * @return {FileSystem} The underlying file system. */ -Binding.prototype.getSystem = function() { +Binding.prototype.getSystem = function () { return this._system; }; @@ -178,7 +177,7 @@ * Reset the file system underlying this binding. * @param {FileSystem} system The new file system. */ -Binding.prototype.setSystem = function(system) { +Binding.prototype.setSystem = function (system) { this._system = system; }; @@ -187,7 +186,7 @@ * @param {number} fd File descriptor identifier. * @return {FileDescriptor} File descriptor. */ -Binding.prototype.getDescriptorById = function(fd) { +Binding.prototype.getDescriptorById = function (fd) { if (!this._openFiles.hasOwnProperty(fd)) { throw new FSError('EBADF'); } @@ -199,7 +198,7 @@ * @param {FileDescriptor} descriptor The file descriptor. * @return {number} Identifier for file descriptor. */ -Binding.prototype.trackDescriptor = function(descriptor) { +Binding.prototype.trackDescriptor = function (descriptor) { const fd = ++this._counter; this._openFiles[fd] = descriptor; return fd; @@ -209,7 +208,7 @@ * Stop tracking a file descriptor as open. * @param {number} fd Identifier for file descriptor. */ -Binding.prototype.untrackDescriptorById = function(fd) { +Binding.prototype.untrackDescriptorById = function (fd) { if (!this._openFiles.hasOwnProperty(fd)) { throw new FSError('EBADF'); } @@ -220,13 +219,14 @@ * Resolve the canonicalized absolute pathname. * @param {string|Buffer} filepath The file path. * @param {string} encoding The encoding for the return. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {Function} callback The callback. + * @param {object} ctx Context object (optional), only for nodejs v10+. * @return {string|Buffer} The real path. */ -Binding.prototype.realpath = function(filepath, encoding, callback, ctx) { +Binding.prototype.realpath = function (filepath, encoding, callback, ctx) { markSyscall(ctx, 'realpath'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { let realPath; filepath = deBuffer(filepath); const resolved = path.resolve(filepath); @@ -273,8 +273,8 @@ }); }; -function fillStats(stats) { - const target = stats instanceof Float64Array ? statValues : bigintStatValues; +function fillStats(stats, bigint) { + const target = bigint ? bigintStatValues : statValues; for (let i = 0; i < 36; i++) { target[i] = stats[i]; } @@ -283,14 +283,15 @@ /** * Stat an item. * @param {string} filepath Path. + * @param {boolean} bigint Use BigInt. * @param {function(Error, Float64Array|BigUint64Array)} callback Callback (optional). - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. * @return {Float64Array|BigUint64Array|undefined} Stats or undefined (if sync). */ -Binding.prototype.stat = function(filepath, bigint, callback, ctx) { +Binding.prototype.stat = function (filepath, bigint, callback, ctx) { markSyscall(ctx, 'stat'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { filepath = deBuffer(filepath); let item = this._system.getItem(filepath); if (item instanceof SymbolicLink) { @@ -302,7 +303,7 @@ throw new FSError('ENOENT', filepath); } const stats = item.getStats(bigint); - fillStats(stats); + fillStats(stats, bigint); return stats; }); }; @@ -310,18 +311,19 @@ /** * Stat an item. * @param {number} fd File descriptor. + * @param {boolean} bigint Use BigInt. * @param {function(Error, Float64Array|BigUint64Array)} callback Callback (optional). - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. * @return {Float64Array|BigUint64Array|undefined} Stats or undefined (if sync). */ -Binding.prototype.fstat = function(fd, bigint, callback, ctx) { +Binding.prototype.fstat = function (fd, bigint, callback, ctx) { markSyscall(ctx, 'fstat'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { const descriptor = this.getDescriptorById(fd); const item = descriptor.getItem(); const stats = item.getStats(bigint); - fillStats(stats); + fillStats(stats, bigint); return stats; }); }; @@ -330,12 +332,13 @@ * Close a file descriptor. * @param {number} fd File descriptor. * @param {function(Error)} callback Callback (optional). - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback. */ -Binding.prototype.close = function(fd, callback, ctx) { +Binding.prototype.close = function (fd, callback, ctx) { markSyscall(ctx, 'close'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { this.untrackDescriptorById(fd); }); }; @@ -346,13 +349,13 @@ * @param {number} flags Flags. * @param {number} mode Mode. * @param {function(Error, string)} callback Callback (optional). - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. * @return {string} File descriptor (if sync). */ -Binding.prototype.open = function(pathname, flags, mode, callback, ctx) { +Binding.prototype.open = function (pathname, flags, mode, callback, ctx) { markSyscall(ctx, 'open'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { pathname = deBuffer(pathname); const descriptor = new FileDescriptor(flags); let item = this._system.getItem(pathname); @@ -414,19 +417,20 @@ * @param {string} pathname File path. * @param {number} flags Flags. * @param {number} mode Mode. - * @param {function} callback Callback (optional), expecting kUsePromises in nodejs v10+. + * @param {Function} callback Callback (optional), expecting kUsePromises in nodejs v10+. + * @return {string} The file handle. */ -Binding.prototype.openFileHandle = function(pathname, flags, mode, callback) { +Binding.prototype.openFileHandle = function (pathname, flags, mode, callback) { const self = this; - return this.open(pathname, flags, mode, kUsePromises).then(function(fd) { + return this.open(pathname, flags, mode, kUsePromises).then(function (fd) { // nodejs v10+ fs.promises FileHandler constructor only ask these three properties. return { getAsyncId: notImplemented, fd: fd, - close: function() { + close: function () { return self.close(fd, kUsePromises); - } + }, }; }); }; @@ -441,10 +445,10 @@ * data will be read from the current file position. * @param {function(Error, number, Buffer)} callback Callback (optional) called * with any error, number of bytes read, and the buffer. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. * @return {number} Number of bytes read (if sync). */ -Binding.prototype.read = function( +Binding.prototype.read = function ( fd, buffer, offset, @@ -455,7 +459,7 @@ ) { markSyscall(ctx, 'read'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { const descriptor = this.getDescriptorById(fd); if (!descriptor.isRead()) { throw new FSError('EBADF'); @@ -487,12 +491,13 @@ * @param {number} flags Modifiers for copy operation. * @param {function(Error)} callback Callback (optional) called * with any error. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.copyFile = function(src, dest, flags, callback, ctx) { +Binding.prototype.copyFile = function (src, dest, flags, callback, ctx) { markSyscall(ctx, 'copyfile'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { src = deBuffer(src); dest = deBuffer(dest); const srcFd = this.open(src, constants.O_RDONLY); @@ -536,10 +541,10 @@ * data will be written to the current file position. * @param {function(Error, number, Buffer)} callback Callback (optional) called * with any error, number of bytes written, and the buffer. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. * @return {number} Number of bytes written (if sync). */ -Binding.prototype.writeBuffers = function( +Binding.prototype.writeBuffers = function ( fd, buffers, position, @@ -548,7 +553,7 @@ ) { markSyscall(ctx, 'write'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { const descriptor = this.getDescriptorById(fd); if (!descriptor.isWrite()) { throw new FSError('EBADF'); @@ -586,10 +591,10 @@ * data will be written to the current file position. * @param {function(Error, number, Buffer)} callback Callback (optional) called * with any error, number of bytes written, and the buffer. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. * @return {number} Number of bytes written (if sync). */ -Binding.prototype.writeBuffer = function( +Binding.prototype.writeBuffer = function ( fd, buffer, offset, @@ -600,7 +605,7 @@ ) { markSyscall(ctx, 'write'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { const descriptor = this.getDescriptorById(fd); if (!descriptor.isWrite()) { throw new FSError('EBADF'); @@ -642,9 +647,10 @@ * @param {string} encoding String encoding. * @param {function(Error, number, string)} callback Callback (optional) called * with any error, number of bytes written, and the string. + * @param {object} ctx The context. * @return {number} Number of bytes written (if sync). */ -Binding.prototype.writeString = function( +Binding.prototype.writeString = function ( fd, string, position, @@ -660,7 +666,7 @@ if (callback.oncomplete) { callback = callback.oncomplete.bind(callback); } - wrapper = function(err, written, returned) { + wrapper = function (err, written, returned) { callback(err, written, returned && string); }; } @@ -672,13 +678,13 @@ * @param {string} oldPath Old pathname. * @param {string} newPath New pathname. * @param {function(Error)} callback Callback (optional). - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. * @return {undefined} */ -Binding.prototype.rename = function(oldPath, newPath, callback, ctx) { +Binding.prototype.rename = function (oldPath, newPath, callback, ctx) { markSyscall(ctx, 'rename'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { oldPath = deBuffer(oldPath); newPath = deBuffer(newPath); const oldItem = this._system.getItem(oldPath); @@ -725,10 +731,10 @@ * @param {boolean} withFileTypes whether or not to return fs.Dirent objects * @param {function(Error, (Array.|Array.)} callback Callback * (optional) called with any error or array of items in the directory. - * @param {Object} ctx Context object (optional), only for nodejs v10+. - * @return {Array.|Array.} Array of items in directory (if sync). + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {Array | Array} Array of items in directory (if sync). */ -Binding.prototype.readdir = function( +Binding.prototype.readdir = function ( dirpath, encoding, withFileTypes, @@ -737,7 +743,7 @@ ) { markSyscall(ctx, 'scandir'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { dirpath = deBuffer(dirpath); let dpath = dirpath; let dir = this._system.getItem(dirpath); @@ -757,13 +763,13 @@ let list = dir.list(); if (encoding === 'buffer') { - list = list.map(function(item) { + list = list.map(function (item) { return Buffer.from(item); }); } if (withFileTypes === true) { - const types = list.map(function(name) { + const types = list.map(function (name) { const stats = dir.getItem(name).getStats(); return getDirentType(stats.mode); @@ -781,12 +787,13 @@ * @param {number} mode Permissions. * @param {boolean} recursive Recursively create deep directory. (added in nodejs v10+) * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.mkdir = function(pathname, mode, recursive, callback, ctx) { +Binding.prototype.mkdir = function (pathname, mode, recursive, callback, ctx) { markSyscall(ctx, 'mkdir'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { pathname = deBuffer(pathname); const item = this._system.getItem(pathname); if (item) { @@ -797,7 +804,7 @@ throw new FSError('EEXIST', pathname); } - const _mkdir = function(_pathname) { + const _mkdir = function (_pathname) { const parentDir = path.dirname(_pathname); let parent = this._system.getItem(parentDir); if (!parent) { @@ -822,12 +829,13 @@ * Remove a directory. * @param {string} pathname Path to directory. * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.rmdir = function(pathname, callback, ctx) { +Binding.prototype.rmdir = function (pathname, callback, ctx) { markSyscall(ctx, 'rmdir'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { pathname = deBuffer(pathname); const item = this._system.getItem(pathname); if (!item) { @@ -853,12 +861,13 @@ /** * Create a directory based on a template. * See http://web.mit.edu/freebsd/head/lib/libc/stdio/mktemp.c - * @param {string} template Path template (trailing Xs will be replaced). + * @param {string} prefix Path template (trailing Xs will be replaced). * @param {string} encoding The encoding ('utf-8' or 'buffer'). * @param {function(Error, string)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.mkdtemp = function(prefix, encoding, callback, ctx) { +Binding.prototype.mkdtemp = function (prefix, encoding, callback, ctx) { if (encoding && typeof encoding !== 'string') { callback = encoding; encoding = 'utf-8'; @@ -866,7 +875,7 @@ markSyscall(ctx, 'mkdtemp'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { prefix = prefix.replace(/X{0,6}$/, 'XXXXXX'); const parentPath = path.dirname(prefix); const parent = this._system.getItem(parentPath); @@ -915,12 +924,13 @@ * @param {number} fd File descriptor. * @param {number} len Number of bytes. * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.ftruncate = function(fd, len, callback, ctx) { +Binding.prototype.ftruncate = function (fd, len, callback, ctx) { markSyscall(ctx, 'ftruncate'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { const descriptor = this.getDescriptorById(fd); if (!descriptor.isWrite()) { throw new FSError('EINVAL'); @@ -941,7 +951,7 @@ * @param {number} fd File descriptor. * @param {number} len Number of bytes. * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. */ Binding.prototype.truncate = Binding.prototype.ftruncate; @@ -951,12 +961,13 @@ * @param {number} uid User id. * @param {number} gid Group id. * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.chown = function(pathname, uid, gid, callback, ctx) { +Binding.prototype.chown = function (pathname, uid, gid, callback, ctx) { markSyscall(ctx, 'chown'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { pathname = deBuffer(pathname); const item = this._system.getItem(pathname); if (!item) { @@ -973,12 +984,13 @@ * @param {number} uid User id. * @param {number} gid Group id. * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.fchown = function(fd, uid, gid, callback, ctx) { +Binding.prototype.fchown = function (fd, uid, gid, callback, ctx) { markSyscall(ctx, 'fchown'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { const descriptor = this.getDescriptorById(fd); const item = descriptor.getItem(); item.setUid(uid); @@ -991,12 +1003,13 @@ * @param {string} pathname Path. * @param {number} mode Mode. * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.chmod = function(pathname, mode, callback, ctx) { +Binding.prototype.chmod = function (pathname, mode, callback, ctx) { markSyscall(ctx, 'chmod'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { pathname = deBuffer(pathname); const item = this._system.getItem(pathname); if (!item) { @@ -1011,12 +1024,13 @@ * @param {number} fd File descriptor. * @param {number} mode Mode. * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.fchmod = function(fd, mode, callback, ctx) { +Binding.prototype.fchmod = function (fd, mode, callback, ctx) { markSyscall(ctx, 'fchmod'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { const descriptor = this.getDescriptorById(fd); const item = descriptor.getItem(); item.setMode(mode); @@ -1027,12 +1041,13 @@ * Delete a named item. * @param {string} pathname Path to item. * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.unlink = function(pathname, callback, ctx) { +Binding.prototype.unlink = function (pathname, callback, ctx) { markSyscall(ctx, 'unlink'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { pathname = deBuffer(pathname); const item = this._system.getItem(pathname); if (!item) { @@ -1052,12 +1067,13 @@ * @param {number} atime Access time (in seconds). * @param {number} mtime Modification time (in seconds). * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.utimes = function(pathname, atime, mtime, callback, ctx) { +Binding.prototype.utimes = function (pathname, atime, mtime, callback, ctx) { markSyscall(ctx, 'utimes'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { pathname = deBuffer(pathname); const item = this._system.getItem(pathname); if (!item) { @@ -1074,12 +1090,13 @@ * @param {number} atime Access time (in seconds). * @param {number} mtime Modification time (in seconds). * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.futimes = function(fd, atime, mtime, callback, ctx) { +Binding.prototype.futimes = function (fd, atime, mtime, callback, ctx) { markSyscall(ctx, 'futimes'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { const descriptor = this.getDescriptorById(fd); const item = descriptor.getItem(); item.setATime(new Date(atime * 1000)); @@ -1091,12 +1108,13 @@ * Synchronize in-core state with storage device. * @param {number} fd File descriptor. * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.fsync = function(fd, callback, ctx) { +Binding.prototype.fsync = function (fd, callback, ctx) { markSyscall(ctx, 'fsync'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { this.getDescriptorById(fd); }); }; @@ -1105,12 +1123,13 @@ * Synchronize in-core metadata state with storage device. * @param {number} fd File descriptor. * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.fdatasync = function(fd, callback, ctx) { +Binding.prototype.fdatasync = function (fd, callback, ctx) { markSyscall(ctx, 'fdatasync'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { this.getDescriptorById(fd); }); }; @@ -1120,12 +1139,13 @@ * @param {string} srcPath The existing file. * @param {string} destPath The new link to create. * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.link = function(srcPath, destPath, callback, ctx) { +Binding.prototype.link = function (srcPath, destPath, callback, ctx) { markSyscall(ctx, 'link'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { srcPath = deBuffer(srcPath); destPath = deBuffer(destPath); const item = this._system.getItem(srcPath); @@ -1155,12 +1175,13 @@ * @param {string} destPath Path for the generated link. * @param {string} type Ignored (used for Windows only). * @param {function(Error)} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.symlink = function(srcPath, destPath, type, callback, ctx) { +Binding.prototype.symlink = function (srcPath, destPath, type, callback, ctx) { markSyscall(ctx, 'symlink'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { srcPath = deBuffer(srcPath); destPath = deBuffer(destPath); if (this._system.getItem(destPath)) { @@ -1184,10 +1205,10 @@ * @param {string} pathname Path to symbolic link. * @param {string} encoding The encoding ('utf-8' or 'buffer'). * @param {function(Error, (string|Buffer))} callback Optional callback. - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. * @return {string|Buffer} Symbolic link contents (path to source). */ -Binding.prototype.readlink = function(pathname, encoding, callback, ctx) { +Binding.prototype.readlink = function (pathname, encoding, callback, ctx) { if (encoding && typeof encoding !== 'string') { // this would not happend in nodejs v10+ callback = encoding; @@ -1196,7 +1217,7 @@ markSyscall(ctx, 'readlink'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { pathname = deBuffer(pathname); const link = this._system.getItem(pathname); if (!link) { @@ -1216,21 +1237,22 @@ /** * Stat an item. * @param {string} filepath Path. + * @param {boolean} bigint Use BigInt. * @param {function(Error, Float64Array|BigUint64Array)} callback Callback (optional). - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. * @return {Float64Array|BigUint64Array|undefined} Stats or undefined (if sync). */ -Binding.prototype.lstat = function(filepath, bigint, callback, ctx) { +Binding.prototype.lstat = function (filepath, bigint, callback, ctx) { markSyscall(ctx, 'lstat'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { filepath = deBuffer(filepath); const item = this._system.getItem(filepath); if (!item) { throw new FSError('ENOENT', filepath); } const stats = item.getStats(bigint); - fillStats(stats); + fillStats(stats, bigint); return stats; }); }; @@ -1240,12 +1262,13 @@ * @param {string} filepath Path. * @param {number} mode Mode. * @param {function(Error)} callback Callback (optional). - * @param {Object} ctx Context object (optional), only for nodejs v10+. + * @param {object} ctx Context object (optional), only for nodejs v10+. + * @return {*} The return if no callback is provided. */ -Binding.prototype.access = function(filepath, mode, callback, ctx) { +Binding.prototype.access = function (filepath, mode, callback, ctx) { markSyscall(ctx, 'access'); - return maybeCallback(normalizeCallback(callback), ctx, this, function() { + return maybeCallback(normalizeCallback(callback), ctx, this, function () { filepath = deBuffer(filepath); let item = this._system.getItem(filepath); let links = 0; @@ -1289,4 +1312,4 @@ * Export the binding constructor. * @type {function()} */ -exports = module.exports = Binding; +module.exports = Binding; diff -Nru node-mock-fs-5.1.2/lib/bypass.js node-mock-fs-5.1.4/lib/bypass.js --- node-mock-fs-5.1.2/lib/bypass.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/lib/bypass.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,14 +1,17 @@ const realBinding = process.binding('fs'); + let storedBinding; /** * Perform action, bypassing mock FS + * @param {Function} fn The function. * @example * // This file exists on the real FS, not on the mocked FS * const filePath = '/path/file.json'; * const data = mock.bypass(() => fs.readFileSync(filePath, 'utf-8')); + * @return {*} The return. */ -exports = module.exports = function bypass(fn) { +module.exports = function bypass(fn) { if (typeof fn !== 'function') { throw new Error(`Must provide a function to perform for mock.bypass()`); } @@ -20,11 +23,11 @@ result = fn(); if (result && typeof result.then === 'function') { return result.then( - r => { + (r) => { enable(); return r; }, - err => { + (err) => { enable(); throw err; } diff -Nru node-mock-fs-5.1.2/lib/descriptor.js node-mock-fs-5.1.4/lib/descriptor.js --- node-mock-fs-5.1.2/lib/descriptor.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/lib/descriptor.js 2022-08-04 03:14:53.000000000 +0000 @@ -5,7 +5,7 @@ /** * Create a new file descriptor. * @param {number} flags Flags. - * @constructor + * @class */ function FileDescriptor(flags) { /** @@ -31,7 +31,7 @@ * Set the item. * @param {Item} item File system item. */ -FileDescriptor.prototype.setItem = function(item) { +FileDescriptor.prototype.setItem = function (item) { this._item = item; }; @@ -39,7 +39,7 @@ * Get the item. * @return {Item} File system item. */ -FileDescriptor.prototype.getItem = function() { +FileDescriptor.prototype.getItem = function () { return this._item; }; @@ -47,7 +47,7 @@ * Get the current file position. * @return {number} File position. */ -FileDescriptor.prototype.getPosition = function() { +FileDescriptor.prototype.getPosition = function () { return this._position; }; @@ -55,7 +55,7 @@ * Set the current file position. * @param {number} position File position. */ -FileDescriptor.prototype.setPosition = function(position) { +FileDescriptor.prototype.setPosition = function (position) { this._position = position; }; @@ -63,7 +63,7 @@ * Check if file opened for appending. * @return {boolean} Opened for appending. */ -FileDescriptor.prototype.isAppend = function() { +FileDescriptor.prototype.isAppend = function () { return (this._flags & constants.O_APPEND) === constants.O_APPEND; }; @@ -71,7 +71,7 @@ * Check if file opened for creation. * @return {boolean} Opened for creation. */ -FileDescriptor.prototype.isCreate = function() { +FileDescriptor.prototype.isCreate = function () { return (this._flags & constants.O_CREAT) === constants.O_CREAT; }; @@ -79,7 +79,7 @@ * Check if file opened for reading. * @return {boolean} Opened for reading. */ -FileDescriptor.prototype.isRead = function() { +FileDescriptor.prototype.isRead = function () { return (this._flags & constants.O_WRONLY) !== constants.O_WRONLY; }; @@ -87,7 +87,7 @@ * Check if file opened for writing. * @return {boolean} Opened for writing. */ -FileDescriptor.prototype.isWrite = function() { +FileDescriptor.prototype.isWrite = function () { return ( (this._flags & constants.O_WRONLY) === constants.O_WRONLY || (this._flags & constants.O_RDWR) === constants.O_RDWR @@ -98,7 +98,7 @@ * Check if file opened for truncating. * @return {boolean} Opened for truncating. */ -FileDescriptor.prototype.isTruncate = function() { +FileDescriptor.prototype.isTruncate = function () { return (this._flags & constants.O_TRUNC) === constants.O_TRUNC; }; @@ -106,7 +106,7 @@ * Check if file opened with exclusive flag. * @return {boolean} Opened with exclusive. */ -FileDescriptor.prototype.isExclusive = function() { +FileDescriptor.prototype.isExclusive = function () { return (this._flags & constants.O_EXCL) === constants.O_EXCL; }; @@ -114,4 +114,4 @@ * Export the constructor. * @type {function()} */ -exports = module.exports = FileDescriptor; +module.exports = FileDescriptor; diff -Nru node-mock-fs-5.1.2/lib/directory.js node-mock-fs-5.1.4/lib/directory.js --- node-mock-fs-5.1.2/lib/directory.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/lib/directory.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,21 +1,19 @@ 'use strict'; const util = require('util'); - -const Item = require('./item'); - +const Item = require('./item.js'); const constants = require('constants'); /** * A directory. - * @constructor + * @class */ function Directory() { Item.call(this); /** * Items in this directory. - * @type {Object.} + * @type {Object} */ this._items = {}; @@ -32,7 +30,7 @@ * @param {Item} item The item to add. * @return {Item} The added item. */ -Directory.prototype.addItem = function(name, item) { +Directory.prototype.addItem = function (name, item) { if (this._items.hasOwnProperty(name)) { throw new Error('Item with the same name already exists: ' + name); } @@ -53,7 +51,7 @@ * @param {string} name Item name. * @return {Item} The named item (or null if none). */ -Directory.prototype.getItem = function(name) { +Directory.prototype.getItem = function (name) { let item = null; if (this._items.hasOwnProperty(name)) { item = this._items[name]; @@ -66,7 +64,7 @@ * @param {string} name Name of item to remove. * @return {Item} The orphan item. */ -Directory.prototype.removeItem = function(name) { +Directory.prototype.removeItem = function (name) { if (!this._items.hasOwnProperty(name)) { throw new Error('Item does not exist in directory: ' + name); } @@ -85,19 +83,20 @@ /** * Get list of item names in this directory. - * @return {Array.} Item names. + * @return {Array} Item names. */ -Directory.prototype.list = function() { +Directory.prototype.list = function () { return Object.keys(this._items).sort(); }; /** * Get directory stats. - * @return {Object} Stats properties. + * @param {bolean} bigint Use BigInt. + * @return {object} Stats properties. */ -Directory.prototype.getStats = function(bigint) { +Directory.prototype.getStats = function (bigint) { const stats = Item.prototype.getStats.call(this, bigint); - const convert = bigint ? v => BigInt(v) : v => v; + const convert = bigint ? (v) => BigInt(v) : (v) => v; stats[1] = convert(this.getMode() | constants.S_IFDIR); // mode stats[8] = convert(1); // size @@ -110,4 +109,4 @@ * Export the constructor. * @type {function()} */ -exports = module.exports = Directory; +module.exports = Directory; diff -Nru node-mock-fs-5.1.2/lib/error.js node-mock-fs-5.1.4/lib/error.js --- node-mock-fs-5.1.2/lib/error.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/lib/error.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,13 +1,14 @@ 'use strict'; const uvBinding = process.binding('uv'); + /** * Error codes from libuv. * @enum {number} */ const codes = {}; -uvBinding.getErrorMap().forEach(function(value, errno) { +uvBinding.getErrorMap().forEach(function (value, errno) { const code = value[0]; const message = value[1]; codes[code] = {errno: errno, message: message}; @@ -17,7 +18,7 @@ * Create an error. * @param {string} code Error code. * @param {string} path Path (optional). - * @constructor + * @class */ function FSError(code, path) { if (!codes.hasOwnProperty(code)) { @@ -42,7 +43,7 @@ /** * Create an abort error for when an asynchronous task was aborted. - * @constructor + * @class */ function AbortError() { Error.call(this); @@ -56,6 +57,7 @@ * FSError constructor. */ exports.FSError = FSError; + /** * AbortError constructor. */ diff -Nru node-mock-fs-5.1.2/lib/file.js node-mock-fs-5.1.4/lib/file.js --- node-mock-fs-5.1.2/lib/file.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/lib/file.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,15 +1,14 @@ 'use strict'; const util = require('util'); - -const Item = require('./item'); +const Item = require('./item.js'); +const constants = require('constants'); const EMPTY = Buffer.alloc(0); -const constants = require('constants'); /** * A file. - * @constructor + * @class */ function File() { Item.call(this); @@ -26,7 +25,7 @@ * Get the file contents. * @return {Buffer} File contents. */ -File.prototype.getContent = function() { +File.prototype.getContent = function () { this.setATime(new Date()); return this._content; }; @@ -35,7 +34,7 @@ * Set the file contents. * @param {string|Buffer} content File contents. */ -File.prototype.setContent = function(content) { +File.prototype.setContent = function (content) { if (typeof content === 'string') { content = Buffer.from(content); } else if (!Buffer.isBuffer(content)) { @@ -49,12 +48,13 @@ /** * Get file stats. - * @return {Object} Stats properties. + * @param {boolean} bigint Use BigInt. + * @return {object} Stats properties. */ -File.prototype.getStats = function(bigint) { +File.prototype.getStats = function (bigint) { const size = this._content.length; const stats = Item.prototype.getStats.call(this, bigint); - const convert = bigint ? v => BigInt(v) : v => v; + const convert = bigint ? (v) => BigInt(v) : (v) => v; stats[1] = convert(this.getMode() | constants.S_IFREG); // mode stats[8] = convert(size); // size @@ -67,11 +67,12 @@ * Export the constructor. * @type {function()} */ -exports = module.exports = File; +module.exports = File; +exports = module.exports; /** * Standard input. - * @constructor + * @class */ function StandardInput() { File.call(this); @@ -83,7 +84,7 @@ /** * Standard output. - * @constructor + * @class */ function StandardOutput() { File.call(this); @@ -95,7 +96,7 @@ * Write the contents to stdout. * @param {string|Buffer} content File contents. */ -StandardOutput.prototype.setContent = function(content) { +StandardOutput.prototype.setContent = function (content) { if (process.stdout.isTTY) { process.stdout.write(content); } @@ -105,7 +106,7 @@ /** * Standard error. - * @constructor + * @class */ function StandardError() { File.call(this); @@ -117,7 +118,7 @@ * Write the contents to stderr. * @param {string|Buffer} content File contents. */ -StandardError.prototype.setContent = function(content) { +StandardError.prototype.setContent = function (content) { if (process.stderr.isTTY) { process.stderr.write(content); } diff -Nru node-mock-fs-5.1.2/lib/filesystem.js node-mock-fs-5.1.4/lib/filesystem.js --- node-mock-fs-5.1.2/lib/filesystem.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/lib/filesystem.js 2022-08-04 03:14:53.000000000 +0000 @@ -2,11 +2,10 @@ const os = require('os'); const path = require('path'); - -const Directory = require('./directory'); -const File = require('./file'); -const {FSError} = require('./error'); -const SymbolicLink = require('./symlink'); +const Directory = require('./directory.js'); +const File = require('./file.js'); +const {FSError} = require('./error.js'); +const SymbolicLink = require('./symlink.js'); const isWindows = process.platform === 'win32'; @@ -34,12 +33,12 @@ /** * Create a new file system. - * @param {Object} options Any filesystem options. + * @param {object} options Any filesystem options. * @param {boolean} options.createCwd Create a directory for `process.cwd()` * (defaults to `true`). * @param {boolean} options.createTmp Create a directory for `os.tmpdir()` * (defaults to `true`). - * @constructor + * @class */ function FileSystem(options) { options = options || {}; @@ -59,7 +58,7 @@ defaults.push((os.tmpdir && os.tmpdir()) || os.tmpDir()); } - defaults.forEach(function(dir) { + defaults.forEach(function (dir) { const parts = getPathParts(dir); let directory = root; for (let i = 0, ii = parts.length; i < ii; ++i) { @@ -86,7 +85,7 @@ * Get the root directory. * @return {Directory} The root directory. */ -FileSystem.prototype.getRoot = function() { +FileSystem.prototype.getRoot = function () { return this._root; }; @@ -95,7 +94,7 @@ * @param {string} filepath Path to item. * @return {Item} The item (or null if not found). */ -FileSystem.prototype.getItem = function(filepath) { +FileSystem.prototype.getItem = function (filepath) { const parts = getPathParts(filepath); const currentParts = getPathParts(process.cwd()); let item = this._root; @@ -135,7 +134,7 @@ * Populate a directory with an item. * @param {Directory} directory The directory to populate. * @param {string} name The name of the item. - * @param {string|Buffer|function|Object} obj Instructions for creating the + * @param {string | Buffer | Function | object} obj Instructions for creating the * item. */ function populate(directory, name, obj) { @@ -173,15 +172,15 @@ /** * Configure a mock file system. - * @param {Object} paths Config object. - * @param {Object} options Any filesystem options. + * @param {object} paths Config object. + * @param {object} options Any filesystem options. * @param {boolean} options.createCwd Create a directory for `process.cwd()` * (defaults to `true`). * @param {boolean} options.createTmp Create a directory for `os.tmpdir()` * (defaults to `true`). * @return {FileSystem} Mock file system. */ -FileSystem.create = function(paths, options) { +FileSystem.create = function (paths, options) { const system = new FileSystem(options); for (const filepath in paths) { @@ -206,12 +205,12 @@ /** * Generate a factory for new files. - * @param {Object} config File config. + * @param {object} config File config. * @return {function():File} Factory that creates a new file. */ -FileSystem.file = function(config) { +FileSystem.file = function (config) { config = config || {}; - return function() { + return function () { const file = new File(); if (config.hasOwnProperty('content')) { file.setContent(config.content); @@ -245,12 +244,12 @@ /** * Generate a factory for new symbolic links. - * @param {Object} config File config. + * @param {object} config File config. * @return {function():File} Factory that creates a new symbolic link. */ -FileSystem.symlink = function(config) { +FileSystem.symlink = function (config) { config = config || {}; - return function() { + return function () { const link = new SymbolicLink(); if (config.hasOwnProperty('mode')) { link.setMode(config.mode); @@ -286,12 +285,12 @@ /** * Generate a factory for new directories. - * @param {Object} config File config. + * @param {object} config File config. * @return {function():Directory} Factory that creates a new directory. */ -FileSystem.directory = function(config) { +FileSystem.directory = function (config) { config = config || {}; - return function() { + return function () { const dir = new Directory(); if (config.hasOwnProperty('mode')) { dir.setMode(config.mode); @@ -325,8 +324,9 @@ /** * Module exports. - * @type {function} + * @type {Function} */ -exports = module.exports = FileSystem; +module.exports = FileSystem; +exports = module.exports; exports.getPathParts = getPathParts; exports.toNamespacedPath = toNamespacedPath; diff -Nru node-mock-fs-5.1.2/lib/index.js node-mock-fs-5.1.4/lib/index.js --- node-mock-fs-5.1.2/lib/index.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/lib/index.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,23 +1,23 @@ 'use strict'; -const Binding = require('./binding'); -const {FSError} = require('./error'); -const FileSystem = require('./filesystem'); +const Binding = require('./binding.js'); +const {FSError} = require('./error.js'); +const FileSystem = require('./filesystem.js'); const realBinding = process.binding('fs'); const path = require('path'); -const loader = require('./loader'); -const bypass = require('./bypass'); +const loader = require('./loader.js'); +const bypass = require('./bypass.js'); const { getReadFileContextPrototype, - patchReadFileContext -} = require('./readfilecontext'); + patchReadFileContext, +} = require('./readfilecontext.js'); const fs = require('fs'); const toNamespacedPath = FileSystem.toNamespacedPath; const realProcessProps = { cwd: process.cwd, - chdir: process.chdir + chdir: process.chdir, }; const realCreateWriteStream = fs.createWriteStream; const realStats = realBinding.Stats; @@ -36,7 +36,7 @@ */ function patch(key) { const existingMethod = realBinding[key]; - realBinding[key] = function() { + realBinding[key] = function () { if (this._mockedBinding) { return this._mockedBinding[key].apply(this._mockedBinding, arguments); } else { @@ -92,7 +92,7 @@ * When _writev is missing, it will fall back to make multiple _write calls. */ function overrideCreateWriteStream() { - fs.createWriteStream = function(path, options) { + fs.createWriteStream = function (path, options) { const output = realCreateWriteStream(path, options); // disable _writev, this will over shadow WriteStream.prototype._writev if (realBinding._mockedBinding) { @@ -128,14 +128,14 @@ /** * Swap out the fs bindings for a mock file system. - * @param {Object} config Mock file system configuration. - * @param {Object} options Any filesystem options. + * @param {object} config Mock file system configuration. + * @param {object} [options={}] Any filesystem options. * @param {boolean} options.createCwd Create a directory for `process.cwd()` * (defaults to `true`). * @param {boolean} options.createTmp Create a directory for `os.tmpdir()` * (defaults to `true`). */ -exports = module.exports = function mock(config, options) { +module.exports = function mock(config, options = {}) { const system = FileSystem.create(config, options); const binding = new Binding(system); @@ -166,11 +166,14 @@ overrideCreateWriteStream(); }; +exports = module.exports; + /** * Get hold of the mocked filesystem's 'root' * If fs hasn't currently been replaced, this will return an empty object + * @return {object} The mock root. */ -exports.getMockRoot = function() { +exports.getMockRoot = function () { if (realBinding._mockedBinding) { return realBinding._mockedBinding.getSystem().getRoot(); } else { @@ -181,7 +184,7 @@ /** * Restore the fs bindings for the real file system. */ -exports.restore = function() { +exports.restore = function () { restoreBinding(); restoreProcess(); restoreCreateWriteStream(); diff -Nru node-mock-fs-5.1.2/lib/item.js node-mock-fs-5.1.4/lib/item.js --- node-mock-fs-5.1.2/lib/item.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/lib/item.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,5 +1,15 @@ 'use strict'; +const fsBinding = process.binding('fs'); +const statsConstructor = fsBinding.statValues + ? fsBinding.statValues.constructor + : Float64Array; +// Nodejs v18.7.0 changed bigint stats type from BigUint64Array to BigInt64Array +// https://github.com/nodejs/node/pull/43714 +const bigintStatsConstructor = fsBinding.bigintStatValues + ? fsBinding.bigintStatValues.constructor + : BigUint64Array; + let counter = 0; /** @@ -15,7 +25,7 @@ GROUP_EXEC: 8, // 0010 OTHER_READ: 4, // 0004 OTHER_WRITE: 2, // 0002 - OTHER_EXEC: 1 // 0001 + OTHER_EXEC: 1, // 0001 }; function getUid() { @@ -30,7 +40,7 @@ /** * A filesystem item. - * @constructor + * @class */ function Item() { const now = Date.now(); @@ -91,8 +101,10 @@ /** * Add execute if read allowed * See notes in index.js -> mapping#addDir + * @param {number} mode The file mode. + * @return {number} The modified mode. */ -Item.fixWin32Permissions = mode => +Item.fixWin32Permissions = (mode) => process.platform !== 'win32' ? mode : mode | @@ -104,7 +116,7 @@ * Determine if the current user has read permission. * @return {boolean} The current user can read. */ -Item.prototype.canRead = function() { +Item.prototype.canRead = function () { const uid = getUid(); const gid = getGid(); let can = false; @@ -124,7 +136,7 @@ * Determine if the current user has write permission. * @return {boolean} The current user can write. */ -Item.prototype.canWrite = function() { +Item.prototype.canWrite = function () { const uid = getUid(); const gid = getGid(); let can = false; @@ -144,7 +156,7 @@ * Determine if the current user has execute permission. * @return {boolean} The current user can execute. */ -Item.prototype.canExecute = function() { +Item.prototype.canExecute = function () { const uid = getUid(); const gid = getGid(); let can = false; @@ -164,7 +176,7 @@ * Get access time. * @return {Date} Access time. */ -Item.prototype.getATime = function() { +Item.prototype.getATime = function () { return this._atime; }; @@ -172,7 +184,7 @@ * Set access time. * @param {Date} atime Access time. */ -Item.prototype.setATime = function(atime) { +Item.prototype.setATime = function (atime) { this._atime = atime; }; @@ -180,7 +192,7 @@ * Get change time. * @return {Date} Change time. */ -Item.prototype.getCTime = function() { +Item.prototype.getCTime = function () { return this._ctime; }; @@ -188,7 +200,7 @@ * Set change time. * @param {Date} ctime Change time. */ -Item.prototype.setCTime = function(ctime) { +Item.prototype.setCTime = function (ctime) { this._ctime = ctime; }; @@ -196,7 +208,7 @@ * Get birth time. * @return {Date} Birth time. */ -Item.prototype.getBirthtime = function() { +Item.prototype.getBirthtime = function () { return this._birthtime; }; @@ -204,7 +216,7 @@ * Set change time. * @param {Date} birthtime Birth time. */ -Item.prototype.setBirthtime = function(birthtime) { +Item.prototype.setBirthtime = function (birthtime) { this._birthtime = birthtime; }; @@ -212,7 +224,7 @@ * Get modification time. * @return {Date} Modification time. */ -Item.prototype.getMTime = function() { +Item.prototype.getMTime = function () { return this._mtime; }; @@ -220,7 +232,7 @@ * Set modification time. * @param {Date} mtime Modification time. */ -Item.prototype.setMTime = function(mtime) { +Item.prototype.setMTime = function (mtime) { this._mtime = mtime; }; @@ -228,7 +240,7 @@ * Get mode (permission only, e.g 0666). * @return {number} Mode. */ -Item.prototype.getMode = function() { +Item.prototype.getMode = function () { return this._mode; }; @@ -236,7 +248,7 @@ * Set mode (permission only, e.g 0666). * @param {Date} mode Mode. */ -Item.prototype.setMode = function(mode) { +Item.prototype.setMode = function (mode) { this.setCTime(new Date()); this._mode = mode; }; @@ -245,7 +257,7 @@ * Get user id. * @return {number} User id. */ -Item.prototype.getUid = function() { +Item.prototype.getUid = function () { return this._uid; }; @@ -253,7 +265,7 @@ * Set user id. * @param {number} uid User id. */ -Item.prototype.setUid = function(uid) { +Item.prototype.setUid = function (uid) { this.setCTime(new Date()); this._uid = uid; }; @@ -262,7 +274,7 @@ * Get group id. * @return {number} Group id. */ -Item.prototype.getGid = function() { +Item.prototype.getGid = function () { return this._gid; }; @@ -270,18 +282,21 @@ * Set group id. * @param {number} gid Group id. */ -Item.prototype.setGid = function(gid) { +Item.prototype.setGid = function (gid) { this.setCTime(new Date()); this._gid = gid; }; /** * Get item stats. - * @return {Object} Stats properties. + * @param {boolean} bigint Use BigInt. + * @return {object} Stats properties. */ -Item.prototype.getStats = function(bigint) { - const stats = bigint ? new BigUint64Array(36) : new Float64Array(36); - const convert = bigint ? v => BigInt(v) : v => v; +Item.prototype.getStats = function (bigint) { + const stats = bigint + ? new bigintStatsConstructor(36) + : new statsConstructor(36); + const convert = bigint ? (v) => BigInt(v) : (v) => v; stats[0] = convert(8675309); // dev // [1] is mode @@ -312,7 +327,7 @@ * Get the item's string representation. * @return {string} String representation. */ -Item.prototype.toString = function() { +Item.prototype.toString = function () { return '[' + this.constructor.name + ']'; }; @@ -320,4 +335,4 @@ * Export the constructor. * @type {function()} */ -exports = module.exports = Item; +module.exports = Item; diff -Nru node-mock-fs-5.1.2/lib/loader.js node-mock-fs-5.1.4/lib/loader.js --- node-mock-fs-5.1.2/lib/loader.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/lib/loader.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,8 +1,8 @@ -const {fixWin32Permissions} = require('./item'); +const {fixWin32Permissions} = require('./item.js'); const path = require('path'); -const FileSystem = require('./filesystem'); +const FileSystem = require('./filesystem.js'); const fs = require('fs'); -const bypass = require('./bypass'); +const bypass = require('./bypass.js'); const createContext = ({output, options = {}, target}, newContext) => Object.assign( @@ -10,10 +10,10 @@ // Assign options and set defaults if needed options: { recursive: options.recursive !== false, - lazy: options.lazy !== false + lazy: options.lazy !== false, }, output, - target + target, }, newContext ); @@ -38,17 +38,17 @@ const res = bypass(() => fs.readFileSync(target)); Object.defineProperty(file, '_content', { value: res, - writable: true + writable: true, }); return res; }, set(data) { Object.defineProperty(file, '_content', { value: data, - writable: true + writable: true, }); }, - configurable: true + configurable: true, }); } @@ -81,12 +81,12 @@ Object.assign(stats, {items: directoryItems}) ); - fs.readdirSync(target).forEach(p => { + fs.readdirSync(target).forEach((p) => { const absPath = path.join(target, p); const stats = fs.statSync(absPath); const newContext = createContext(context, { target: absPath, - output: directoryItems + output: directoryItems, }); if (recursive && stats.isDirectory()) { @@ -101,8 +101,11 @@ /** * Load directory or file from real FS + * @param {string} p The path. + * @param {object} options The options. + * @return {*} The return. */ -exports.load = function(p, options) { +exports.load = function (p, options) { return bypass(() => { p = path.resolve(p); diff -Nru node-mock-fs-5.1.2/lib/readfilecontext.js node-mock-fs-5.1.4/lib/readfilecontext.js --- node-mock-fs-5.1.2/lib/readfilecontext.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/lib/readfilecontext.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,14 +1,14 @@ 'use strict'; -const {AbortError} = require('./error'); +const {AbortError} = require('./error.js'); const {FSReqCallback} = process.binding('fs'); /** * This is a workaround for getting access to the ReadFileContext * prototype, which we need to be able to patch its methods. - * @returns {object} + * @return {object} The prototype. */ -exports.getReadFileContextPrototype = function() { +exports.getReadFileContextPrototype = function () { const fs = require('fs'); const fsBinding = process.binding('fs'); @@ -39,7 +39,7 @@ * * @param {object} prototype The ReadFileContext prototype object to patch. */ -exports.patchReadFileContext = function(prototype) { +exports.patchReadFileContext = function (prototype) { const origRead = prototype.read; const origClose = prototype.close; diff -Nru node-mock-fs-5.1.2/lib/symlink.js node-mock-fs-5.1.4/lib/symlink.js --- node-mock-fs-5.1.2/lib/symlink.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/lib/symlink.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,14 +1,12 @@ 'use strict'; const util = require('util'); - -const Item = require('./item'); - +const Item = require('./item.js'); const constants = require('constants'); /** * A directory. - * @constructor + * @class */ function SymbolicLink() { Item.call(this); @@ -25,7 +23,7 @@ * Set the path to the source. * @param {string} pathname Path to source. */ -SymbolicLink.prototype.setPath = function(pathname) { +SymbolicLink.prototype.setPath = function (pathname) { this._path = pathname; }; @@ -33,18 +31,19 @@ * Get the path to the source. * @return {string} Path to source. */ -SymbolicLink.prototype.getPath = function() { +SymbolicLink.prototype.getPath = function () { return this._path; }; /** * Get symbolic link stats. - * @return {Object} Stats properties. + * @param {boolean} bigint Use BigInt. + * @return {object} Stats properties. */ -SymbolicLink.prototype.getStats = function(bigint) { +SymbolicLink.prototype.getStats = function (bigint) { const size = this._path.length; const stats = Item.prototype.getStats.call(this, bigint); - const convert = bigint ? v => BigInt(v) : v => v; + const convert = bigint ? (v) => BigInt(v) : (v) => v; stats[1] = convert(this.getMode() | constants.S_IFLNK); // mode stats[8] = convert(size); // size @@ -57,4 +56,4 @@ * Export the constructor. * @type {function()} */ -exports = module.exports = SymbolicLink; +module.exports = SymbolicLink; diff -Nru node-mock-fs-5.1.2/package.json node-mock-fs-5.1.4/package.json --- node-mock-fs-5.1.2/package.json 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/package.json 2022-08-04 03:14:53.000000000 +0000 @@ -1,7 +1,7 @@ { "name": "mock-fs", "description": "A configurable mock file system. You know, for testing.", - "version": "5.1.2", + "version": "5.1.4", "main": "lib/index.js", "homepage": "https://github.com/tschaub/mock-fs", "author": { @@ -39,13 +39,24 @@ }, "env": { "es2020": true + }, + "rules": { + "prettier/prettier": [ + "error", + { + "endOfLine": "auto", + "singleQuote": true, + "bracketSpacing": false, + "quoteProps": "preserve" + } + ] } }, "devDependencies": { "chai": "^4.3.4", - "eslint": "^7.26.0", - "eslint-config-tschaub": "^13.1.0", - "mocha": "^8.4.0", + "eslint": "^8.21.0", + "eslint-config-tschaub": "^14.1.2", + "mocha": "^9.2.2", "rimraf": "^3.0.2", "semver": "^7.3.5" }, diff -Nru node-mock-fs-5.1.2/package-lock.json node-mock-fs-5.1.4/package-lock.json --- node-mock-fs-5.1.2/package-lock.json 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/package-lock.json 2022-08-04 03:14:53.000000000 +0000 @@ -5,162 +5,124 @@ "requires": true, "packages": { "": { + "name": "mock-fs", "version": "5.1.2", "license": "MIT", "devDependencies": { "chai": "^4.3.4", - "eslint": "^7.26.0", - "eslint-config-tschaub": "^13.1.0", - "mocha": "^8.4.0", + "eslint": "^8.21.0", + "eslint-config-tschaub": "^14.1.2", + "mocha": "^9.2.2", "rimraf": "^3.0.2", "semver": "^7.3.5" + }, + "engines": { + "node": ">=12.0.0" } }, - "node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", - "dev": true - }, - "node_modules/@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "node_modules/@es-joy/jsdoccomment": { + "version": "0.22.2", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.22.2.tgz", + "integrity": "sha512-pM6WQKcuAtdYoqCsXSvVSu3Ij8K0HY50L8tIheOKHDl0wH1uA4zbP88etY8SIeP16NVCMCTFU+Q2DahSKheGGQ==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "comment-parser": "1.3.1", + "esquery": "^1.4.0", + "jsdoc-type-pratt-parser": "~2.2.5" + }, + "engines": { + "node": "^12 || ^14 || ^16 || ^17" } }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/@eslint/eslintrc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", "dev": true, "dependencies": { - "color-convert": "^1.9.0" + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.3.2", + "globals": "^13.15.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" }, "engines": { - "node": ">=4" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/@humanwhocodes/config-array": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", + "integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" }, "engines": { - "node": ">=4" + "node": ">=10.10.0" } }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "node_modules/@humanwhocodes/gitignore-to-minimatch": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", + "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", "dev": true, - "dependencies": { - "color-name": "1.1.3" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" }, "engines": { - "node": ">=4" + "node": ">= 8" } }, - "node_modules/@eslint/eslintrc": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.1.tgz", - "integrity": "sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ==", + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">= 8" } }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "dependencies": { - "type-fest": "^0.8.1" - }, - "engines": { - "node": ">=8" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@eslint/eslintrc/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, "engines": { - "node": ">=8" + "node": ">= 8" } }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, "node_modules/@ungap/promise-all-settled": { @@ -170,9 +132,9 @@ "dev": true }, "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -182,9 +144,9 @@ } }, "node_modules/acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" @@ -216,9 +178,9 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" @@ -253,25 +215,22 @@ } }, "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/array-includes": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", - "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.5.tgz", + "integrity": "sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5", "get-intrinsic": "^1.1.1", - "is-string": "^1.0.5" + "is-string": "^1.0.7" }, "engines": { "node": ">= 0.4" @@ -280,15 +239,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/array.prototype.flat": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", - "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", + "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", + "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -306,15 +275,6 @@ "node": "*" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -435,24 +395,30 @@ } }, "node_modules/chokidar": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", - "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], "dependencies": { - "anymatch": "~3.1.1", + "anymatch": "~3.1.2", "braces": "~3.0.2", - "glob-parent": "~5.1.0", + "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" + "readdirp": "~3.6.0" }, "engines": { "node": ">= 8.10.0" }, "optionalDependencies": { - "fsevents": "~2.3.1" + "fsevents": "~2.3.2" } }, "node_modules/cliui": { @@ -484,21 +450,21 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/comment-parser": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.1.tgz", + "integrity": "sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA==", + "dev": true, + "engines": { + "node": ">= 12.0.0" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "node_modules/contains-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -514,9 +480,9 @@ } }, "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -561,15 +527,19 @@ "dev": true }, "node_modules/define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", "dev": true, "dependencies": { - "object-keys": "^1.0.12" + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/diff": { @@ -581,6 +551,18 @@ "node": ">=0.3.1" } }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -599,49 +581,35 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, "node_modules/es-abstract": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz", - "integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz", + "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", "has": "^1.0.3", - "has-symbols": "^1.0.2", - "is-callable": "^1.2.3", - "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.2", - "is-string": "^1.0.5", - "object-inspect": "^1.9.0", + "has-property-descriptors": "^1.0.0", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.4", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.0" + "regexp.prototype.flags": "^1.4.3", + "string.prototype.trimend": "^1.0.5", + "string.prototype.trimstart": "^1.0.5", + "unbox-primitive": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -650,6 +618,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + } + }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -689,46 +666,48 @@ } }, "node_modules/eslint": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.26.0.tgz", - "integrity": "sha512-4R1ieRf52/izcZE7AlLy56uIHHDLT74Yzz2Iv2l6kDaYvEu9x+wMB5dZArVL8SYGXSYV2YAg70FcW5Y5nGGNIg==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.21.0.tgz", + "integrity": "sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA==", "dev": true, "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.1", + "@eslint/eslintrc": "^1.3.0", + "@humanwhocodes/config-array": "^0.10.4", + "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.3", "esquery": "^1.4.0", "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^13.6.0", - "ignore": "^4.0.6", + "glob-parent": "^6.0.1", + "globals": "^13.15.0", + "globby": "^11.1.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.21", - "minimatch": "^3.0.4", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "table": "^6.0.4", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, @@ -736,120 +715,162 @@ "eslint": "bin/eslint.js" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-config-prettier": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-4.3.0.tgz", - "integrity": "sha512-sZwhSTHVVz78+kYD3t5pCWSYEdVSBR0PXnwjDRsUs8ytIrK8PLXw+6FKp8r3Z7rx4ZszdetWlXYKOHoUrrwPlA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", + "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", "dev": true, - "dependencies": { - "get-stdin": "^6.0.0" - }, "bin": { - "eslint-config-prettier-check": "bin/cli.js" + "eslint-config-prettier": "bin/cli.js" }, "peerDependencies": { - "eslint": ">=3.14.1" + "eslint": ">=7.0.0" } }, "node_modules/eslint-config-tschaub": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-tschaub/-/eslint-config-tschaub-13.1.0.tgz", - "integrity": "sha512-6vlG8FuEQqzB/87AHhs91Z50FZYPwlHk/ZLMDJ9H1ELtbGuqRBkFGBGOI+RxKCgQLdmS77mEDcehhnkBMvxzvA==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/eslint-config-tschaub/-/eslint-config-tschaub-14.1.2.tgz", + "integrity": "sha512-Hk3veCDDOghs46o2HeuAnc79xt1/2oVPpnprW23yi9qgsDbHmHBqwjlxv4pb2l1PfUBNvbh5ur2o+zlCbV3kLA==", "dev": true, "dependencies": { - "eslint-config-prettier": "^4.1.0", - "eslint-plugin-import": "^2.17.2", - "eslint-plugin-prettier": "^3.0.1", - "prettier": "^1.17.0" - }, - "peerDependencies": { - "eslint": ">= 5.4" + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-jsdoc": ">=38", + "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-sort-imports-es6-autofix": "^0.6.0", + "prettier": "^2.7.1" } }, "node_modules/eslint-import-resolver-node": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", - "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", + "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", "dev": true, "dependencies": { - "debug": "^2.6.9", - "resolve": "^1.13.1" + "debug": "^3.2.7", + "resolve": "^1.20.0" } }, "node_modules/eslint-import-resolver-node/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "dependencies": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, - "node_modules/eslint-import-resolver-node/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "node_modules/eslint-module-utils": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", - "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", + "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", "dev": true, "dependencies": { - "debug": "^2.6.9", - "pkg-dir": "^2.0.0" + "debug": "^3.2.7", + "find-up": "^2.1.0" }, "engines": { "node": ">=4" } }, "node_modules/eslint-module-utils/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "dependencies": { - "ms": "2.0.0" + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils/node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "dev": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/eslint-module-utils/node_modules/ms": { + "node_modules/eslint-module-utils/node_modules/locate-path": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "dev": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "dev": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true, + "engines": { + "node": ">=4" + } }, "node_modules/eslint-plugin-import": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", - "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", "dev": true, "dependencies": { - "array-includes": "^3.1.1", - "array.prototype.flat": "^1.2.3", - "contains-path": "^0.1.0", + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", "debug": "^2.6.9", - "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.4", - "eslint-module-utils": "^2.6.0", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.3", "has": "^1.0.3", - "minimatch": "^3.0.4", - "object.values": "^1.1.1", - "read-pkg-up": "^2.0.0", - "resolve": "^1.17.0", - "tsconfig-paths": "^3.9.0" + "is-core-module": "^2.8.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.5", + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" }, "engines": { "node": ">=4" }, "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0" + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" } }, "node_modules/eslint-plugin-import/node_modules/debug": { @@ -862,13 +883,12 @@ } }, "node_modules/eslint-plugin-import/node_modules/doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "dependencies": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" + "esutils": "^2.0.2" }, "engines": { "node": ">=0.10.0" @@ -877,23 +897,62 @@ "node_modules/eslint-plugin-import/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, + "node_modules/eslint-plugin-jsdoc": { + "version": "38.1.6", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-38.1.6.tgz", + "integrity": "sha512-n4s95oYlg0L43Bs8C0dkzIldxYf8pLCutC/tCbjIdF7VDiobuzPI+HZn9Q0BvgOvgPNgh5n7CSStql25HUG4Tw==", + "dev": true, + "dependencies": { + "@es-joy/jsdoccomment": "~0.22.1", + "comment-parser": "1.3.1", + "debug": "^4.3.4", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.4.0", + "regextras": "^0.8.0", + "semver": "^7.3.5", + "spdx-expression-parse": "^3.0.1" + }, + "engines": { + "node": "^12 || ^14 || ^16 || ^17" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/eslint-plugin-prettier": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz", - "integrity": "sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", "dev": true, "dependencies": { "prettier-linter-helpers": "^1.0.0" }, "engines": { - "node": ">=6.0.0" + "node": ">=12.0.0" }, "peerDependencies": { - "eslint": ">=5.0.0", - "prettier": ">=1.13.0" + "eslint": ">=7.28.0", + "prettier": ">=2.0.0" }, "peerDependenciesMeta": { "eslint-config-prettier": { @@ -901,86 +960,91 @@ } } }, + "node_modules/eslint-plugin-sort-imports-es6-autofix": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-sort-imports-es6-autofix/-/eslint-plugin-sort-imports-es6-autofix-0.6.0.tgz", + "integrity": "sha512-2NVaBGF9NN+727Fyq+jJYihdIeegjXeUUrZED9Q8FVB8MsV3YQEyXG96GVnXqWt0pmn7xfCZOZf3uKnIhBrfeQ==", + "dev": true, + "peerDependencies": { + "eslint": ">=7.7.0" + } + }, "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.2.0" }, "engines": { - "node": ">=8.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^1.1.0" + "eslint-visitor-keys": "^2.0.0" }, "engines": { - "node": ">=6" + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" }, "funding": { "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" } }, "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, "engines": { - "node": ">=4" + "node": ">=10" } }, "node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true, "engines": { - "node": ">=10" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "is-glob": "^4.0.3" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=10.13.0" } }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "node_modules/espree": { + "version": "9.3.3", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.3.tgz", + "integrity": "sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==", "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" + "dependencies": { + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" }, "engines": { - "node": ">=4" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esquery": { @@ -995,15 +1059,6 @@ "node": ">=0.10" } }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -1016,19 +1071,10 @@ "node": ">=4.0" } }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { "node": ">=4.0" @@ -1055,6 +1101,22 @@ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "dev": true }, + "node_modules/fast-glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -1067,6 +1129,15 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -1161,12 +1232,39 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "node_modules/function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -1186,32 +1284,39 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.1" + "has-symbols": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, "engines": { - "node": ">=4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -1241,9 +1346,9 @@ } }, "node_modules/globals": { - "version": "13.8.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.8.0.tgz", - "integrity": "sha512-rHtdA6+PDBIjeEvA91rpqzEvk/k3/i7EeNQiryiWuJH0Hw9cpyJMAt2jtbAwUaRdhD+573X4vWw6IcjKPasi9Q==", + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", + "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -1255,10 +1360,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", "dev": true }, "node_modules/growl": { @@ -1283,9 +1408,9 @@ } }, "node_modules/has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1300,11 +1425,38 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, "engines": { "node": ">= 0.4" }, @@ -1321,16 +1473,10 @@ "he": "bin/he" } }, - "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, "node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true, "engines": { "node": ">= 4" @@ -1377,17 +1523,28 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "node_modules/internal-slot": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } }, "node_modules/is-bigint": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", - "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -1405,12 +1562,13 @@ } }, "node_modules/is-boolean-object": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz", - "integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, "dependencies": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -1420,9 +1578,9 @@ } }, "node_modules/is-callable": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", - "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", + "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", "dev": true, "engines": { "node": ">= 0.4" @@ -1432,9 +1590,9 @@ } }, "node_modules/is-core-module": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.3.0.tgz", - "integrity": "sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -1444,10 +1602,13 @@ } }, "node_modules/is-date-object": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz", - "integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -1474,9 +1635,9 @@ } }, "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { "is-extglob": "^2.1.1" @@ -1486,9 +1647,9 @@ } }, "node_modules/is-negative-zero": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", - "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", "dev": true, "engines": { "node": ">= 0.4" @@ -1507,10 +1668,13 @@ } }, "node_modules/is-number-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz", - "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -1528,13 +1692,13 @@ } }, "node_modules/is-regex": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", - "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "has-symbols": "^1.0.2" + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -1543,11 +1707,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-string": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz", - "integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -1570,11 +1749,29 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/isexe": { "version": "2.0.0", @@ -1582,25 +1779,27 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-2.2.5.tgz", + "integrity": "sha512-2a6eRxSxp1BW040hFvaJxhsCMI9lT8QB8t14t+NY5tC5rckIR0U9cr2tjOeaFirmEOy6MHvmJnY7zTBHq431Lw==", + "dev": true, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -1638,21 +1837,6 @@ "node": ">= 0.8.0" } }, - "node_modules/load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -1668,34 +1852,26 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, "node_modules/log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { - "chalk": "^4.0.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lru-cache": { @@ -1710,10 +1886,32 @@ "node": ">=10" } }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -1723,39 +1921,38 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "node_modules/mocha": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", - "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", + "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", "dev": true, "dependencies": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.5.1", - "debug": "4.3.1", + "chokidar": "3.5.3", + "debug": "4.3.3", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.1.6", + "glob": "7.2.0", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "4.0.0", - "log-symbols": "4.0.0", - "minimatch": "3.0.4", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "4.2.1", "ms": "2.1.3", - "nanoid": "3.1.20", - "serialize-javascript": "5.0.1", + "nanoid": "3.3.1", + "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", "which": "2.0.2", - "wide-align": "1.1.3", - "workerpool": "6.1.0", + "workerpool": "6.2.0", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" @@ -1765,29 +1962,23 @@ "mocha": "bin/mocha" }, "engines": { - "node": ">= 10.12.0" + "node": ">= 12.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/mochajs" } }, - "node_modules/mocha/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/mocha/node_modules/js-yaml": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", - "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "node_modules/mocha/node_modules/minimatch": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", "dev": true, "dependencies": { - "argparse": "^2.0.1" + "brace-expansion": "^1.1.7" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "engines": { + "node": ">=10" } }, "node_modules/mocha/node_modules/ms": { @@ -1818,9 +2009,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", - "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" @@ -1835,27 +2026,6 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -1866,9 +2036,9 @@ } }, "node_modules/object-inspect": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz", - "integrity": "sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1902,15 +2072,14 @@ } }, "node_modules/object.values": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz", - "integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", + "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2", - "has": "^1.0.3" + "es-abstract": "^1.19.1" }, "engines": { "node": ">= 0.4" @@ -1978,7 +2147,7 @@ "node_modules/p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", "dev": true, "engines": { "node": ">=4" @@ -1996,18 +2165,6 @@ "node": ">=6" } }, - "node_modules/parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "dependencies": { - "error-ex": "^1.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -2042,15 +2199,12 @@ "dev": true }, "node_modules/path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, - "dependencies": { - "pify": "^2.0.0" - }, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/pathval": { @@ -2063,9 +2217,9 @@ } }, "node_modules/picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, "engines": { "node": ">=8.6" @@ -2074,104 +2228,28 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">= 0.8.0" } }, - "node_modules/pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "node_modules/prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", "dev": true, - "dependencies": { - "find-up": "^2.1.0" + "bin": { + "prettier": "bin-prettier.js" }, "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-dir/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-dir/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-dir/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-dir/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-dir/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", - "dev": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=4" + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/prettier-linter-helpers": { @@ -2186,15 +2264,6 @@ "node": ">=6.0.0" } }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -2204,6 +2273,26 @@ "node": ">=6" } }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -2213,107 +2302,39 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", - "dev": true, - "dependencies": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", - "dev": true, - "dependencies": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "dependencies": { - "p-try": "^1.0.0" + "picomatch": "^2.2.1" }, "engines": { - "node": ">=4" + "node": ">=8.10.0" } }, - "node_modules/read-pkg-up/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "node_modules/regexp.prototype.flags": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", + "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", "dev": true, "dependencies": { - "p-limit": "^1.1.0" + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "functions-have-names": "^1.2.2" }, "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg-up/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" + "node": ">= 0.4" }, - "engines": { - "node": ">=8.10.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true, "engines": { "node": ">=8" @@ -2322,32 +2343,36 @@ "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "node_modules/regextras": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.8.0.tgz", + "integrity": "sha512-k519uI04Z3SaY0fLX843MRXnDeG2+vHOFsyhiPZvNLe7r8rD2YNRjq4BQLZZ0oAr2NrtvZlICsXysGNFPGa3CQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.1.14" } }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "dev": true, "dependencies": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2362,6 +2387,16 @@ "node": ">=4" } }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -2377,6 +2412,29 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -2398,9 +2456,9 @@ ] }, "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -2413,9 +2471,9 @@ } }, "node_modules/serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "dependencies": { "randombytes": "^2.1.0" @@ -2442,31 +2500,27 @@ "node": ">=8" } }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "dev": true, "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" }, "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" + "engines": { + "node": ">=8" } }, "node_modules/spdx-exceptions": { @@ -2486,15 +2540,9 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", - "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", - "dev": true - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", "dev": true }, "node_modules/string-width": { @@ -2512,38 +2560,40 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", + "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", + "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" @@ -2552,7 +2602,7 @@ "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, "engines": { "node": ">=4" @@ -2582,45 +2632,18 @@ "node": ">=8" } }, - "node_modules/table": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.7.0.tgz", - "integrity": "sha512-SAM+5p6V99gYiiy2gT5ArdzgM1dLDed0nkrWmG6Fry/bUS/m9x83BwpJUOf1Qj/x2qJd+thL6IkIx7qPGRxqBw==", + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0" - }, "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.2.0.tgz", - "integrity": "sha512-WSNGFuyWd//XO8n/m/EaOlNLtO0yL8EXT/74LqT4khdhpZjP7lkj/kT5uwRmGitKEVp/Oj7ZUHeGfPtgHhQ5CA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "node": ">= 0.4" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -2640,14 +2663,14 @@ } }, "node_modules/tsconfig-paths": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", - "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", "dev": true, "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.1", - "minimist": "^1.2.0", + "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, @@ -2685,14 +2708,14 @@ } }, "node_modules/unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" }, "funding": { @@ -2714,16 +2737,6 @@ "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -2755,58 +2768,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "dependencies": { - "string-width": "^1.0.2 || 2" - } - }, - "node_modules/wide-align/node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/wide-align/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/wide-align/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/wide-align/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -2817,9 +2778,9 @@ } }, "node_modules/workerpool": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", - "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", + "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", "dev": true }, "node_modules/wrap-ansi": { @@ -2916,128 +2877,87 @@ } }, "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "@es-joy/jsdoccomment": { + "version": "0.22.2", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.22.2.tgz", + "integrity": "sha512-pM6WQKcuAtdYoqCsXSvVSu3Ij8K0HY50L8tIheOKHDl0wH1uA4zbP88etY8SIeP16NVCMCTFU+Q2DahSKheGGQ==", + "dev": true, + "requires": { + "comment-parser": "1.3.1", + "esquery": "^1.4.0", + "jsdoc-type-pratt-parser": "~2.2.5" + } + }, + "@eslint/eslintrc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.3.2", + "globals": "^13.15.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + } + }, + "@humanwhocodes/config-array": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", + "integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", "dev": true, "requires": { - "@babel/highlight": "^7.10.4" + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" } }, - "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "@humanwhocodes/gitignore-to-minimatch": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", + "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", "dev": true }, - "@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" } }, - "@eslint/eslintrc": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.1.tgz", - "integrity": "sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ==", + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "requires": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "dependencies": { - "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "requires": { - "type-fest": "^0.8.1" - } - }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - } + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" } }, "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, "@ungap/promise-all-settled": { @@ -3047,15 +2967,15 @@ "dev": true }, "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", "dev": true }, "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "requires": {} }, @@ -3078,9 +2998,9 @@ "dev": true }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -3103,36 +3023,40 @@ } }, "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "array-includes": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", - "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.5.tgz", + "integrity": "sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5", "get-intrinsic": "^1.1.1", - "is-string": "^1.0.5" + "is-string": "^1.0.7" } }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, "array.prototype.flat": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", - "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", + "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", "dev": true, "requires": { - "call-bind": "^1.0.0", + "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" } }, "assertion-error": { @@ -3141,12 +3065,6 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true - }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -3237,19 +3155,19 @@ "dev": true }, "chokidar": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", - "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "requires": { - "anymatch": "~3.1.1", + "anymatch": "~3.1.2", "braces": "~3.0.2", - "fsevents": "~2.3.1", - "glob-parent": "~5.1.0", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" + "readdirp": "~3.6.0" } }, "cliui": { @@ -3278,18 +3196,18 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "comment-parser": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.1.tgz", + "integrity": "sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA==", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "contains-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", - "dev": true - }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -3302,9 +3220,9 @@ } }, "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "requires": { "ms": "2.1.2" @@ -3332,12 +3250,13 @@ "dev": true }, "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", "dev": true, "requires": { - "object-keys": "^1.0.12" + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" } }, "diff": { @@ -3346,6 +3265,15 @@ "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -3361,46 +3289,44 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, "es-abstract": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz", - "integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz", + "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", "dev": true, "requires": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", "has": "^1.0.3", - "has-symbols": "^1.0.2", - "is-callable": "^1.2.3", - "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.2", - "is-string": "^1.0.5", - "object-inspect": "^1.9.0", + "has-property-descriptors": "^1.0.0", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.4", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.0" + "regexp.prototype.flags": "^1.4.3", + "string.prototype.trimend": "^1.0.5", + "string.prototype.trimstart": "^1.0.5", + "unbox-primitive": "^1.0.2" + } + }, + "es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "requires": { + "has": "^1.0.3" } }, "es-to-primitive": { @@ -3427,144 +3353,188 @@ "dev": true }, "eslint": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.26.0.tgz", - "integrity": "sha512-4R1ieRf52/izcZE7AlLy56uIHHDLT74Yzz2Iv2l6kDaYvEu9x+wMB5dZArVL8SYGXSYV2YAg70FcW5Y5nGGNIg==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.21.0.tgz", + "integrity": "sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA==", "dev": true, "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.1", + "@eslint/eslintrc": "^1.3.0", + "@humanwhocodes/config-array": "^0.10.4", + "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.3", "esquery": "^1.4.0", "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^13.6.0", - "ignore": "^4.0.6", + "glob-parent": "^6.0.1", + "globals": "^13.15.0", + "globby": "^11.1.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.21", - "minimatch": "^3.0.4", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "table": "^6.0.4", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + } } }, "eslint-config-prettier": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-4.3.0.tgz", - "integrity": "sha512-sZwhSTHVVz78+kYD3t5pCWSYEdVSBR0PXnwjDRsUs8ytIrK8PLXw+6FKp8r3Z7rx4ZszdetWlXYKOHoUrrwPlA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", + "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", "dev": true, - "requires": { - "get-stdin": "^6.0.0" - } + "requires": {} }, "eslint-config-tschaub": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-tschaub/-/eslint-config-tschaub-13.1.0.tgz", - "integrity": "sha512-6vlG8FuEQqzB/87AHhs91Z50FZYPwlHk/ZLMDJ9H1ELtbGuqRBkFGBGOI+RxKCgQLdmS77mEDcehhnkBMvxzvA==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/eslint-config-tschaub/-/eslint-config-tschaub-14.1.2.tgz", + "integrity": "sha512-Hk3veCDDOghs46o2HeuAnc79xt1/2oVPpnprW23yi9qgsDbHmHBqwjlxv4pb2l1PfUBNvbh5ur2o+zlCbV3kLA==", "dev": true, "requires": { - "eslint-config-prettier": "^4.1.0", - "eslint-plugin-import": "^2.17.2", - "eslint-plugin-prettier": "^3.0.1", - "prettier": "^1.17.0" + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-jsdoc": ">=38", + "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-sort-imports-es6-autofix": "^0.6.0", + "prettier": "^2.7.1" } }, "eslint-import-resolver-node": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", - "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", + "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", "dev": true, "requires": { - "debug": "^2.6.9", - "resolve": "^1.13.1" + "debug": "^3.2.7", + "resolve": "^1.20.0" }, "dependencies": { "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true } } }, "eslint-module-utils": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", - "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", + "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", "dev": true, "requires": { - "debug": "^2.6.9", - "pkg-dir": "^2.0.0" + "debug": "^3.2.7", + "find-up": "^2.1.0" }, "dependencies": { "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, - "ms": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true } } }, "eslint-plugin-import": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", - "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", "dev": true, "requires": { - "array-includes": "^3.1.1", - "array.prototype.flat": "^1.2.3", - "contains-path": "^0.1.0", + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", "debug": "^2.6.9", - "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.4", - "eslint-module-utils": "^2.6.0", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.3", "has": "^1.0.3", - "minimatch": "^3.0.4", - "object.values": "^1.1.1", - "read-pkg-up": "^2.0.0", - "resolve": "^1.17.0", - "tsconfig-paths": "^3.9.0" + "is-core-module": "^2.8.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.5", + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" }, "dependencies": { "debug": { @@ -3577,90 +3547,109 @@ } }, "doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" + "esutils": "^2.0.2" } }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true } } }, + "eslint-plugin-jsdoc": { + "version": "38.1.6", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-38.1.6.tgz", + "integrity": "sha512-n4s95oYlg0L43Bs8C0dkzIldxYf8pLCutC/tCbjIdF7VDiobuzPI+HZn9Q0BvgOvgPNgh5n7CSStql25HUG4Tw==", + "dev": true, + "requires": { + "@es-joy/jsdoccomment": "~0.22.1", + "comment-parser": "1.3.1", + "debug": "^4.3.4", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.4.0", + "regextras": "^0.8.0", + "semver": "^7.3.5", + "spdx-expression-parse": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + } + } + }, "eslint-plugin-prettier": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz", - "integrity": "sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", "dev": true, "requires": { "prettier-linter-helpers": "^1.0.0" } }, + "eslint-plugin-sort-imports-es6-autofix": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-sort-imports-es6-autofix/-/eslint-plugin-sort-imports-es6-autofix-0.6.0.tgz", + "integrity": "sha512-2NVaBGF9NN+727Fyq+jJYihdIeegjXeUUrZED9Q8FVB8MsV3YQEyXG96GVnXqWt0pmn7xfCZOZf3uKnIhBrfeQ==", + "dev": true, + "requires": {} + }, "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "dev": true, "requires": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.2.0" } }, "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "requires": { - "eslint-visitor-keys": "^1.1.0" + "eslint-visitor-keys": "^2.0.0" }, "dependencies": { "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true } } }, "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true }, "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.3.3", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.3.tgz", + "integrity": "sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==", "dev": true, "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" } }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, "esquery": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", @@ -3668,14 +3657,6 @@ "dev": true, "requires": { "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } } }, "esrecurse": { @@ -3685,20 +3666,12 @@ "dev": true, "requires": { "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } } }, "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, "esutils": { @@ -3719,6 +3692,19 @@ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "dev": true }, + "fast-glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -3731,6 +3717,15 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, "file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -3800,12 +3795,30 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + } + }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -3819,26 +3832,30 @@ "dev": true }, "get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.1" + "has-symbols": "^1.0.3" } }, - "get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", - "dev": true + "get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } }, "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -3859,18 +3876,32 @@ } }, "globals": { - "version": "13.8.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.8.0.tgz", - "integrity": "sha512-rHtdA6+PDBIjeEvA91rpqzEvk/k3/i7EeNQiryiWuJH0Hw9cpyJMAt2jtbAwUaRdhD+573X4vWw6IcjKPasi9Q==", + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", + "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "dev": true, "requires": { "type-fest": "^0.20.2" } }, - "graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + } + }, + "grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", "dev": true }, "growl": { @@ -3889,9 +3920,9 @@ } }, "has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true }, "has-flag": { @@ -3900,28 +3931,40 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.1" + } + }, "has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true }, + "has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, - "hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true }, "import-fresh": { @@ -3956,17 +3999,25 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "internal-slot": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + } }, "is-bigint": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", - "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==", - "dev": true + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "requires": { + "has-bigints": "^1.0.1" + } }, "is-binary-path": { "version": "2.1.0", @@ -3978,34 +4029,38 @@ } }, "is-boolean-object": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz", - "integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, "requires": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" } }, "is-callable": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", - "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", + "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", "dev": true }, "is-core-module": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.3.0.tgz", - "integrity": "sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", "dev": true, "requires": { "has": "^1.0.3" } }, "is-date-object": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz", - "integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==", - "dev": true + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } }, "is-extglob": { "version": "2.1.1", @@ -4020,18 +4075,18 @@ "dev": true }, "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" } }, "is-negative-zero": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", - "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", "dev": true }, "is-number": { @@ -4041,10 +4096,13 @@ "dev": true }, "is-number-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz", - "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==", - "dev": true + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } }, "is-plain-obj": { "version": "2.1.0", @@ -4053,20 +4111,32 @@ "dev": true }, "is-regex": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", - "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, "requires": { "call-bind": "^1.0.2", - "has-symbols": "^1.0.2" + "has-tostringtag": "^1.0.0" + } + }, + "is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" } }, "is-string": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz", - "integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==", - "dev": true + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } }, "is-symbol": { "version": "1.0.4", @@ -4077,34 +4147,42 @@ "has-symbols": "^1.0.2" } }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true }, + "is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" } }, + "jsdoc-type-pratt-parser": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-2.2.5.tgz", + "integrity": "sha512-2a6eRxSxp1BW040hFvaJxhsCMI9lT8QB8t14t+NY5tC5rckIR0U9cr2tjOeaFirmEOy6MHvmJnY7zTBHq431Lw==", + "dev": true + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -4136,18 +4214,6 @@ "type-check": "~0.4.0" } }, - "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" - } - }, "locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -4157,31 +4223,20 @@ "p-locate": "^5.0.0" } }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, "log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "requires": { - "chalk": "^4.0.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" } }, "lru-cache": { @@ -4193,67 +4248,76 @@ "yallist": "^4.0.0" } }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "mocha": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", - "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", + "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.5.1", - "debug": "4.3.1", + "chokidar": "3.5.3", + "debug": "4.3.3", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.1.6", + "glob": "7.2.0", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "4.0.0", - "log-symbols": "4.0.0", - "minimatch": "3.0.4", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "4.2.1", "ms": "2.1.3", - "nanoid": "3.1.20", - "serialize-javascript": "5.0.1", + "nanoid": "3.3.1", + "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", "which": "2.0.2", - "wide-align": "1.1.3", - "workerpool": "6.1.0", + "workerpool": "6.2.0", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" }, "dependencies": { - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "js-yaml": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", - "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "minimatch": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", "dev": true, "requires": { - "argparse": "^2.0.1" + "brace-expansion": "^1.1.7" } }, "ms": { @@ -4280,9 +4344,9 @@ "dev": true }, "nanoid": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", - "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", "dev": true }, "natural-compare": { @@ -4291,26 +4355,6 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -4318,9 +4362,9 @@ "dev": true }, "object-inspect": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz", - "integrity": "sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", "dev": true }, "object-keys": { @@ -4342,15 +4386,14 @@ } }, "object.values": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz", - "integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", + "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2", - "has": "^1.0.3" + "es-abstract": "^1.19.1" } }, "once": { @@ -4397,7 +4440,7 @@ "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", "dev": true }, "parent-module": { @@ -4409,15 +4452,6 @@ "callsites": "^3.0.0" } }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -4443,13 +4477,10 @@ "dev": true }, "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", - "dev": true, - "requires": { - "pify": "^2.0.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true }, "pathval": { "version": "1.1.1", @@ -4458,71 +4489,11 @@ "dev": true }, "picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", - "dev": true - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - } - } - }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -4530,9 +4501,9 @@ "dev": true }, "prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", "dev": true }, "prettier-linter-helpers": { @@ -4544,18 +4515,18 @@ "fast-diff": "^1.1.2" } }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -4565,85 +4536,36 @@ "safe-buffer": "^5.1.0" } }, - "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", - "dev": true, - "requires": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" - } - }, - "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "requires": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - } + "picomatch": "^2.2.1" } }, - "readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "regexp.prototype.flags": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", + "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", "dev": true, "requires": { - "picomatch": "^2.2.1" + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "functions-have-names": "^1.2.2" } }, "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "regextras": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.8.0.tgz", + "integrity": "sha512-k519uI04Z3SaY0fLX843MRXnDeG2+vHOFsyhiPZvNLe7r8rD2YNRjq4BQLZZ0oAr2NrtvZlICsXysGNFPGa3CQ==", "dev": true }, "require-directory": { @@ -4652,20 +4574,15 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true - }, "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "dev": true, "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" } }, "resolve-from": { @@ -4674,6 +4591,12 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -4683,6 +4606,15 @@ "glob": "^7.1.3" } }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -4690,18 +4622,18 @@ "dev": true }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" } }, "serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -4722,26 +4654,22 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "dev": true, "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" } }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true }, "spdx-exceptions": { "version": "2.3.0", @@ -4760,15 +4688,9 @@ } }, "spdx-license-ids": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", - "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", - "dev": true - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", "dev": true }, "string-width": { @@ -4783,38 +4705,40 @@ } }, "string.prototype.trimend": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", + "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" } }, "string.prototype.trimstart": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", + "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" } }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true }, "strip-json-comments": { @@ -4832,39 +4756,11 @@ "has-flag": "^4.0.0" } }, - "table": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.7.0.tgz", - "integrity": "sha512-SAM+5p6V99gYiiy2gT5ArdzgM1dLDed0nkrWmG6Fry/bUS/m9x83BwpJUOf1Qj/x2qJd+thL6IkIx7qPGRxqBw==", - "dev": true, - "requires": { - "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ajv": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.2.0.tgz", - "integrity": "sha512-WSNGFuyWd//XO8n/m/EaOlNLtO0yL8EXT/74LqT4khdhpZjP7lkj/kT5uwRmGitKEVp/Oj7ZUHeGfPtgHhQ5CA==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - } - } + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true }, "text-table": { "version": "0.2.0", @@ -4882,14 +4778,14 @@ } }, "tsconfig-paths": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", - "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", "dev": true, "requires": { "@types/json5": "^0.0.29", "json5": "^1.0.1", - "minimist": "^1.2.0", + "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, @@ -4915,14 +4811,14 @@ "dev": true }, "unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" } }, @@ -4941,16 +4837,6 @@ "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -4973,48 +4859,6 @@ "is-symbol": "^1.0.3" } }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "requires": { - "string-width": "^1.0.2 || 2" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -5022,9 +4866,9 @@ "dev": true }, "workerpool": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", - "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", + "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", "dev": true }, "wrap-ansi": { diff -Nru node-mock-fs-5.1.2/test/helper.js node-mock-fs-5.1.4/test/helper.js --- node-mock-fs-5.1.2/test/helper.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/helper.js 2022-08-04 03:14:53.000000000 +0000 @@ -9,7 +9,7 @@ /** * Chai's assert function configured to include stacks on failure. - * @type {function} + * @type {Function} */ exports.assert = chai.assert; @@ -24,7 +24,7 @@ xit: xit, describe: describe, xdescribe: xdescribe, - run: run + run: run, }; const NO_TEST = { @@ -32,10 +32,10 @@ xit: xit, describe: xdescribe, xdescribe: xdescribe, - run: noRun + run: noRun, }; -exports.inVersion = function(range) { +exports.inVersion = function (range) { if (semver.satisfies(process.version, range)) { return TEST; } else { @@ -48,7 +48,7 @@ * @param {string} str String. * @return {number} Flags. */ -exports.flags = function(str) { +exports.flags = function (str) { switch (str) { case 'r': return constants.O_RDONLY; @@ -107,7 +107,7 @@ } }; -exports.assertEqualPaths = function(actual, expected) { +exports.assertEqualPaths = function (actual, expected) { if (process.platform === 'win32') { chai.assert.equal(actual.toLowerCase(), expected.toLowerCase()); } else { diff -Nru node-mock-fs-5.1.2/test/integration/filecount.js node-mock-fs-5.1.4/test/integration/filecount.js --- node-mock-fs-5.1.2/test/integration/filecount.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/integration/filecount.js 2022-08-04 03:14:53.000000000 +0000 @@ -11,8 +11,8 @@ if (total === 0) { callback(null, 0); } - items.forEach(function(item) { - fs.stat(path.join(dir, item), function(err, stats) { + items.forEach(function (item) { + fs.stat(path.join(dir, item), function (err, stats) { if (err) { return callback(err); } @@ -32,8 +32,8 @@ * @param {string} dir Path to directory. * @param {function(Error, number)} callback Callback. */ -module.exports = exports = function(dir, callback) { - fs.readdir(dir, function(err, items) { +module.exports = function (dir, callback) { + fs.readdir(dir, function (err, items) { if (err) { return callback(err); } diff -Nru node-mock-fs-5.1.2/test/integration/filecount.spec.js node-mock-fs-5.1.4/test/integration/filecount.spec.js --- node-mock-fs-5.1.2/test/integration/filecount.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/integration/filecount.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,28 +1,28 @@ /* eslint-env mocha */ 'use strict'; -const mock = require('../../lib/index'); -const assert = require('../helper').assert; +const mock = require('../../lib/index.js'); +const assert = require('../helper.js').assert; -const count = require('./filecount'); +const count = require('./filecount.js'); -describe('count(dir, callback)', function() { - beforeEach(function() { +describe('count(dir, callback)', function () { + beforeEach(function () { mock({ 'path/to/dir': { 'one.txt': 'first file', 'two.txt': 'second file', 'empty-dir': {}, 'another-dir': { - 'another.txt': 'more files' - } - } + 'another.txt': 'more files', + }, + }, }); }); afterEach(mock.restore); - it('counts files in a directory', function(done) { - count('path/to/dir', function(err, num) { + it('counts files in a directory', function (done) { + count('path/to/dir', function (err, num) { if (err) { return done(err); } @@ -31,8 +31,8 @@ }); }); - it('counts files in another directory', function(done) { - count('path/to/dir/another-dir', function(err, num) { + it('counts files in another directory', function (done) { + count('path/to/dir/another-dir', function (err, num) { if (err) { return done(err); } @@ -41,8 +41,8 @@ }); }); - it('counts files in an empty directory', function(done) { - count('path/to/dir/empty-dir', function(err, num) { + it('counts files in an empty directory', function (done) { + count('path/to/dir/empty-dir', function (err, num) { if (err) { return done(err); } @@ -51,8 +51,8 @@ }); }); - it('fails for bogus path', function(done) { - count('path/to/dir/bogus', function(err, num) { + it('fails for bogus path', function (done) { + count('path/to/dir/bogus', function (err, num) { assert.instanceOf(err, Error); assert.isUndefined(num); done(); diff -Nru node-mock-fs-5.1.2/test/lib/binding.spec.js node-mock-fs-5.1.4/test/lib/binding.spec.js --- node-mock-fs-5.1.2/test/lib/binding.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/binding.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,22 +1,21 @@ 'use strict'; const path = require('path'); - -const Binding = require('../../lib/binding'); -const Directory = require('../../lib/directory'); -const SymbolicLink = require('../../lib/symlink'); -const File = require('../../lib/file'); -const FileSystem = require('../../lib/filesystem'); -const helper = require('../helper'); +const Binding = require('../../lib/binding.js'); +const Directory = require('../../lib/directory.js'); +const SymbolicLink = require('../../lib/symlink.js'); +const File = require('../../lib/file.js'); +const FileSystem = require('../../lib/filesystem.js'); +const helper = require('../helper.js'); const constants = require('constants'); const assert = helper.assert; const assertEqualPaths = helper.assertEqualPaths; const flags = helper.flags; -describe('Binding', function() { +describe('Binding', function () { let system; - beforeEach(function() { + beforeEach(function () { system = FileSystem.create({ 'mock-dir': { 'one.txt': 'one content', @@ -26,7 +25,7 @@ atime: new Date(1), ctime: new Date(2), mtime: new Date(3), - birthtime: new Date(4) + birthtime: new Date(4), }), 'one-link.txt': FileSystem.symlink({path: './one.txt'}), 'one-link2.txt': FileSystem.symlink({path: './one-link.txt'}), @@ -39,30 +38,30 @@ atime: new Date(1), ctime: new Date(2), mtime: new Date(3), - birthtime: new Date(4) + birthtime: new Date(4), }), - 'b.txt': 'b content' + 'b.txt': 'b content', }, 'dir-link': FileSystem.symlink({path: './non-empty'}), 'dir-link2': FileSystem.symlink({path: './dir-link'}), - 'dead-link': FileSystem.symlink({path: './non-a-real-file'}) - } + 'dead-link': FileSystem.symlink({path: './non-a-real-file'}), + }, }); }); - describe('constructor', function() { - it('creates a new instance', function() { + describe('constructor', function () { + it('creates a new instance', function () { const binding = new Binding(system); assert.instanceOf(binding, Binding); }); }); - describe('#getSystem()', function() { + describe('#getSystem()', function () { const binding = new Binding(system); assert.equal(binding.getSystem(), system); }); - describe('#setSystem()', function() { + describe('#setSystem()', function () { const firstSystem = new FileSystem(); const binding = new Binding(firstSystem); assert.equal(binding.getSystem(), firstSystem); @@ -71,50 +70,52 @@ assert.equal(binding.getSystem(), system); }); - describe('#stat()', function() { - it('calls callback with a Stats instance', function(done) { + describe('#stat()', function () { + it('calls callback with a Stats instance', function (done) { const binding = new Binding(system); - binding.stat(path.join('mock-dir', 'one.txt'), false, function( - err, - stats - ) { - if (err) { - return done(err); + binding.stat( + path.join('mock-dir', 'one.txt'), + false, + function (err, stats) { + if (err) { + return done(err); + } + assert.instanceOf(stats, Float64Array); + done(); } - assert.instanceOf(stats, Float64Array); - done(); - }); + ); }); - it('returns a Stats instance when called synchronously', function() { + it('returns a Stats instance when called synchronously', function () { const binding = new Binding(system); const stats = binding.stat(path.join('mock-dir', 'one.txt'), false); assert.instanceOf(stats, Float64Array); }); - it('identifies files (async)', function(done) { + it('identifies files (async)', function (done) { const binding = new Binding(system); - binding.stat(path.join('mock-dir', 'one.txt'), false, function( - err, - stats - ) { - if (err) { - return done(err); + binding.stat( + path.join('mock-dir', 'one.txt'), + false, + function (err, stats) { + if (err) { + return done(err); + } + assert.equal(stats[1] & constants.S_IFMT, constants.S_IFREG); + done(); } - assert.equal(stats[1] & constants.S_IFMT, constants.S_IFREG); - done(); - }); + ); }); - it('identifies files (sync)', function() { + it('identifies files (sync)', function () { const binding = new Binding(system); const stats = binding.stat(path.join('mock-dir', 'one.txt'), false); assert.equal(stats[1] & constants.S_IFMT, constants.S_IFREG); }); - it('identifies directories (async)', function(done) { + it('identifies directories (async)', function (done) { const binding = new Binding(system); - binding.stat('mock-dir', false, function(err, stats) { + binding.stat('mock-dir', false, function (err, stats) { if (err) { return done(err); } @@ -123,97 +124,101 @@ }); }); - it('identifies directories (sync)', function() { + it('identifies directories (sync)', function () { const binding = new Binding(system); const stats = binding.stat('mock-dir', false); assert.equal(stats[1] & constants.S_IFMT, constants.S_IFDIR); }); - it('includes atime, ctime, mtime and birthtime', function(done) { + it('includes atime, ctime, mtime and birthtime', function (done) { const binding = new Binding(system); - binding.stat(path.join('mock-dir', 'two.txt'), false, function( - err, - stats - ) { - if (err) { - return done(err); + binding.stat( + path.join('mock-dir', 'two.txt'), + false, + function (err, stats) { + if (err) { + return done(err); + } + assert.equal( + stats[10] * 1000 + stats[11] / 1000000, + new Date(1).getTime() + ); + assert.equal( + stats[12] * 1000 + stats[13] / 1000000, + new Date(3).getTime() + ); + assert.equal( + stats[14] * 1000 + stats[15] / 1000000, + new Date(2).getTime() + ); + assert.equal( + stats[16] * 1000 + stats[17] / 1000000, + new Date(4).getTime() + ); + done(); } - assert.equal( - stats[10] * 1000 + stats[11] / 1000000, - new Date(1).getTime() - ); - assert.equal( - stats[12] * 1000 + stats[13] / 1000000, - new Date(3).getTime() - ); - assert.equal( - stats[14] * 1000 + stats[15] / 1000000, - new Date(2).getTime() - ); - assert.equal( - stats[16] * 1000 + stats[17] / 1000000, - new Date(4).getTime() - ); - done(); - }); + ); }); - it('includes mode with file permissions (default)', function(done) { + it('includes mode with file permissions (default)', function (done) { const binding = new Binding(system); - binding.stat(path.join('mock-dir', 'one.txt'), false, function( - err, - stats - ) { - if (err) { - return done(err); + binding.stat( + path.join('mock-dir', 'one.txt'), + false, + function (err, stats) { + if (err) { + return done(err); + } + assert.equal(stats[1] & parseInt('0777', 8), parseInt('0666', 8)); + done(); } - assert.equal(stats[1] & parseInt('0777', 8), parseInt('0666', 8)); - done(); - }); + ); }); - it('includes mode with file permissions (custom)', function(done) { + it('includes mode with file permissions (custom)', function (done) { const binding = new Binding(system); - binding.stat(path.join('mock-dir', 'two.txt'), false, function( - err, - stats - ) { - if (err) { - return done(err); + binding.stat( + path.join('mock-dir', 'two.txt'), + false, + function (err, stats) { + if (err) { + return done(err); + } + assert.equal(stats[1] & parseInt('0777', 8), parseInt('0644', 8)); + done(); } - assert.equal(stats[1] & parseInt('0777', 8), parseInt('0644', 8)); - done(); - }); + ); }); - it('includes size in bytes (async)', function(done) { + it('includes size in bytes (async)', function (done) { const binding = new Binding(system); - binding.stat(path.join('mock-dir', 'two.txt'), false, function( - err, - stats - ) { - if (err) { - return done(err); + binding.stat( + path.join('mock-dir', 'two.txt'), + false, + function (err, stats) { + if (err) { + return done(err); + } + assert.equal(stats[8], 11); + done(); } - assert.equal(stats[8], 11); - done(); - }); + ); }); - it('includes size in bytes (sync)', function() { + it('includes size in bytes (sync)', function () { const binding = new Binding(system); const stats = binding.stat(path.join('mock-dir', 'three.bin'), false); assert.equal(stats[8], 3); }); - it('includes non-zero size for directories', function() { + it('includes non-zero size for directories', function () { const binding = new Binding(system); const stats = binding.stat('mock-dir', false); assert.isNumber(stats[8]); assert.isTrue(stats[8] > 0); }); - it('includes uid for files', function() { + it('includes uid for files', function () { const binding = new Binding(system); const stats = binding.stat(path.join('mock-dir', 'two.txt'), false); if (process.getuid) { @@ -221,7 +226,7 @@ } }); - it('includes uid for directories', function() { + it('includes uid for directories', function () { const binding = new Binding(system); const stats = binding.stat(path.join('mock-dir', 'empty'), false); if (process.getuid) { @@ -229,7 +234,7 @@ } }); - it('includes gid for files', function() { + it('includes gid for files', function () { const binding = new Binding(system); const stats = binding.stat(path.join('mock-dir', 'two.txt'), false); if (process.getgid) { @@ -237,7 +242,7 @@ } }); - it('includes gid for directories', function() { + it('includes gid for directories', function () { const binding = new Binding(system); const stats = binding.stat(path.join('mock-dir', 'empty'), false); if (process.getgid) { @@ -245,7 +250,7 @@ } }); - it('retrieves stats of files relative to symbolic linked directories', function() { + it('retrieves stats of files relative to symbolic linked directories', function () { const binding = new Binding(system); const stats = binding.stat( path.join('mock-dir', 'dir-link', 'a.txt'), @@ -262,10 +267,10 @@ }); }); - describe('#realpath()', function() { - it('returns the real path for a regular file', function(done) { + describe('#realpath()', function () { + it('returns the real path for a regular file', function (done) { const binding = new Binding(system); - binding.realpath('mock-dir/one.txt', 'utf-8', function(err, realPath) { + binding.realpath('mock-dir/one.txt', 'utf-8', function (err, realPath) { if (err) { return done(err); } @@ -274,9 +279,9 @@ }); }); - it('returns the real path for a directory', function(done) { + it('returns the real path for a directory', function (done) { const binding = new Binding(system); - binding.realpath('mock-dir/empty', 'utf-8', function(err, realPath) { + binding.realpath('mock-dir/empty', 'utf-8', function (err, realPath) { if (err) { return done(err); } @@ -285,37 +290,39 @@ }); }); - it('returns the real path for a symlinked file', function(done) { + it('returns the real path for a symlinked file', function (done) { const binding = new Binding(system); - binding.realpath('mock-dir/one-link.txt', 'utf-8', function( - err, - realPath - ) { - if (err) { - return done(err); + binding.realpath( + 'mock-dir/one-link.txt', + 'utf-8', + function (err, realPath) { + if (err) { + return done(err); + } + assertEqualPaths(realPath, path.resolve('mock-dir/one.txt')); + done(); } - assertEqualPaths(realPath, path.resolve('mock-dir/one.txt')); - done(); - }); + ); }); - it('returns the real path for a deeply symlinked file', function(done) { + it('returns the real path for a deeply symlinked file', function (done) { const binding = new Binding(system); - binding.realpath('mock-dir/one-link2.txt', 'utf-8', function( - err, - realPath - ) { - if (err) { - return done(err); + binding.realpath( + 'mock-dir/one-link2.txt', + 'utf-8', + function (err, realPath) { + if (err) { + return done(err); + } + assertEqualPaths(realPath, path.resolve('mock-dir/one.txt')); + done(); } - assertEqualPaths(realPath, path.resolve('mock-dir/one.txt')); - done(); - }); + ); }); - it('returns the real path for a symlinked directory', function(done) { + it('returns the real path for a symlinked directory', function (done) { const binding = new Binding(system); - binding.realpath('mock-dir/dir-link', 'utf-8', function(err, realPath) { + binding.realpath('mock-dir/dir-link', 'utf-8', function (err, realPath) { if (err) { return done(err); } @@ -324,9 +331,9 @@ }); }); - it('returns the real path for a deeply symlinked directory', function(done) { + it('returns the real path for a deeply symlinked directory', function (done) { const binding = new Binding(system); - binding.realpath('mock-dir/dir-link2', 'utf-8', function(err, realPath) { + binding.realpath('mock-dir/dir-link2', 'utf-8', function (err, realPath) { if (err) { return done(err); } @@ -335,37 +342,39 @@ }); }); - it('returns the real path for a file in a symlinked directory', function(done) { + it('returns the real path for a file in a symlinked directory', function (done) { const binding = new Binding(system); - binding.realpath('mock-dir/dir-link/b.txt', 'utf-8', function( - err, - realPath - ) { - if (err) { - return done(err); + binding.realpath( + 'mock-dir/dir-link/b.txt', + 'utf-8', + function (err, realPath) { + if (err) { + return done(err); + } + assertEqualPaths(realPath, path.resolve('mock-dir/non-empty/b.txt')); + done(); } - assertEqualPaths(realPath, path.resolve('mock-dir/non-empty/b.txt')); - done(); - }); + ); }); - it('accepts a buffer', function(done) { + it('accepts a buffer', function (done) { const binding = new Binding(system); - binding.realpath(Buffer.from('mock-dir/one.txt'), 'utf-8', function( - err, - realPath - ) { - if (err) { - return done(err); + binding.realpath( + Buffer.from('mock-dir/one.txt'), + 'utf-8', + function (err, realPath) { + if (err) { + return done(err); + } + assertEqualPaths(realPath, path.resolve('mock-dir/one.txt')); + done(); } - assertEqualPaths(realPath, path.resolve('mock-dir/one.txt')); - done(); - }); + ); }); - it('can return a buffer', function(done) { + it('can return a buffer', function (done) { const binding = new Binding(system); - binding.realpath('mock-dir/one.txt', 'buffer', function(err, realPath) { + binding.realpath('mock-dir/one.txt', 'buffer', function (err, realPath) { if (err) { return done(err); } @@ -375,37 +384,42 @@ }); }); - it('throws ENOENT for a non-existent file', function(done) { + it('throws ENOENT for a non-existent file', function (done) { const binding = new Binding(system); - binding.realpath('mock-dir/bogus-path', 'utf-8', function(err, realPath) { - if (!err || realPath) { - return done(new Error('Expected ENOENT')); + binding.realpath( + 'mock-dir/bogus-path', + 'utf-8', + function (err, realPath) { + if (!err || realPath) { + return done(new Error('Expected ENOENT')); + } + assert.equal(err.code, 'ENOENT'); + done(); } - assert.equal(err.code, 'ENOENT'); - done(); - }); + ); }); - it('throws ENOTDIR for a file treated like a directory', function(done) { + it('throws ENOTDIR for a file treated like a directory', function (done) { const binding = new Binding(system); - binding.realpath('mock-dir/one.txt/foo', 'utf-8', function( - err, - realPath - ) { - if (!err || realPath) { - return done(new Error('Expected ENOTDIR')); + binding.realpath( + 'mock-dir/one.txt/foo', + 'utf-8', + function (err, realPath) { + if (!err || realPath) { + return done(new Error('Expected ENOTDIR')); + } + assert.equal(err.code, 'ENOTDIR'); + done(); } - assert.equal(err.code, 'ENOTDIR'); - done(); - }); + ); }); }); - describe('#fstat()', function() { - it('calls callback with a Stats instance', function(done) { + describe('#fstat()', function () { + it('calls callback with a Stats instance', function (done) { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'one.txt'), flags('r')); - binding.fstat(fd, false, function(err, stats) { + binding.fstat(fd, false, function (err, stats) { if (err) { return done(err); } @@ -414,17 +428,17 @@ }); }); - it('returns a Stats instance when called synchronously', function() { + it('returns a Stats instance when called synchronously', function () { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'one.txt'), flags('r')); const stats = binding.fstat(fd, false); assert.instanceOf(stats, Float64Array); }); - it('identifies files (async)', function(done) { + it('identifies files (async)', function (done) { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'one.txt'), flags('r')); - binding.fstat(fd, false, function(err, stats) { + binding.fstat(fd, false, function (err, stats) { if (err) { return done(err); } @@ -433,10 +447,10 @@ }); }); - it('identifies directories (async)', function(done) { + it('identifies directories (async)', function (done) { const binding = new Binding(system); const fd = binding.open('mock-dir', flags('r')); - binding.fstat(fd, false, function(err, stats) { + binding.fstat(fd, false, function (err, stats) { if (err) { return done(err); } @@ -445,10 +459,10 @@ }); }); - it('includes size in bytes (async)', function(done) { + it('includes size in bytes (async)', function (done) { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'two.txt'), flags('r')); - binding.fstat(fd, false, function(err, stats) { + binding.fstat(fd, false, function (err, stats) { if (err) { return done(err); } @@ -457,14 +471,14 @@ }); }); - it('includes size in bytes (sync)', function() { + it('includes size in bytes (sync)', function () { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'three.bin'), flags('r')); const stats = binding.fstat(fd, false); assert.equal(stats[8], 3); }); - it('includes non-zero size for directories', function() { + it('includes non-zero size for directories', function () { const binding = new Binding(system); const fd = binding.open('mock-dir', flags('r')); const stats = binding.fstat(fd, false); @@ -473,10 +487,10 @@ }); }); - describe('#readdir()', function() { - it('calls callback with file list', function(done) { + describe('#readdir()', function () { + it('calls callback with file list', function (done) { const binding = new Binding(system); - binding.readdir('mock-dir', 'utf8', false, function(err, items) { + binding.readdir('mock-dir', 'utf8', false, function (err, items) { assert.isNull(err); assert.isArray(items); assert.deepEqual(items.sort(), [ @@ -489,21 +503,21 @@ 'one-link2.txt', 'one.txt', 'three.bin', - 'two.txt' + 'two.txt', ]); done(); }); }); - it('accepts "buffer" encoding', function(done) { + it('accepts "buffer" encoding', function (done) { const binding = new Binding(system); - binding.readdir('mock-dir', 'buffer', false, function(err, items) { + binding.readdir('mock-dir', 'buffer', false, function (err, items) { assert.isNull(err); assert.isArray(items); - items.forEach(function(item) { + items.forEach(function (item) { assert.equal(Buffer.isBuffer(item), true); }); - const strings = items.map(function(item) { + const strings = items.map(function (item) { return item.toString(); }); assert.deepEqual(strings.sort(), [ @@ -516,13 +530,13 @@ 'one-link2.txt', 'one.txt', 'three.bin', - 'two.txt' + 'two.txt', ]); done(); }); }); - it('returns a file list (sync)', function() { + it('returns a file list (sync)', function () { const binding = new Binding(system); const items = binding.readdir('mock-dir', 'utf8', false); assert.isArray(items); @@ -536,17 +550,17 @@ 'one-link2.txt', 'one.txt', 'three.bin', - 'two.txt' + 'two.txt', ]); }); - it('calls callback with file list for symbolic linked dir', function(done) { + it('calls callback with file list for symbolic linked dir', function (done) { const binding = new Binding(system); binding.readdir( path.join('mock-dir', 'dir-link'), 'utf8', false, - function(err, items) { + function (err, items) { assert.isNull(err); assert.isArray(items); assert.deepEqual(items.sort(), ['a.txt', 'b.txt']); @@ -555,13 +569,13 @@ ); }); - it('calls callback with file list for link to symbolic linked dir', function(done) { + it('calls callback with file list for link to symbolic linked dir', function (done) { const binding = new Binding(system); binding.readdir( path.join('mock-dir', 'dir-link2'), 'utf8', false, - function(err, items) { + function (err, items) { assert.isNull(err); assert.isArray(items); assert.deepEqual(items.sort(), ['a.txt', 'b.txt']); @@ -570,7 +584,7 @@ ); }); - it('calls callback with file list for symbolic linked dir (sync)', function() { + it('calls callback with file list for symbolic linked dir (sync)', function () { const binding = new Binding(system); const items = binding.readdir( path.join('mock-dir', 'dir-link'), @@ -581,34 +595,36 @@ assert.deepEqual(items.sort(), ['a.txt', 'b.txt']); }); - it('calls callback with error for bogus dir', function(done) { + it('calls callback with error for bogus dir', function (done) { const binding = new Binding(system); - binding.readdir('bogus', 'utf8', false, function(err, items) { + binding.readdir('bogus', 'utf8', false, function (err, items) { assert.instanceOf(err, Error); assert.isUndefined(items); done(); }); }); - it('calls callback with error for file path', function(done) { + it('calls callback with error for file path', function (done) { const binding = new Binding(system); - binding.readdir(path.join('mock-dir', 'one.txt'), 'utf8', false, function( - err, - items - ) { - assert.instanceOf(err, Error); - assert.isUndefined(items); - done(); - }); + binding.readdir( + path.join('mock-dir', 'one.txt'), + 'utf8', + false, + function (err, items) { + assert.instanceOf(err, Error); + assert.isUndefined(items); + done(); + } + ); }); - it('calls callback with error for dead symbolic link', function(done) { + it('calls callback with error for dead symbolic link', function (done) { const binding = new Binding(system); binding.readdir( path.join('mock-dir', 'dead-link'), 'utf8', false, - function(err, items) { + function (err, items) { assert.instanceOf(err, Error); assert.isUndefined(items); done(); @@ -616,13 +632,13 @@ ); }); - it('calls callback with error for symbolic link to file', function(done) { + it('calls callback with error for symbolic link to file', function (done) { const binding = new Binding(system); binding.readdir( path.join('mock-dir', 'one-link.txt'), 'utf8', false, - function(err, items) { + function (err, items) { assert.instanceOf(err, Error); assert.isUndefined(items); done(); @@ -630,13 +646,13 @@ ); }); - it('calls callback with error for link to symbolic link to file', function(done) { + it('calls callback with error for link to symbolic link to file', function (done) { const binding = new Binding(system); binding.readdir( path.join('mock-dir', 'one-link2.txt'), 'utf8', false, - function(err, items) { + function (err, items) { assert.instanceOf(err, Error); assert.isUndefined(items); done(); @@ -645,27 +661,27 @@ }); }); - describe('#open()', function() { - it('creates a file descriptor for reading (r)', function() { + describe('#open()', function () { + it('creates a file descriptor for reading (r)', function () { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'one.txt'), flags('r')); assert.isNumber(fd); }); - it('generates error if file does not exist (r)', function() { + it('generates error if file does not exist (r)', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.open('bogus', flags('r')); }); }); - it('creates a file descriptor for reading and writing (r+)', function() { + it('creates a file descriptor for reading and writing (r+)', function () { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'one.txt'), flags('r+')); assert.isNumber(fd); }); - it('does not truncate (r+)', function() { + it('does not truncate (r+)', function () { const binding = new Binding(system); binding.open(path.join('mock-dir', 'two.txt'), flags('r+')); const file = system.getItem(path.join('mock-dir', 'two.txt')); @@ -673,40 +689,40 @@ assert.equal(String(file.getContent()), 'two content'); }); - it('generates error if file does not exist (r+)', function() { + it('generates error if file does not exist (r+)', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.open('bogus', flags('r+')); }); }); - it('creates a file descriptor for reading (rs)', function() { + it('creates a file descriptor for reading (rs)', function () { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'two.txt'), flags('rs')); assert.isNumber(fd); }); - it('generates error if file does not exist (rs)', function() { + it('generates error if file does not exist (rs)', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.open('bogus', flags('rs')); }); }); - it('creates a file descriptor for reading and writing (rs+)', function() { + it('creates a file descriptor for reading and writing (rs+)', function () { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'two.txt'), flags('rs+')); assert.isNumber(fd); }); - it('generates error if file does not exist (rs+)', function() { + it('generates error if file does not exist (rs+)', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.open('bogus', flags('rs+')); }); }); - it('opens a new file for writing (w)', function() { + it('opens a new file for writing (w)', function () { const binding = new Binding(system); binding.open('new.txt', flags('w'), parseInt('0644', 8)); const file = system.getItem('new.txt'); @@ -714,7 +730,7 @@ assert.equal(file.getMode(), parseInt('0644', 8)); }); - it('truncates an existing file for writing (w)', function() { + it('truncates an existing file for writing (w)', function () { const binding = new Binding(system); binding.open( path.join('mock-dir', 'two.txt'), @@ -726,21 +742,21 @@ assert.equal(String(file.getContent()), ''); }); - it('generates error if file is directory (w)', function() { + it('generates error if file is directory (w)', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.open('mock-dir', flags('w')); }); }); - it('generates error if file exists (wx)', function() { + it('generates error if file exists (wx)', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.open(path.join('mock-dir', 'two.txt'), flags('wx')); }); }); - it('opens a new file for reading and writing (w+)', function() { + it('opens a new file for reading and writing (w+)', function () { const binding = new Binding(system); binding.open('new.txt', flags('w+'), parseInt('0644', 8)); const file = system.getItem('new.txt'); @@ -749,7 +765,7 @@ assert.equal(String(file.getContent()), ''); }); - it('truncates an existing file for writing (w+)', function() { + it('truncates an existing file for writing (w+)', function () { const binding = new Binding(system); binding.open( path.join('mock-dir', 'one.txt'), @@ -761,7 +777,7 @@ assert.equal(String(file.getContent()), ''); }); - it('opens a new file for reading and writing (wx+)', function() { + it('opens a new file for reading and writing (wx+)', function () { const binding = new Binding(system); binding.open('new.txt', flags('wx+'), parseInt('0644', 8)); const file = system.getItem('new.txt'); @@ -770,9 +786,9 @@ assert.equal(String(file.getContent()), ''); }); - it('generates error if file exists (wx+)', function() { + it('generates error if file exists (wx+)', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.open( path.join('mock-dir', 'one.txt'), flags('wx+'), @@ -781,7 +797,7 @@ }); }); - it('opens a new file for appending (a)', function() { + it('opens a new file for appending (a)', function () { const binding = new Binding(system); binding.open('new.txt', flags('a'), parseInt('0666', 8)); const file = system.getItem('new.txt'); @@ -790,7 +806,7 @@ assert.equal(String(file.getContent()), ''); }); - it('opens an existing file for appending (a)', function() { + it('opens an existing file for appending (a)', function () { const binding = new Binding(system); binding.open( path.join('mock-dir', 'one.txt'), @@ -802,14 +818,14 @@ assert.equal(String(file.getContent()), 'one content'); }); - it('generates error if file is directory (a)', function() { + it('generates error if file is directory (a)', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.open('mock-dir', flags('a')); }); }); - it('opens a new file for appending (ax)', function() { + it('opens a new file for appending (ax)', function () { const binding = new Binding(system); binding.open('new.txt', flags('ax'), parseInt('0664', 8)); const file = system.getItem('new.txt'); @@ -818,9 +834,9 @@ assert.equal(String(file.getContent()), ''); }); - it('generates error if file exists (ax)', function() { + it('generates error if file exists (ax)', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.open( path.join('mock-dir', 'one.txt'), flags('ax'), @@ -829,7 +845,7 @@ }); }); - it('opens a new file for appending and reading (a+)', function() { + it('opens a new file for appending and reading (a+)', function () { const binding = new Binding(system); binding.open('new.txt', flags('a+'), parseInt('0666', 8)); const file = system.getItem('new.txt'); @@ -838,7 +854,7 @@ assert.equal(String(file.getContent()), ''); }); - it('opens an existing file for appending and reading (a+)', function() { + it('opens an existing file for appending and reading (a+)', function () { const binding = new Binding(system); binding.open( path.join('mock-dir', 'one.txt'), @@ -850,7 +866,7 @@ assert.equal(String(file.getContent()), 'two content'); }); - it('opens a new file for appending and reading (ax+)', function() { + it('opens a new file for appending and reading (ax+)', function () { const binding = new Binding(system); binding.open('new.txt', flags('ax+'), parseInt('0666', 8)); const file = system.getItem('new.txt'); @@ -859,9 +875,9 @@ assert.equal(String(file.getContent()), ''); }); - it('opens an existing file for appending and reading (ax+)', function() { + it('opens an existing file for appending and reading (ax+)', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.open( path.join('mock-dir', 'two.txt'), flags('ax+'), @@ -871,25 +887,25 @@ }); }); - describe('#close()', function() { - it('closes an existing file descriptor', function() { + describe('#close()', function () { + it('closes an existing file descriptor', function () { const binding = new Binding(system); const fd = binding.open('new.txt', flags('w'), parseInt('0644', 8)); binding.close(fd); }); - it('fails for closed file descriptor', function() { + it('fails for closed file descriptor', function () { const binding = new Binding(system); const fd = binding.open('new.txt', flags('w'), parseInt('0644', 8)); binding.close(fd); - assert.throws(function() { + assert.throws(function () { binding.close(fd); }); }); }); - describe('#read()', function() { - it('reads from a file', function() { + describe('#read()', function () { + it('reads from a file', function () { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'two.txt'), flags('r')); const buffer = Buffer.alloc(11); @@ -898,7 +914,7 @@ assert.equal(String(buffer), 'two content'); }); - it('reads into a Uint8Array', function() { + it('reads into a Uint8Array', function () { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'three.bin'), flags('r')); const buffer = new Uint8Array(3); @@ -907,7 +923,7 @@ assert.deepEqual(Array.from(buffer), [1, 2, 3]); }); - it('interprets null position as current position', function() { + it('interprets null position as current position', function () { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'one.txt'), flags('r')); const buffer = Buffer.alloc(4); @@ -925,7 +941,7 @@ assert.equal(String(buffer.slice(0, 3)), 'ent'); }); - it('reads from a symbolic link', function() { + it('reads from a symbolic link', function () { const binding = new Binding(system); const fd = binding.open( path.join('mock-dir', 'one-link.txt'), @@ -937,7 +953,7 @@ assert.equal(String(buffer), 'one content'); }); - it('reads from a deeply linked symlink', function() { + it('reads from a deeply linked symlink', function () { const binding = new Binding(system); const fd = binding.open( path.join('mock-dir', 'one-link2.txt'), @@ -949,18 +965,18 @@ assert.equal(String(buffer), 'one content'); }); - it('throws if not open for reading', function() { + it('throws if not open for reading', function () { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'two.txt'), flags('w')); const buffer = Buffer.alloc(11); - assert.throws(function() { + assert.throws(function () { binding.read(fd, buffer, 0, 11, 0); }); }); - it('throws ENOTDIR when trying to open an incorrect path (nested under existing file)', function() { + it('throws ENOTDIR when trying to open an incorrect path (nested under existing file)', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.open( path.join('mock-dir', 'two.txt', 'bogus-path'), flags('r') @@ -969,8 +985,8 @@ }); }); - describe('#writeBuffers()', function() { - it('writes to a file', function() { + describe('#writeBuffers()', function () { + it('writes to a file', function () { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'new.txt'), flags('w')); const buffers = [Buffer.from('new '), Buffer.from('content')]; @@ -983,7 +999,7 @@ assert.equal(String(content), 'new content'); }); - it('can append to a file', function() { + it('can append to a file', function () { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'one.txt'), flags('a')); const buffers = [Buffer.from(' more'), Buffer.from(' content')]; @@ -996,7 +1012,7 @@ assert.equal(String(content), 'one content more content'); }); - it('can overwrite part of a file', function() { + it('can overwrite part of a file', function () { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'one.txt'), flags('a')); const buffers = [Buffer.from('n'), Buffer.from('e'), Buffer.from('w')]; @@ -1009,22 +1025,22 @@ assert.equal(String(content), 'new content'); }); - it('throws if not open for writing', function() { + it('throws if not open for writing', function () { const binding = new Binding(system); const fd = binding.open(path.join('mock-dir', 'two.txt'), flags('r')); const buffers = [Buffer.from('some content')]; - assert.throws(function() { + assert.throws(function () { binding.writeBuffers(fd, buffers); }); }); }); - describe('#rename()', function() { - it('allows files to be renamed', function(done) { + describe('#rename()', function () { + it('allows files to be renamed', function (done) { const binding = new Binding(system); const oldPath = path.join('mock-dir', 'one.txt'); const newPath = path.join('mock-dir', 'empty', 'new.txt'); - binding.rename(oldPath, newPath, function(_) { + binding.rename(oldPath, newPath, function (_) { const stats = binding.stat(newPath); assert.equal(stats[1] & constants.S_IFMT, constants.S_IFREG); assert.equal(stats[8], 11); @@ -1032,7 +1048,7 @@ }); }); - it('allows files to be renamed (sync)', function() { + it('allows files to be renamed (sync)', function () { const binding = new Binding(system); const oldPath = path.join('mock-dir', 'one.txt'); const newPath = path.join('mock-dir', 'new.txt'); @@ -1042,7 +1058,7 @@ assert.equal(stats[8], 11); }); - it('replaces existing files (sync)', function() { + it('replaces existing files (sync)', function () { const binding = new Binding(system); const oldPath = path.join('mock-dir', 'one.txt'); const newPath = path.join('mock-dir', 'two.txt'); @@ -1052,18 +1068,18 @@ assert.equal(stats[8], 11); }); - it('allows directories to be renamed', function(done) { + it('allows directories to be renamed', function (done) { const binding = new Binding(system); const oldPath = path.join('mock-dir', 'empty'); const newPath = path.join('mock-dir', 'new'); - binding.rename(oldPath, newPath, function(_) { + binding.rename(oldPath, newPath, function (_) { const stats = binding.stat(newPath); assert.equal(stats[1] & constants.S_IFMT, constants.S_IFDIR); done(); }); }); - it('allows directories to be renamed (sync)', function() { + it('allows directories to be renamed (sync)', function () { const binding = new Binding(system); const oldPath = path.join('mock-dir'); const newPath = path.join('new-dir'); @@ -1082,43 +1098,43 @@ 'one-link2.txt', 'one.txt', 'three.bin', - 'two.txt' + 'two.txt', ]); }); - it('calls callback with error for bogus old path', function(done) { + it('calls callback with error for bogus old path', function (done) { const binding = new Binding(system); const oldPath = path.join('mock-dir', 'bogus'); const newPath = path.join('mock-dir', 'new'); - binding.rename(oldPath, newPath, function(err) { + binding.rename(oldPath, newPath, function (err) { assert.instanceOf(err, Error); done(); }); }); - it('calls callback with error for file->dir rename', function(done) { + it('calls callback with error for file->dir rename', function (done) { const binding = new Binding(system); const oldPath = path.join('mock-dir', 'one.txt'); const newPath = path.join('mock-dir', 'empty'); - binding.rename(oldPath, newPath, function(err) { + binding.rename(oldPath, newPath, function (err) { assert.instanceOf(err, Error); done(); }); }); - it('calls callback with error for dir->file rename', function(done) { + it('calls callback with error for dir->file rename', function (done) { const binding = new Binding(system); const oldPath = path.join('mock-dir', 'one.txt'); const newPath = path.join('mock-dir', 'empty'); - binding.rename(oldPath, newPath, function(err) { + binding.rename(oldPath, newPath, function (err) { assert.instanceOf(err, Error); done(); }); }); }); - describe('#mkdir()', function() { - it('creates a new directory', function() { + describe('#mkdir()', function () { + it('creates a new directory', function () { const binding = new Binding(system); const dirPath = path.join('mock-dir', 'foo'); binding.mkdir(dirPath, parseInt('0755', 8), false); @@ -1127,33 +1143,33 @@ assert.equal(dir.getMode(), parseInt('0755', 8)); }); - it('fails if parent does not exist', function() { + it('fails if parent does not exist', function () { const binding = new Binding(system); const dirPath = path.join('bogus', 'path'); - assert.throws(function() { + assert.throws(function () { binding.mkdir(dirPath, parseInt('0755', 8), false); }); }); - it('fails if directory exists', function() { + it('fails if directory exists', function () { const binding = new Binding(system); const dirPath = 'mock-dir'; - assert.throws(function() { + assert.throws(function () { binding.mkdir(dirPath, parseInt('0755', 8), false); }); }); - it('fails if file exists', function() { + it('fails if file exists', function () { const binding = new Binding(system); const dirPath = path.join('mock-dir', 'one.txt'); - assert.throws(function() { + assert.throws(function () { binding.mkdir(dirPath, parseInt('0755', 8), false); }); }); }); - describe('#mkdir() recursive', function() { - it('creates a new directory', function() { + describe('#mkdir() recursive', function () { + it('creates a new directory', function () { const binding = new Binding(system); const dirPath = path.join('mock-dir', 'foo'); binding.mkdir(dirPath, parseInt('0755', 8), true); @@ -1162,7 +1178,7 @@ assert.equal(dir.getMode(), parseInt('0755', 8)); }); - it('creates a new deep directory', function() { + it('creates a new deep directory', function () { const binding = new Binding(system); const dirPath1 = path.join('mock-dir', 'foo'); const dirPath2 = path.join(dirPath1, 'bar'); @@ -1182,43 +1198,43 @@ assert.equal(dir.getMode(), parseInt('0755', 8)); }); - it('fails if permission does not allow recursive creation', function() { + it('fails if permission does not allow recursive creation', function () { const binding = new Binding(system); const dirPath1 = path.join('mock-dir', 'foo'); const dirPath2 = path.join(dirPath1, 'bar'); const dirPath3 = path.join(dirPath2, 'loo'); - assert.throws(function() { + assert.throws(function () { binding.mkdir(dirPath3, parseInt('0400', 8), true); }); }); - it('fails if one parent is not a folder', function() { + it('fails if one parent is not a folder', function () { const binding = new Binding(system); const dirPath = path.join('mock-dir', 'one.txt', 'foo', 'bar'); - assert.throws(function() { + assert.throws(function () { binding.mkdir(dirPath, parseInt('0755', 8), true); }); }); - it('fails if file exists', function() { + it('fails if file exists', function () { const binding = new Binding(system); const dirPath = path.join('mock-dir', 'non-empty', 'a.txt'); - assert.throws(function() { + assert.throws(function () { binding.mkdir(dirPath, parseInt('0755', 8), true); }); }); - it('passes silently if directory exists', function() { + it('passes silently if directory exists', function () { const binding = new Binding(system); const dirPath = path.join('mock-dir', 'non-empty'); - assert.doesNotThrow(function() { + assert.doesNotThrow(function () { binding.mkdir(dirPath, parseInt('0755', 8), true); }); }); }); - describe('#mkdtemp()', function() { - it('creates a new directory', function() { + describe('#mkdtemp()', function () { + it('creates a new directory', function () { const binding = new Binding(system); const template = path.join('mock-dir', 'fooXXXXXX'); const dirPath = binding.mkdtemp(template); @@ -1227,58 +1243,58 @@ assert.instanceOf(dir, Directory); }); - it('fails if parent does not exist', function() { + it('fails if parent does not exist', function () { const binding = new Binding(system); const dirPath = path.join('bogus', 'pathXXXXXX'); - assert.throws(function() { + assert.throws(function () { binding.mkdtemp(dirPath); }); }); - it('fails if file exists', function() { + it('fails if file exists', function () { const binding = new Binding(system); const dirPath = path.join('mock-dir', 'one.txt', 'XXXXXX'); - assert.throws(function() { + assert.throws(function () { binding.mkdtemp(dirPath); }); }); }); - describe('#rmdir()', function() { - it('removes an empty directory', function() { + describe('#rmdir()', function () { + it('removes an empty directory', function () { const binding = new Binding(system); const dirPath = path.join('mock-dir', 'empty'); binding.rmdir(dirPath); assert.isNull(system.getItem(dirPath)); }); - it('fails if directory is not empty', function() { + it('fails if directory is not empty', function () { const binding = new Binding(system); const dirPath = 'mock-dir'; - assert.throws(function() { + assert.throws(function () { binding.rmdir(dirPath); }); }); - it('fails if directory does not exist', function() { + it('fails if directory does not exist', function () { const binding = new Binding(system); const dirPath = path.join('bogus', 'path'); - assert.throws(function() { + assert.throws(function () { binding.rmdir(dirPath); }); }); - it('fails if a file exists', function() { + it('fails if a file exists', function () { const binding = new Binding(system); const dirPath = path.join('mock-dir', 'one.txt'); - assert.throws(function() { + assert.throws(function () { binding.rmdir(dirPath); }); }); }); - describe('#ftruncate()', function() { - it('truncates a file', function() { + describe('#ftruncate()', function () { + it('truncates a file', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'one.txt'); const fd = binding.open(pathname, flags('r+')); @@ -1287,26 +1303,26 @@ assert.equal(String(file.getContent()), 'one'); }); - it('fails if directory', function() { + it('fails if directory', function () { const binding = new Binding(system); const fd = binding.open('mock-dir', flags('r')); - assert.throws(function() { + assert.throws(function () { binding.ftruncate(fd, 3); }); }); - it('fails if not open for writing', function() { + it('fails if not open for writing', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'one.txt'); const fd = binding.open(pathname, flags('r')); - assert.throws(function() { + assert.throws(function () { binding.ftruncate(fd, 4); }); }); }); - describe('#chown()', function() { - it('sets the uid and gid for a file', function() { + describe('#chown()', function () { + it('sets the uid and gid for a file', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'one.txt'); binding.chown(pathname, 3, 4); @@ -1315,7 +1331,7 @@ assert.equal(file.getGid(), 4); }); - it('sets the uid and gid for a directory', function() { + it('sets the uid and gid for a directory', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'empty'); binding.chown(pathname, 5, 6); @@ -1325,8 +1341,8 @@ }); }); - describe('#fchown()', function() { - it('sets the uid and gid for a file', function() { + describe('#fchown()', function () { + it('sets the uid and gid for a file', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'one.txt'); const fd = binding.open(pathname, flags('r')); @@ -1336,7 +1352,7 @@ assert.equal(file.getGid(), 4); }); - it('sets the uid and gid for a directory', function() { + it('sets the uid and gid for a directory', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'empty'); const fd = binding.open(pathname, flags('r')); @@ -1347,8 +1363,8 @@ }); }); - describe('#chmod()', function() { - it('sets the mode for a file', function() { + describe('#chmod()', function () { + it('sets the mode for a file', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'two.txt'); binding.chmod(pathname, parseInt('0644', 8)); @@ -1356,7 +1372,7 @@ assert.equal(file.getMode(), parseInt('0644', 8)); }); - it('sets the mode for a directory', function() { + it('sets the mode for a directory', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'empty'); binding.chmod(pathname, parseInt('0755', 8)); @@ -1365,8 +1381,8 @@ }); }); - describe('#fchmod()', function() { - it('sets the mode for a file', function() { + describe('#fchmod()', function () { + it('sets the mode for a file', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'one.txt'); const fd = binding.open(pathname, flags('r')); @@ -1375,7 +1391,7 @@ assert.equal(file.getMode(), parseInt('0664', 8)); }); - it('sets the mode for a directory', function() { + it('sets the mode for a directory', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'empty'); const fd = binding.open(pathname, flags('r')); @@ -1385,33 +1401,33 @@ }); }); - describe('#unlink()', function() { - it('deletes a file', function() { + describe('#unlink()', function () { + it('deletes a file', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'one.txt'); binding.unlink(pathname); assert.isNull(system.getItem(pathname)); }); - it('fails for directory', function() { + it('fails for directory', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'empty'); - assert.throws(function() { + assert.throws(function () { binding.unlink(pathname); }); }); - it('fails for bogus path', function() { + it('fails for bogus path', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'bogus.txt'); - assert.throws(function() { + assert.throws(function () { binding.unlink(pathname); }); }); }); - describe('#utimes()', function() { - it('updates atime and mtime for a file', function() { + describe('#utimes()', function () { + it('updates atime and mtime for a file', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'one.txt'); binding.utimes(pathname, 100, 200); @@ -1420,7 +1436,7 @@ assert.equal(item.getMTime().getTime(), 200 * 1000); }); - it('updates atime and mtime for a directory', function() { + it('updates atime and mtime for a directory', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'empty'); binding.utimes(pathname, 300, 400); @@ -1429,17 +1445,17 @@ assert.equal(item.getMTime().getTime(), 400 * 1000); }); - it('fails for a bogus path', function() { + it('fails for a bogus path', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'bogus.txt'); - assert.throws(function() { + assert.throws(function () { binding.utimes(pathname, 300, 400); }); }); }); - describe('#futimes()', function() { - it('updates atime and mtime for a file', function() { + describe('#futimes()', function () { + it('updates atime and mtime for a file', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'one.txt'); const fd = binding.open(pathname, flags('r')); @@ -1449,7 +1465,7 @@ assert.equal(item.getMTime().getTime(), 200 * 1000); }); - it('updates atime and mtime for a directory', function() { + it('updates atime and mtime for a directory', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'empty'); const fd = binding.open(pathname, flags('r')); @@ -1460,46 +1476,46 @@ }); }); - describe('#fsync()', function() { - it('synchronize file state (noop)', function() { + describe('#fsync()', function () { + it('synchronize file state (noop)', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'one.txt'); const fd = binding.open(pathname, flags('r')); binding.fsync(fd); }); - it('fails for closed file descriptor', function() { + it('fails for closed file descriptor', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'one.txt'); const fd = binding.open(pathname, flags('r')); binding.close(fd); - assert.throws(function() { + assert.throws(function () { binding.fsync(fd); }); }); }); - describe('#fdatasync()', function() { - it('synchronize file state (noop)', function() { + describe('#fdatasync()', function () { + it('synchronize file state (noop)', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'one.txt'); const fd = binding.open(pathname, flags('r')); binding.fdatasync(fd); }); - it('fails for closed file descriptor', function() { + it('fails for closed file descriptor', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'one.txt'); const fd = binding.open(pathname, flags('r')); binding.close(fd); - assert.throws(function() { + assert.throws(function () { binding.fdatasync(fd); }); }); }); - describe('#link()', function() { - it('creates a link to a file', function() { + describe('#link()', function () { + it('creates a link to a file', function () { const binding = new Binding(system); const source = path.join('mock-dir', 'one.txt'); const dest = path.join('mock-dir', 'link.txt'); @@ -1509,27 +1525,27 @@ assert.equal(String(link.getContent()), 'one content'); }); - it('fails if dest exists', function() { + it('fails if dest exists', function () { const binding = new Binding(system); const source = path.join('mock-dir', 'one.txt'); const dest = path.join('mock-dir', 'two.txt'); - assert.throws(function() { + assert.throws(function () { binding.link(source, dest); }); }); - it('fails if source is directory', function() { + it('fails if source is directory', function () { const binding = new Binding(system); const source = path.join('mock-dir', 'empty'); const dest = path.join('mock-dir', 'link'); - assert.throws(function() { + assert.throws(function () { binding.link(source, dest); }); }); }); - describe('#symlink()', function() { - it('creates a symbolic link to a file', function() { + describe('#symlink()', function () { + it('creates a symbolic link to a file', function () { const binding = new Binding(system); const source = path.join('.', 'one.txt'); const dest = path.join('mock-dir', 'link.txt'); @@ -1539,16 +1555,16 @@ assert.equal(link.getPath(), source); }); - it('fails if dest exists', function() { + it('fails if dest exists', function () { const binding = new Binding(system); const source = path.join('.', 'one.txt'); const dest = path.join('mock-dir', 'two.txt'); - assert.throws(function() { + assert.throws(function () { binding.symlink(source, dest); }); }); - it('works if source is directory', function() { + it('works if source is directory', function () { const binding = new Binding(system); const source = path.join('mock-dir', 'empty'); const dest = path.join('mock-dir', 'link'); @@ -1559,14 +1575,14 @@ }); }); - describe('#readlink()', function() { - it('reads the symbolic link', function() { + describe('#readlink()', function () { + it('reads the symbolic link', function () { const binding = new Binding(system); const srcPath = binding.readlink(path.join('mock-dir', 'one-link.txt')); assert.equal(srcPath, './one.txt'); }); - it('can return "buffer" encoding', function() { + it('can return "buffer" encoding', function () { const binding = new Binding(system); const srcPath = binding.readlink( path.join('mock-dir', 'one-link.txt'), @@ -1576,30 +1592,30 @@ assert.equal(srcPath.toString(), './one.txt'); }); - it('fails for regular files', function() { + it('fails for regular files', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.readlink(path.join('mock-dir', 'one.txt')); }, /EINVAL/); }); - it('fails for directories', function() { + it('fails for directories', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.readlink(path.join('mock-dir', 'empty')); }, /EINVAL/); }); - it('fails for bogus paths', function() { + it('fails for bogus paths', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.readlink(path.join('mock-dir', 'bogus')); }, /ENOENT/); }); }); - describe('#lstat()', function() { - it('stats symbolic links', function() { + describe('#lstat()', function () { + it('stats symbolic links', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'one-link.txt'); const stats = binding.lstat(pathname, false); @@ -1608,56 +1624,56 @@ }); }); - describe('#access()', function() { - it('works if file exists', function() { + describe('#access()', function () { + it('works if file exists', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'one-link.txt'); binding.access(pathname); }); - it('throws for dead link', function() { + it('throws for dead link', function () { const binding = new Binding(system); const pathname = path.join('mock-dir', 'dead-link.txt'); - assert.throws(function() { + assert.throws(function () { binding.access(pathname); }, /ENOENT/); }); if (process.getuid && process.getgid) { - it('fails in case of insufficient user permissions', function() { + it('fails in case of insufficient user permissions', function () { const binding = new Binding(system); const item = system.getItem(path.join('mock-dir', 'one.txt')); item.setMode(parseInt('0077', 8)); - assert.throws(function() { + assert.throws(function () { binding.access(path.join('mock-dir', 'one.txt'), 1); }, /EACCES/); }); - it('fails in case of insufficient group permissions', function() { + it('fails in case of insufficient group permissions', function () { const binding = new Binding(system); const item = system.getItem(path.join('mock-dir', 'one.txt')); item.setUid(process.getuid() + 1); item.setMode(parseInt('0707', 8)); - assert.throws(function() { + assert.throws(function () { binding.access(path.join('mock-dir', 'one.txt'), 2); }, /EACCES/); }); - it('fails in case of insufficient permissions', function() { + it('fails in case of insufficient permissions', function () { const binding = new Binding(system); const item = system.getItem(path.join('mock-dir', 'one.txt')); item.setUid(process.getuid() + 1); item.setGid(process.getgid() + 1); item.setMode(parseInt('0771', 8)); - assert.throws(function() { + assert.throws(function () { binding.access(path.join('mock-dir', 'one.txt'), 5); }, /EACCES/); }); } - it('fails for bogus paths', function() { + it('fails for bogus paths', function () { const binding = new Binding(system); - assert.throws(function() { + assert.throws(function () { binding.access(path.join('mock-dir', 'bogus')); }, /ENOENT/); }); diff -Nru node-mock-fs-5.1.2/test/lib/bypass.spec.js node-mock-fs-5.1.4/test/lib/bypass.spec.js --- node-mock-fs-5.1.2/test/lib/bypass.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/bypass.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,8 +1,8 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const path = require('path'); const assert = helper.assert; @@ -38,7 +38,7 @@ it('bypasses patched process.cwd() and process.chdir()', () => { const originalCwd = process.cwd(); mock({ - dir: {} + dir: {}, }); process.chdir('dir'); @@ -57,7 +57,7 @@ assert.equal(process.cwd(), originalCwd); }); - it('runs an async function using the real filesystem', done => { + it('runs an async function using the real filesystem', (done) => { mock({'/path/to/file': 'content'}); assert.equal(fs.readFileSync('/path/to/file', 'utf8'), 'content'); @@ -65,7 +65,7 @@ mock .bypass(() => fs.promises.stat(__filename)) - .then(stat => { + .then((stat) => { assert.isTrue(stat.isFile()); assert.isFalse(fs.existsSync(__filename)); done(); @@ -73,7 +73,7 @@ .catch(done); }); - it('handles promise rejection', done => { + it('handles promise rejection', (done) => { mock({'/path/to/file': 'content'}); assert.equal(fs.readFileSync('/path/to/file', 'utf8'), 'content'); @@ -89,7 +89,7 @@ .then(() => { done(new Error('should not succeed')); }) - .catch(err => { + .catch((err) => { assert.equal(err, error); assert.equal(fs.readFileSync('/path/to/file', 'utf8'), 'content'); diff -Nru node-mock-fs-5.1.2/test/lib/descriptor.spec.js node-mock-fs-5.1.4/test/lib/descriptor.spec.js --- node-mock-fs-5.1.2/test/lib/descriptor.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/descriptor.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,432 +1,432 @@ 'use strict'; const constants = require('constants'); -const FileDescriptor = require('../../lib/descriptor'); -const helper = require('../helper'); +const FileDescriptor = require('../../lib/descriptor.js'); +const helper = require('../helper.js'); const assert = helper.assert; const flags = helper.flags; -describe('FileDescriptor', function() { - describe('constructor', function() { - it('creates a new descriptor', function() { +describe('FileDescriptor', function () { + describe('constructor', function () { + it('creates a new descriptor', function () { const fd = new FileDescriptor(flags('r')); assert.instanceOf(fd, FileDescriptor); }); }); - describe('#getPosition()', function() { - it('returns zero by default', function() { + describe('#getPosition()', function () { + it('returns zero by default', function () { const fd = new FileDescriptor(flags('r')); assert.equal(fd.getPosition(), 0); }); }); - describe('#setPosition()', function() { - it('updates the position', function() { + describe('#setPosition()', function () { + it('updates the position', function () { const fd = new FileDescriptor(flags('r')); fd.setPosition(10); assert.equal(fd.getPosition(), 10); }); }); - describe('#isAppend()', function() { - it('not opened for appending (r)', function() { + describe('#isAppend()', function () { + it('not opened for appending (r)', function () { const fd = new FileDescriptor(flags('r')); assert.isFalse(fd.isAppend()); }); - it('not opened for appending (r+)', function() { + it('not opened for appending (r+)', function () { const fd = new FileDescriptor(flags('r+')); assert.isFalse(fd.isAppend()); }); - it('not opened for appending (rs)', function() { + it('not opened for appending (rs)', function () { const fd = new FileDescriptor(flags('rs')); assert.isFalse(fd.isAppend()); }); - it('not opened for appending (rs+)', function() { + it('not opened for appending (rs+)', function () { const fd = new FileDescriptor(flags('rs+')); assert.isFalse(fd.isAppend()); }); - it('not opened for appending (w)', function() { + it('not opened for appending (w)', function () { const fd = new FileDescriptor(flags('w')); assert.isFalse(fd.isAppend()); }); - it('not opened for appending (wx)', function() { + it('not opened for appending (wx)', function () { const fd = new FileDescriptor(flags('wx')); assert.isFalse(fd.isAppend()); }); - it('not opened for appending (w+)', function() { + it('not opened for appending (w+)', function () { const fd = new FileDescriptor(flags('w+')); assert.isFalse(fd.isAppend()); }); - it('not opened for appending (wx+)', function() { + it('not opened for appending (wx+)', function () { const fd = new FileDescriptor(flags('wx+')); assert.isFalse(fd.isAppend()); }); - it('opened for appending (a)', function() { + it('opened for appending (a)', function () { const fd = new FileDescriptor(flags('a')); assert.isTrue(fd.isAppend()); }); - it('opened for appending (ax)', function() { + it('opened for appending (ax)', function () { const fd = new FileDescriptor(flags('ax')); assert.isTrue(fd.isAppend()); }); - it('opened for appending (a+)', function() { + it('opened for appending (a+)', function () { const fd = new FileDescriptor(flags('a+')); assert.isTrue(fd.isAppend()); }); - it('opened for appending (ax+)', function() { + it('opened for appending (ax+)', function () { const fd = new FileDescriptor(flags('ax+')); assert.isTrue(fd.isAppend()); }); - it('not opened for appending (O_CREAT | O_RDONLY)', function() { + it('not opened for appending (O_CREAT | O_RDONLY)', function () { const fd = new FileDescriptor(constants.O_CREAT | constants.O_RDONLY); assert.isFalse(fd.isAppend()); }); }); - describe('#isTruncate()', function() { - it('not opened for truncating (r)', function() { + describe('#isTruncate()', function () { + it('not opened for truncating (r)', function () { const fd = new FileDescriptor(flags('r')); assert.isFalse(fd.isTruncate()); }); - it('not opened for truncating (r+)', function() { + it('not opened for truncating (r+)', function () { const fd = new FileDescriptor(flags('r+')); assert.isFalse(fd.isTruncate()); }); - it('not opened for truncating (rs)', function() { + it('not opened for truncating (rs)', function () { const fd = new FileDescriptor(flags('rs')); assert.isFalse(fd.isTruncate()); }); - it('not opened for truncating (rs+)', function() { + it('not opened for truncating (rs+)', function () { const fd = new FileDescriptor(flags('rs+')); assert.isFalse(fd.isTruncate()); }); - it('opened for truncating (w)', function() { + it('opened for truncating (w)', function () { const fd = new FileDescriptor(flags('w')); assert.isTrue(fd.isTruncate()); }); - it('opened for truncating (wx)', function() { + it('opened for truncating (wx)', function () { const fd = new FileDescriptor(flags('wx')); assert.isTrue(fd.isTruncate()); }); - it('opened for truncating (w+)', function() { + it('opened for truncating (w+)', function () { const fd = new FileDescriptor(flags('w+')); assert.isTrue(fd.isTruncate()); }); - it('opened for truncating (wx+)', function() { + it('opened for truncating (wx+)', function () { const fd = new FileDescriptor(flags('wx+')); assert.isTrue(fd.isTruncate()); }); - it('not opened for truncating (a)', function() { + it('not opened for truncating (a)', function () { const fd = new FileDescriptor(flags('a')); assert.isFalse(fd.isTruncate()); }); - it('not opened for truncating (ax)', function() { + it('not opened for truncating (ax)', function () { const fd = new FileDescriptor(flags('ax')); assert.isFalse(fd.isTruncate()); }); - it('not opened for truncating (a+)', function() { + it('not opened for truncating (a+)', function () { const fd = new FileDescriptor(flags('a+')); assert.isFalse(fd.isTruncate()); }); - it('not opened for truncating (ax+)', function() { + it('not opened for truncating (ax+)', function () { const fd = new FileDescriptor(flags('ax+')); assert.isFalse(fd.isTruncate()); }); - it('not opened for truncating (O_CREAT | O_RDONLY)', function() { + it('not opened for truncating (O_CREAT | O_RDONLY)', function () { const fd = new FileDescriptor(constants.O_CREAT | constants.O_RDONLY); assert.isFalse(fd.isTruncate()); }); }); - describe('#isCreate()', function() { - it('not opened for creation (r)', function() { + describe('#isCreate()', function () { + it('not opened for creation (r)', function () { const fd = new FileDescriptor(flags('r')); assert.isFalse(fd.isCreate()); }); - it('not opened for creation (r+)', function() { + it('not opened for creation (r+)', function () { const fd = new FileDescriptor(flags('r+')); assert.isFalse(fd.isCreate()); }); - it('not opened for creation (rs)', function() { + it('not opened for creation (rs)', function () { const fd = new FileDescriptor(flags('rs')); assert.isFalse(fd.isCreate()); }); - it('not opened for creation (rs+)', function() { + it('not opened for creation (rs+)', function () { const fd = new FileDescriptor(flags('rs+')); assert.isFalse(fd.isCreate()); }); - it('opened for creation (w)', function() { + it('opened for creation (w)', function () { const fd = new FileDescriptor(flags('w')); assert.isTrue(fd.isCreate()); }); - it('opened for creation (wx)', function() { + it('opened for creation (wx)', function () { const fd = new FileDescriptor(flags('wx')); assert.isTrue(fd.isCreate()); }); - it('opened for creation (w+)', function() { + it('opened for creation (w+)', function () { const fd = new FileDescriptor(flags('w+')); assert.isTrue(fd.isCreate()); }); - it('opened for creation (wx+)', function() { + it('opened for creation (wx+)', function () { const fd = new FileDescriptor(flags('wx+')); assert.isTrue(fd.isCreate()); }); - it('opened for creation (a)', function() { + it('opened for creation (a)', function () { const fd = new FileDescriptor(flags('a')); assert.isTrue(fd.isCreate()); }); - it('opened for creation (ax)', function() { + it('opened for creation (ax)', function () { const fd = new FileDescriptor(flags('ax')); assert.isTrue(fd.isCreate()); }); - it('opened for creation (a+)', function() { + it('opened for creation (a+)', function () { const fd = new FileDescriptor(flags('a+')); assert.isTrue(fd.isCreate()); }); - it('opened for creation (ax+)', function() { + it('opened for creation (ax+)', function () { const fd = new FileDescriptor(flags('ax+')); assert.isTrue(fd.isCreate()); }); - it('opened for creation (O_CREAT | O_RDONLY)', function() { + it('opened for creation (O_CREAT | O_RDONLY)', function () { const fd = new FileDescriptor(constants.O_CREAT | constants.O_RDONLY); assert.isTrue(fd.isCreate()); }); }); - describe('#isRead()', function() { - it('opened for reading (r)', function() { + describe('#isRead()', function () { + it('opened for reading (r)', function () { const fd = new FileDescriptor(flags('r')); assert.isTrue(fd.isRead()); }); - it('opened for reading (r+)', function() { + it('opened for reading (r+)', function () { const fd = new FileDescriptor(flags('r+')); assert.isTrue(fd.isRead()); }); - it('opened for reading (rs)', function() { + it('opened for reading (rs)', function () { const fd = new FileDescriptor(flags('rs')); assert.isTrue(fd.isRead()); }); - it('opened for reading (rs+)', function() { + it('opened for reading (rs+)', function () { const fd = new FileDescriptor(flags('rs+')); assert.isTrue(fd.isRead()); }); - it('not opened for reading (w)', function() { + it('not opened for reading (w)', function () { const fd = new FileDescriptor(flags('w')); assert.isFalse(fd.isRead()); }); - it('not opened for reading (wx)', function() { + it('not opened for reading (wx)', function () { const fd = new FileDescriptor(flags('wx')); assert.isFalse(fd.isRead()); }); - it('opened for reading (w+)', function() { + it('opened for reading (w+)', function () { const fd = new FileDescriptor(flags('w+')); assert.isTrue(fd.isRead()); }); - it('opened for reading (wx+)', function() { + it('opened for reading (wx+)', function () { const fd = new FileDescriptor(flags('wx+')); assert.isTrue(fd.isRead()); }); - it('not opened for reading (a)', function() { + it('not opened for reading (a)', function () { const fd = new FileDescriptor(flags('a')); assert.isFalse(fd.isRead()); }); - it('not opened for reading (ax)', function() { + it('not opened for reading (ax)', function () { const fd = new FileDescriptor(flags('ax')); assert.isFalse(fd.isRead()); }); - it('opened for reading (a+)', function() { + it('opened for reading (a+)', function () { const fd = new FileDescriptor(flags('a+')); assert.isTrue(fd.isRead()); }); - it('opened for reading (ax+)', function() { + it('opened for reading (ax+)', function () { const fd = new FileDescriptor(flags('ax+')); assert.isTrue(fd.isRead()); }); - it('opened for reading (O_CREAT | O_RDONLY)', function() { + it('opened for reading (O_CREAT | O_RDONLY)', function () { const fd = new FileDescriptor(constants.O_CREAT | constants.O_RDONLY); assert.isTrue(fd.isRead()); }); }); - describe('#isWrite()', function() { - it('not opened for writing (r)', function() { + describe('#isWrite()', function () { + it('not opened for writing (r)', function () { const fd = new FileDescriptor(flags('r')); assert.isFalse(fd.isWrite()); }); - it('opened for writing (r+)', function() { + it('opened for writing (r+)', function () { const fd = new FileDescriptor(flags('r+')); assert.isTrue(fd.isWrite()); }); - it('not opened for writing (rs)', function() { + it('not opened for writing (rs)', function () { const fd = new FileDescriptor(flags('rs')); assert.isFalse(fd.isWrite()); }); - it('opened for writing (rs+)', function() { + it('opened for writing (rs+)', function () { const fd = new FileDescriptor(flags('rs+')); assert.isTrue(fd.isWrite()); }); - it('opened for writing (w)', function() { + it('opened for writing (w)', function () { const fd = new FileDescriptor(flags('w')); assert.isTrue(fd.isWrite()); }); - it('opened for writing (wx)', function() { + it('opened for writing (wx)', function () { const fd = new FileDescriptor(flags('wx')); assert.isTrue(fd.isWrite()); }); - it('opened for writing (w+)', function() { + it('opened for writing (w+)', function () { const fd = new FileDescriptor(flags('w+')); assert.isTrue(fd.isWrite()); }); - it('opened for writing (wx+)', function() { + it('opened for writing (wx+)', function () { const fd = new FileDescriptor(flags('wx+')); assert.isTrue(fd.isWrite()); }); - it('opened for writing (a)', function() { + it('opened for writing (a)', function () { const fd = new FileDescriptor(flags('a')); assert.isTrue(fd.isWrite()); }); - it('opened for writing (ax)', function() { + it('opened for writing (ax)', function () { const fd = new FileDescriptor(flags('ax')); assert.isTrue(fd.isWrite()); }); - it('opened for writing (a+)', function() { + it('opened for writing (a+)', function () { const fd = new FileDescriptor(flags('a+')); assert.isTrue(fd.isWrite()); }); - it('opened for writing (ax+)', function() { + it('opened for writing (ax+)', function () { const fd = new FileDescriptor(flags('ax+')); assert.isTrue(fd.isWrite()); }); - it('not opened for writing (O_CREAT | O_RDONLY)', function() { + it('not opened for writing (O_CREAT | O_RDONLY)', function () { const fd = new FileDescriptor(constants.O_CREAT | constants.O_RDONLY); assert.isFalse(fd.isWrite()); }); }); - describe('#isExclusive()', function() { - it('not opened exclusive (r)', function() { + describe('#isExclusive()', function () { + it('not opened exclusive (r)', function () { const fd = new FileDescriptor(flags('r')); assert.isFalse(fd.isExclusive()); }); - it('not opened exclusive (r+)', function() { + it('not opened exclusive (r+)', function () { const fd = new FileDescriptor(flags('r+')); assert.isFalse(fd.isExclusive()); }); - it('not opened exclusive (rs)', function() { + it('not opened exclusive (rs)', function () { const fd = new FileDescriptor(flags('rs')); assert.isFalse(fd.isExclusive()); }); - it('not opened exclusive (rs+)', function() { + it('not opened exclusive (rs+)', function () { const fd = new FileDescriptor(flags('rs+')); assert.isFalse(fd.isExclusive()); }); - it('not opened exclusive (w)', function() { + it('not opened exclusive (w)', function () { const fd = new FileDescriptor(flags('w')); assert.isFalse(fd.isExclusive()); }); - it('opened exclusive (wx)', function() { + it('opened exclusive (wx)', function () { const fd = new FileDescriptor(flags('wx')); assert.isTrue(fd.isExclusive()); }); - it('not opened exclusive (w+)', function() { + it('not opened exclusive (w+)', function () { const fd = new FileDescriptor(flags('w+')); assert.isFalse(fd.isExclusive()); }); - it('opened exclusive (wx+)', function() { + it('opened exclusive (wx+)', function () { const fd = new FileDescriptor(flags('wx+')); assert.isTrue(fd.isExclusive()); }); - it('not opened exclusive (a)', function() { + it('not opened exclusive (a)', function () { const fd = new FileDescriptor(flags('a')); assert.isFalse(fd.isExclusive()); }); - it('opened exclusive (ax)', function() { + it('opened exclusive (ax)', function () { const fd = new FileDescriptor(flags('ax')); assert.isTrue(fd.isExclusive()); }); - it('not opened exclusive (a+)', function() { + it('not opened exclusive (a+)', function () { const fd = new FileDescriptor(flags('a+')); assert.isFalse(fd.isExclusive()); }); - it('opened exclusive (ax+)', function() { + it('opened exclusive (ax+)', function () { const fd = new FileDescriptor(flags('ax+')); assert.isTrue(fd.isExclusive()); }); - it('not opened for exclusive (O_CREAT | O_RDONLY)', function() { + it('not opened for exclusive (O_CREAT | O_RDONLY)', function () { const fd = new FileDescriptor(constants.O_CREAT | constants.O_RDONLY); assert.isFalse(fd.isExclusive()); }); diff -Nru node-mock-fs-5.1.2/test/lib/directory.spec.js node-mock-fs-5.1.4/test/lib/directory.spec.js --- node-mock-fs-5.1.2/test/lib/directory.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/directory.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,35 +1,35 @@ 'use strict'; -const Item = require('../../lib/item'); -const Directory = require('../../lib/directory'); -const File = require('../../lib/file'); -const assert = require('../helper').assert; - -describe('Directory', function() { - describe('constructor', function() { - it('creates a named directory', function() { +const Item = require('../../lib/item.js'); +const Directory = require('../../lib/directory.js'); +const File = require('../../lib/file.js'); +const assert = require('../helper.js').assert; + +describe('Directory', function () { + describe('constructor', function () { + it('creates a named directory', function () { const dir = new Directory(); assert.instanceOf(dir, Directory); assert.instanceOf(dir, Item); }); }); - describe('#addItem()', function() { - it('allows a directory to be added', function() { + describe('#addItem()', function () { + it('allows a directory to be added', function () { const parent = new Directory(); const child = new Directory(); parent.addItem('child', child); assert.equal(parent.getItem('child'), child); }); - it('allows a file to be added', function() { + it('allows a file to be added', function () { const parent = new Directory(); const child = new File(); parent.addItem('child', child); assert.equal(parent.getItem('child'), child); }); - it('returns the added item', function() { + it('returns the added item', function () { const parent = new Directory(); const child = new File(); const got = parent.addItem('child', child); @@ -37,22 +37,22 @@ }); }); - describe('#getItem()', function() { - it('retrieves a named directory', function() { + describe('#getItem()', function () { + it('retrieves a named directory', function () { const parent = new Directory(); const child = new Directory(); parent.addItem('child', child); assert.equal(parent.getItem('child'), child); }); - it('retrieves a named file', function() { + it('retrieves a named file', function () { const parent = new Directory(); const child = new File(); parent.addItem('child', child); assert.equal(parent.getItem('child'), child); }); - it('returns null for missing item', function() { + it('returns null for missing item', function () { const parent = new Directory(); const child = new File(); parent.addItem('child', child); @@ -60,8 +60,8 @@ }); }); - describe('#removeItem()', function() { - it('allows a directory to be removed', function() { + describe('#removeItem()', function () { + it('allows a directory to be removed', function () { const parent = new Directory(); const child = new Directory(); parent.addItem('child', child); @@ -70,7 +70,7 @@ assert.isNull(parent.getItem('child')); }); - it('allows a file to be removed', function() { + it('allows a file to be removed', function () { const parent = new Directory(); const child = new File(); parent.addItem('child', child); @@ -79,18 +79,18 @@ assert.isNull(parent.getItem('child')); }); - it('throws if item is not a child', function() { + it('throws if item is not a child', function () { const parent = new Directory(); parent.addItem('one', new Directory()); parent.addItem('two', new File()); - assert.throws(function() { + assert.throws(function () { parent.removeItem('three'); }); }); }); - describe('#list()', function() { - it('lists all items in a directory', function() { + describe('#list()', function () { + it('lists all items in a directory', function () { const dir = new Directory(); dir.addItem('one file', new File()); dir.addItem('another file', new File()); @@ -101,16 +101,16 @@ 'a directory', 'another directory', 'another file', - 'one file' + 'one file', ]); }); - it('works for empty dir', function() { + it('works for empty dir', function () { const dir = new Directory(); assert.deepEqual(dir.list(), []); }); - it('lists one level deep', function() { + it('lists one level deep', function () { const d0 = new Directory(); const d1 = new Directory(); const d2 = new Directory(); diff -Nru node-mock-fs-5.1.2/test/lib/file.spec.js node-mock-fs-5.1.4/test/lib/file.spec.js --- node-mock-fs-5.1.2/test/lib/file.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/file.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,32 +1,32 @@ 'use strict'; -const Item = require('../../lib/item'); -const File = require('../../lib/file'); -const assert = require('../helper').assert; - -describe('File', function() { - describe('constructor', function() { - it('creates a named file', function() { +const Item = require('../../lib/item.js'); +const File = require('../../lib/file.js'); +const assert = require('../helper.js').assert; + +describe('File', function () { + describe('constructor', function () { + it('creates a named file', function () { const file = new File(); assert.instanceOf(file, File); assert.instanceOf(file, Item); }); }); - describe('#getContent()', function() { - it('gets the file content', function() { + describe('#getContent()', function () { + it('gets the file content', function () { const file = new File(); const content = Buffer.from('bar'); file.setContent(content); assert.equal(file.getContent(), content); }); - it('is initially empty', function() { + it('is initially empty', function () { const file = new File(); assert.equal(String(file.getContent()), ''); }); - it('updates the atime', function() { + it('updates the atime', function () { const file = new File(); file.setContent('bar'); const old = new Date(1); @@ -36,8 +36,8 @@ }); }); - describe('#setContent()', function() { - it('accepts a string', function() { + describe('#setContent()', function () { + it('accepts a string', function () { const file = new File(); file.setContent('bar'); const content = file.getContent(); @@ -45,7 +45,7 @@ assert.equal(String(content), 'bar'); }); - it('accepts a buffer', function() { + it('accepts a buffer', function () { const file = new File(); file.setContent(Buffer.from('baz')); const content = file.getContent(); @@ -53,14 +53,14 @@ assert.equal(String(content), 'baz'); }); - it('throws for other types', function() { - assert.throws(function() { + it('throws for other types', function () { + assert.throws(function () { const file = new File(); file.setContent(123); }); }); - it('updates the ctime and mtime', function() { + it('updates the ctime and mtime', function () { const file = new File(); const old = new Date(1); file.setCTime(old); diff -Nru node-mock-fs-5.1.2/test/lib/filesystem.spec.js node-mock-fs-5.1.4/test/lib/filesystem.spec.js --- node-mock-fs-5.1.2/test/lib/filesystem.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/filesystem.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -2,20 +2,19 @@ const os = require('os'); const path = require('path'); - -const Directory = require('../../lib/directory'); -const File = require('../../lib/file'); -const FileSystem = require('../../lib/filesystem'); -const assert = require('../helper').assert; - -describe('FileSystem', function() { - describe('constructor', function() { - it('creates a new instance', function() { +const Directory = require('../../lib/directory.js'); +const File = require('../../lib/file.js'); +const FileSystem = require('../../lib/filesystem.js'); +const assert = require('../helper.js').assert; + +describe('FileSystem', function () { + describe('constructor', function () { + it('creates a new instance', function () { const system = new FileSystem(); assert.instanceOf(system, FileSystem); }); - it('accepts a createCwd option', function() { + it('accepts a createCwd option', function () { const cwd = process.cwd(); const withCwd = new FileSystem({createCwd: true}); const withoutCwd = new FileSystem({createCwd: false}); @@ -24,7 +23,7 @@ assert.isNull(withoutCwd.getItem(cwd)); }); - it('accepts a createTmp option', function() { + it('accepts a createTmp option', function () { const tmp = os.tmpdir ? os.tmpdir() : os.tmpDir(); const withTmp = new FileSystem({createTmp: true}); const withoutTmp = new FileSystem({createTmp: false}); @@ -34,17 +33,17 @@ }); }); - describe('#getRoot()', function() { - it('gets the root directory', function() { + describe('#getRoot()', function () { + it('gets the root directory', function () { const system = new FileSystem(); assert.instanceOf(system.getRoot(), Directory); }); }); - describe('#getItem()', function() { - it('gets an item', function() { + describe('#getItem()', function () { + it('gets an item', function () { const system = FileSystem.create({ - 'one/two/three.js': 'contents' + 'one/two/three.js': 'contents', }); const filepath = path.join('one', 'two', 'three.js'); @@ -52,9 +51,9 @@ assert.instanceOf(item, File); }); - it('returns null if not found', function() { + it('returns null if not found', function () { const system = FileSystem.create({ - 'one/two/three.js': 'contents' + 'one/two/three.js': 'contents', }); assert.isNull(system.getItem(path.join('one', 'two', 'four.js'))); @@ -62,7 +61,7 @@ assert.isNull(system.getItem(path.join('um', 'two', 'three.js'))); }); - it('gets an item traversing links to symbolic links', function() { + it('gets an item traversing links to symbolic links', function () { const system = FileSystem.create({ 'dir-link': FileSystem.symlink({path: './b/dir-link2'}), b: { @@ -72,11 +71,11 @@ a: 'file a', b: { c: 'file c', - d: 'file d' - } - } - } - } + d: 'file d', + }, + }, + }, + }, }); const file = system.getItem(path.join('dir-link', 'a')); assert.instanceOf(file, File); @@ -88,8 +87,8 @@ }); }); -describe('FileSystem.file', function() { - it('creates a factory for files', function() { +describe('FileSystem.file', function () { + it('creates a factory for files', function () { const factory = FileSystem.file(); assert.isFunction(factory); @@ -97,7 +96,7 @@ assert.instanceOf(file, File); }); - it('accepts a content member', function() { + it('accepts a content member', function () { const factory = FileSystem.file({content: 'foo'}); assert.isFunction(factory); @@ -109,8 +108,8 @@ }); }); -describe('FileSystem.directory', function() { - it('creates a factory for directories', function() { +describe('FileSystem.directory', function () { + it('creates a factory for directories', function () { const factory = FileSystem.directory(); assert.isFunction(factory); @@ -119,15 +118,15 @@ }); }); -describe('FileSystem.create', function() { - it('provides a convenient way to populate a file system', function() { +describe('FileSystem.create', function () { + it('provides a convenient way to populate a file system', function () { const system = FileSystem.create({ 'path/to/one': { 'file.js': 'file.js content', - dir: {} + dir: {}, }, 'path/to/two.js': 'two.js content', - 'path/to/three': {} + 'path/to/three': {}, }); assert.instanceOf(system, FileSystem); @@ -165,7 +164,7 @@ assert.deepEqual(item.list(), []); }); - it('passes options to the FileSystem constructor', function() { + it('passes options to the FileSystem constructor', function () { const cwd = process.cwd(); const tmp = os.tmpdir ? os.tmpdir() : os.tmpDir(); @@ -179,9 +178,9 @@ assert.instanceOf(withoutTmp.getItem(cwd), Directory); }); - it('accepts file factory', function() { + it('accepts file factory', function () { const system = FileSystem.create({ - 'path/to/file.js': FileSystem.file({content: 'foo'}) + 'path/to/file.js': FileSystem.file({content: 'foo'}), }); assert.instanceOf(system, FileSystem); @@ -191,13 +190,13 @@ assert.equal(String(file.getContent()), 'foo'); }); - it('accepts file factory with uid & gid', function() { + it('accepts file factory with uid & gid', function () { const system = FileSystem.create({ 'path/to/file.js': FileSystem.file({ content: 'foo', uid: 42, - gid: 43 - }) + gid: 43, + }), }); assert.instanceOf(system, FileSystem); @@ -209,9 +208,9 @@ assert.equal(file.getGid(), 43); }); - it('accepts directory factory', function() { + it('accepts directory factory', function () { const system = FileSystem.create({ - 'path/to/dir': FileSystem.directory() + 'path/to/dir': FileSystem.directory(), }); assert.instanceOf(system, FileSystem); @@ -220,12 +219,12 @@ assert.instanceOf(dir, Directory); }); - it('accepts directory factory with uid & gid', function() { + it('accepts directory factory with uid & gid', function () { const system = FileSystem.create({ 'path/to/dir': FileSystem.directory({ uid: 42, - gid: 43 - }) + gid: 43, + }), }); assert.instanceOf(system, FileSystem); @@ -236,15 +235,15 @@ assert.equal(dir.getGid(), 43); }); - it('accepts directory factory with additional items', function() { + it('accepts directory factory with additional items', function () { const system = FileSystem.create({ 'path/to/dir': FileSystem.directory({ mode: parseInt('0755', 8), items: { 'file.txt': 'file content', - 'empty-dir': {} - } - }) + 'empty-dir': {}, + }, + }), }); assert.instanceOf(system, FileSystem); @@ -262,7 +261,7 @@ assert.deepEqual(empty.list(), []); }); - it('correctly generates link counts', function() { + it('correctly generates link counts', function () { const system = FileSystem.create({ '/dir-a.0': { 'dir-b.0': { @@ -270,9 +269,9 @@ 'dir-c.1': {}, 'file-c.0': 'content', 'file-c.1': 'content', - 'symlink-c.0': FileSystem.symlink({path: 'file-c.0'}) - } - } + 'symlink-c.0': FileSystem.symlink({path: 'file-c.0'}), + }, + }, }); /** @@ -312,24 +311,24 @@ assert.equal(system.getItem('/dir-a.0/dir-b.0/symlink-c.0').links, 1); }); - it('throws if item content is not valid type', function() { - assert.throws(function() { + it('throws if item content is not valid type', function () { + assert.throws(function () { FileSystem.create({ '/dir-a.0': { 'dir-b.0': { - 'file-c.0': undefined - } - } + 'file-c.0': undefined, + }, + }, }); }); - assert.throws(function() { + assert.throws(function () { FileSystem.create({ '/dir-a.0': { 'dir-b.0': { - 'file-c.0': 123 - } - } + 'file-c.0': 123, + }, + }, }); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.access.spec.js node-mock-fs-5.1.4/test/lib/fs.access.spec.js --- node-mock-fs-5.1.2/test/lib/fs.access.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.access.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,104 +1,105 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); + const assert = helper.assert; if (process.getuid && process.getgid) { // TODO: figure out how fs.access() works on Windows (without gid/uid) - describe('fs.access(path[, mode], callback)', function() { - beforeEach(function() { + describe('fs.access(path[, mode], callback)', function () { + beforeEach(function () { mock({ 'path/to/accessible/file': 'can access', 'path/to/000': mock.file({ mode: parseInt('0000', 8), - content: 'no permissions' + content: 'no permissions', }), 'path/to/111': mock.file({ mode: parseInt('0111', 8), - content: 'execute only' + content: 'execute only', }), 'path/to/write/only': mock.file({ mode: parseInt('0222', 8), - content: 'write only' + content: 'write only', }), 'path/to/333': mock.file({ mode: parseInt('0333', 8), - content: 'write and execute' + content: 'write and execute', }), 'path/to/444': mock.file({ mode: parseInt('0444', 8), - content: 'read only' + content: 'read only', }), 'path/to/555': mock.file({ mode: parseInt('0555', 8), - content: 'read and execute' + content: 'read and execute', }), 'path/to/666': mock.file({ mode: parseInt('0666', 8), - content: 'read and write' + content: 'read and write', }), 'path/to/777': mock.file({ mode: parseInt('0777', 8), - content: 'read, write, and execute' + content: 'read, write, and execute', }), unreadable: mock.directory({ mode: parseInt('0000', 8), items: { 'readable-child': mock.file({ mode: parseInt('0777', 8), - content: 'read, write, and execute' - }) - } - }) + content: 'read, write, and execute', + }), + }, + }), }); }); afterEach(mock.restore); - it('works for an accessible file', function(done) { + it('works for an accessible file', function (done) { fs.access('path/to/accessible/file', done); }); - it('supports Buffer input', function(done) { + it('supports Buffer input', function (done) { fs.access(Buffer.from('path/to/accessible/file'), done); }); - it('promise works for an accessible file', function(done) { + it('promise works for an accessible file', function (done) { fs.promises.access('path/to/accessible/file').then(done, done); }); - it('works 000 (and no mode arg)', function(done) { + it('works 000 (and no mode arg)', function (done) { fs.access('path/to/000', done); }); - it('promise works 000 (and no mode arg)', function(done) { + it('promise works 000 (and no mode arg)', function (done) { fs.promises.access('path/to/000').then(done, done); }); - it('works F_OK and 000', function(done) { + it('works F_OK and 000', function (done) { fs.access('path/to/000', fs.F_OK, done); }); - it('promise works F_OK and 000', function(done) { + it('promise works F_OK and 000', function (done) { fs.promises.access('path/to/000', fs.F_OK).then(done, done); }); - it('generates EACCES for R_OK and 000', function(done) { - fs.access('path/to/000', fs.R_OK, function(err) { + it('generates EACCES for R_OK and 000', function (done) { + fs.access('path/to/000', fs.R_OK, function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise generates EACCES for R_OK and 000', function(done) { + it('promise generates EACCES for R_OK and 000', function (done) { fs.promises.access('path/to/000', fs.R_OK).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -106,20 +107,20 @@ ); }); - it('generates EACCES for W_OK and 000', function(done) { - fs.access('path/to/000', fs.W_OK, function(err) { + it('generates EACCES for W_OK and 000', function (done) { + fs.access('path/to/000', fs.W_OK, function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise generates EACCES for W_OK and 000', function(done) { + it('promise generates EACCES for W_OK and 000', function (done) { fs.promises.access('path/to/000', fs.W_OK).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -127,20 +128,20 @@ ); }); - it('generates EACCES for X_OK and 000', function(done) { - fs.access('path/to/000', fs.X_OK, function(err) { + it('generates EACCES for X_OK and 000', function (done) { + fs.access('path/to/000', fs.X_OK, function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise generates EACCES for X_OK and 000', function(done) { + it('promise generates EACCES for X_OK and 000', function (done) { fs.promises.access('path/to/000', fs.X_OK).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -148,44 +149,44 @@ ); }); - it('works 111 (and no mode arg)', function(done) { + it('works 111 (and no mode arg)', function (done) { fs.access('path/to/111', done); }); - it('promise works 111 (and no mode arg)', function(done) { + it('promise works 111 (and no mode arg)', function (done) { fs.promises.access('path/to/111').then(done, done); }); - it('works F_OK and 111', function(done) { + it('works F_OK and 111', function (done) { fs.access('path/to/111', fs.F_OK, done); }); - it('promise works F_OK and 111', function(done) { + it('promise works F_OK and 111', function (done) { fs.promises.access('path/to/111', fs.F_OK).then(done, done); }); - it('works X_OK and 111', function(done) { + it('works X_OK and 111', function (done) { fs.access('path/to/111', fs.X_OK, done); }); - it('promise works X_OK and 111', function(done) { + it('promise works X_OK and 111', function (done) { fs.promises.access('path/to/111', fs.X_OK).then(done, done); }); - it('generates EACCES for R_OK and 111', function(done) { - fs.access('path/to/111', fs.R_OK, function(err) { + it('generates EACCES for R_OK and 111', function (done) { + fs.access('path/to/111', fs.R_OK, function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise generates EACCES for R_OK and 111', function(done) { + it('promise generates EACCES for R_OK and 111', function (done) { fs.promises.access('path/to/111', fs.R_OK).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -193,20 +194,20 @@ ); }); - it('generates EACCES for W_OK and 111', function(done) { - fs.access('path/to/111', fs.W_OK, function(err) { + it('generates EACCES for W_OK and 111', function (done) { + fs.access('path/to/111', fs.W_OK, function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise generates EACCES for W_OK and 111', function(done) { + it('promise generates EACCES for W_OK and 111', function (done) { fs.promises.access('path/to/111', fs.W_OK).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -214,44 +215,44 @@ ); }); - it('works for 222 (and no mode arg)', function(done) { + it('works for 222 (and no mode arg)', function (done) { fs.access('path/to/write/only', done); }); - it('promise works for 222 (and no mode arg)', function(done) { + it('promise works for 222 (and no mode arg)', function (done) { fs.promises.access('path/to/write/only').then(done, done); }); - it('works F_OK and 222', function(done) { + it('works F_OK and 222', function (done) { fs.access('path/to/write/only', fs.F_OK, done); }); - it('promise works F_OK and 222', function(done) { + it('promise works F_OK and 222', function (done) { fs.promises.access('path/to/write/only', fs.F_OK).then(done, done); }); - it('works W_OK and 222', function(done) { + it('works W_OK and 222', function (done) { fs.access('path/to/write/only', fs.W_OK, done); }); - it('promise works W_OK and 222', function(done) { + it('promise works W_OK and 222', function (done) { fs.promises.access('path/to/write/only', fs.W_OK).then(done, done); }); - it('generates EACCES for R_OK and 222', function(done) { - fs.access('path/to/write/only', fs.R_OK, function(err) { + it('generates EACCES for R_OK and 222', function (done) { + fs.access('path/to/write/only', fs.R_OK, function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise generates EACCES for R_OK and 222', function(done) { + it('promise generates EACCES for R_OK and 222', function (done) { fs.promises.access('path/to/write/only', fs.R_OK).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -259,20 +260,20 @@ ); }); - it('generates EACCES for X_OK and 222', function(done) { - fs.access('path/to/write/only', fs.X_OK, function(err) { + it('generates EACCES for X_OK and 222', function (done) { + fs.access('path/to/write/only', fs.X_OK, function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise generates EACCES for X_OK and 222', function(done) { + it('promise generates EACCES for X_OK and 222', function (done) { fs.promises.access('path/to/write/only', fs.X_OK).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -280,60 +281,60 @@ ); }); - it('works for 333 (and no mode arg)', function(done) { + it('works for 333 (and no mode arg)', function (done) { fs.access('path/to/333', done); }); - it('promise works for 333 (and no mode arg)', function(done) { + it('promise works for 333 (and no mode arg)', function (done) { fs.promises.access('path/to/333').then(done, done); }); - it('works F_OK and 333', function(done) { + it('works F_OK and 333', function (done) { fs.access('path/to/333', fs.F_OK, done); }); - it('promise works F_OK and 333', function(done) { + it('promise works F_OK and 333', function (done) { fs.promises.access('path/to/333', fs.F_OK).then(done, done); }); - it('works W_OK and 333', function(done) { + it('works W_OK and 333', function (done) { fs.access('path/to/333', fs.W_OK, done); }); - it('promise works W_OK and 333', function(done) { + it('promise works W_OK and 333', function (done) { fs.promises.access('path/to/333', fs.W_OK).then(done, done); }); - it('works X_OK and 333', function(done) { + it('works X_OK and 333', function (done) { fs.access('path/to/333', fs.X_OK, done); }); - it('promise works X_OK and 333', function(done) { + it('promise works X_OK and 333', function (done) { fs.promises.access('path/to/333', fs.X_OK).then(done, done); }); - it('works X_OK | W_OK and 333', function(done) { + it('works X_OK | W_OK and 333', function (done) { fs.access('path/to/333', fs.X_OK | fs.W_OK, done); }); - it('promise works X_OK | W_OK and 333', function(done) { + it('promise works X_OK | W_OK and 333', function (done) { fs.promises.access('path/to/333', fs.X_OK | fs.W_OK).then(done, done); }); - it('generates EACCES for R_OK and 333', function(done) { - fs.access('path/to/333', fs.R_OK, function(err) { + it('generates EACCES for R_OK and 333', function (done) { + fs.access('path/to/333', fs.R_OK, function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise generates EACCES for R_OK and 333', function(done) { + it('promise generates EACCES for R_OK and 333', function (done) { fs.promises.access('path/to/333', fs.R_OK).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -341,44 +342,44 @@ ); }); - it('works for 444 (and no mode arg)', function(done) { + it('works for 444 (and no mode arg)', function (done) { fs.access('path/to/444', done); }); - it('promise works for 444 (and no mode arg)', function(done) { + it('promise works for 444 (and no mode arg)', function (done) { fs.promises.access('path/to/444').then(done, done); }); - it('works F_OK and 444', function(done) { + it('works F_OK and 444', function (done) { fs.access('path/to/444', fs.F_OK, done); }); - it('promise works F_OK and 444', function(done) { + it('promise works F_OK and 444', function (done) { fs.promises.access('path/to/444', fs.F_OK).then(done, done); }); - it('works R_OK and 444', function(done) { + it('works R_OK and 444', function (done) { fs.access('path/to/444', fs.R_OK, done); }); - it('promise works R_OK and 444', function(done) { + it('promise works R_OK and 444', function (done) { fs.promises.access('path/to/444', fs.R_OK).then(done, done); }); - it('generates EACCES for W_OK and 444', function(done) { - fs.access('path/to/444', fs.W_OK, function(err) { + it('generates EACCES for W_OK and 444', function (done) { + fs.access('path/to/444', fs.W_OK, function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise generates EACCES for W_OK and 444', function(done) { + it('promise generates EACCES for W_OK and 444', function (done) { fs.promises.access('path/to/444', fs.W_OK).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -386,20 +387,20 @@ ); }); - it('generates EACCES for X_OK and 444', function(done) { - fs.access('path/to/444', fs.X_OK, function(err) { + it('generates EACCES for X_OK and 444', function (done) { + fs.access('path/to/444', fs.X_OK, function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise generates EACCES for X_OK and 444', function(done) { + it('promise generates EACCES for X_OK and 444', function (done) { fs.promises.access('path/to/444', fs.X_OK).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -407,60 +408,60 @@ ); }); - it('works for 555 (and no mode arg)', function(done) { + it('works for 555 (and no mode arg)', function (done) { fs.access('path/to/555', done); }); - it('promise works for 555 (and no mode arg)', function(done) { + it('promise works for 555 (and no mode arg)', function (done) { fs.promises.access('path/to/555').then(done, done); }); - it('works F_OK and 555', function(done) { + it('works F_OK and 555', function (done) { fs.access('path/to/555', fs.F_OK, done); }); - it('promise works F_OK and 555', function(done) { + it('promise works F_OK and 555', function (done) { fs.promises.access('path/to/555', fs.F_OK).then(done, done); }); - it('works R_OK and 555', function(done) { + it('works R_OK and 555', function (done) { fs.access('path/to/555', fs.R_OK, done); }); - it('promise works R_OK and 555', function(done) { + it('promise works R_OK and 555', function (done) { fs.promises.access('path/to/555', fs.R_OK).then(done, done); }); - it('works X_OK and 555', function(done) { + it('works X_OK and 555', function (done) { fs.access('path/to/555', fs.X_OK, done); }); - it('promise works X_OK and 555', function(done) { + it('promise works X_OK and 555', function (done) { fs.promises.access('path/to/555', fs.X_OK).then(done, done); }); - it('works R_OK | X_OK and 555', function(done) { + it('works R_OK | X_OK and 555', function (done) { fs.access('path/to/555', fs.R_OK | fs.X_OK, done); }); - it('promise works R_OK | X_OK and 555', function(done) { + it('promise works R_OK | X_OK and 555', function (done) { fs.promises.access('path/to/555', fs.R_OK | fs.X_OK).then(done, done); }); - it('generates EACCES for W_OK and 555', function(done) { - fs.access('path/to/555', fs.W_OK, function(err) { + it('generates EACCES for W_OK and 555', function (done) { + fs.access('path/to/555', fs.W_OK, function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise generates EACCES for W_OK and 555', function(done) { + it('promise generates EACCES for W_OK and 555', function (done) { fs.promises.access('path/to/555', fs.W_OK).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -468,60 +469,60 @@ ); }); - it('works for 666 (and no mode arg)', function(done) { + it('works for 666 (and no mode arg)', function (done) { fs.access('path/to/666', done); }); - it('promise works for 666 (and no mode arg)', function(done) { + it('promise works for 666 (and no mode arg)', function (done) { fs.promises.access('path/to/666').then(done, done); }); - it('works F_OK and 666', function(done) { + it('works F_OK and 666', function (done) { fs.access('path/to/666', fs.F_OK, done); }); - it('promise works F_OK and 666', function(done) { + it('promise works F_OK and 666', function (done) { fs.promises.access('path/to/666', fs.F_OK).then(done, done); }); - it('works R_OK and 666', function(done) { + it('works R_OK and 666', function (done) { fs.access('path/to/666', fs.R_OK, done); }); - it('promise works R_OK and 666', function(done) { + it('promise works R_OK and 666', function (done) { fs.promises.access('path/to/666', fs.R_OK).then(done, done); }); - it('works W_OK and 666', function(done) { + it('works W_OK and 666', function (done) { fs.access('path/to/666', fs.W_OK, done); }); - it('promise works W_OK and 666', function(done) { + it('promise works W_OK and 666', function (done) { fs.promises.access('path/to/666', fs.W_OK).then(done, done); }); - it('works R_OK | W_OK and 666', function(done) { + it('works R_OK | W_OK and 666', function (done) { fs.access('path/to/666', fs.R_OK | fs.W_OK, done); }); - it('promise works R_OK | W_OK and 666', function(done) { + it('promise works R_OK | W_OK and 666', function (done) { fs.promises.access('path/to/666', fs.R_OK | fs.W_OK).then(done, done); }); - it('generates EACCES for X_OK and 666', function(done) { - fs.access('path/to/666', fs.X_OK, function(err) { + it('generates EACCES for X_OK and 666', function (done) { + fs.access('path/to/666', fs.X_OK, function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise generates EACCES for X_OK and 666', function(done) { + it('promise generates EACCES for X_OK and 666', function (done) { fs.promises.access('path/to/666', fs.X_OK).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -529,94 +530,94 @@ ); }); - it('works for 777 (and no mode arg)', function(done) { + it('works for 777 (and no mode arg)', function (done) { fs.access('path/to/777', done); }); - it('promise works for 777 (and no mode arg)', function(done) { + it('promise works for 777 (and no mode arg)', function (done) { fs.promises.access('path/to/777').then(done, done); }); - it('works F_OK and 777', function(done) { + it('works F_OK and 777', function (done) { fs.access('path/to/777', fs.F_OK, done); }); - it('promise works F_OK and 777', function(done) { + it('promise works F_OK and 777', function (done) { fs.promises.access('path/to/777', fs.F_OK).then(done, done); }); - it('works R_OK and 777', function(done) { + it('works R_OK and 777', function (done) { fs.access('path/to/777', fs.R_OK, done); }); - it('promise works R_OK and 777', function(done) { + it('promise works R_OK and 777', function (done) { fs.promises.access('path/to/777', fs.R_OK).then(done, done); }); - it('works W_OK and 777', function(done) { + it('works W_OK and 777', function (done) { fs.access('path/to/777', fs.W_OK, done); }); - it('promise works W_OK and 777', function(done) { + it('promise works W_OK and 777', function (done) { fs.promises.access('path/to/777', fs.W_OK).then(done, done); }); - it('works X_OK and 777', function(done) { + it('works X_OK and 777', function (done) { fs.access('path/to/777', fs.X_OK, done); }); - it('promise works X_OK and 777', function(done) { + it('promise works X_OK and 777', function (done) { fs.promises.access('path/to/777', fs.X_OK).then(done, done); }); - it('works X_OK | W_OK and 777', function(done) { + it('works X_OK | W_OK and 777', function (done) { fs.access('path/to/777', fs.X_OK | fs.W_OK, done); }); - it('promise works X_OK | W_OK and 777', function(done) { + it('promise works X_OK | W_OK and 777', function (done) { fs.promises.access('path/to/777', fs.X_OK | fs.W_OK).then(done, done); }); - it('works X_OK | R_OK and 777', function(done) { + it('works X_OK | R_OK and 777', function (done) { fs.access('path/to/777', fs.X_OK | fs.R_OK, done); }); - it('promise works X_OK | R_OK and 777', function(done) { + it('promise works X_OK | R_OK and 777', function (done) { fs.promises.access('path/to/777', fs.X_OK | fs.R_OK).then(done, done); }); - it('works R_OK | W_OK and 777', function(done) { + it('works R_OK | W_OK and 777', function (done) { fs.access('path/to/777', fs.R_OK | fs.W_OK, done); }); - it('promise works R_OK | W_OK and 777', function(done) { + it('promise works R_OK | W_OK and 777', function (done) { fs.promises.access('path/to/777', fs.R_OK | fs.W_OK).then(done, done); }); - it('works R_OK | W_OK | X_OK and 777', function(done) { + it('works R_OK | W_OK | X_OK and 777', function (done) { fs.access('path/to/777', fs.R_OK | fs.W_OK | fs.X_OK, done); }); - it('promise works R_OK | W_OK | X_OK and 777', function(done) { + it('promise works R_OK | W_OK | X_OK and 777', function (done) { fs.promises .access('path/to/777', fs.R_OK | fs.W_OK | fs.X_OK) .then(done, done); }); - it('generates EACCESS for F_OK and an unreadable parent', function(done) { - fs.access('unreadable/readable-child', function(err) { + it('generates EACCESS for F_OK and an unreadable parent', function (done) { + fs.access('unreadable/readable-child', function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise generates EACCESS for F_OK and an unreadable parent', function(done) { + it('promise generates EACCESS for F_OK and an unreadable parent', function (done) { fs.promises.access('unreadable/readable-child').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -625,25 +626,25 @@ }); }); - describe('fs.accessSync(path[, mode])', function() { - beforeEach(function() { + describe('fs.accessSync(path[, mode])', function () { + beforeEach(function () { mock({ 'path/to/777': mock.file({ mode: parseInt('0777', 8), - content: 'all access' + content: 'all access', }), 'path/to/000': mock.file({ mode: parseInt('0000', 8), - content: 'no permissions' + content: 'no permissions', }), 'broken-link': mock.symlink({path: './path/to/nothing'}), 'circular-link': mock.symlink({path: './loop-link'}), - 'loop-link': mock.symlink({path: './circular-link'}) + 'loop-link': mock.symlink({path: './circular-link'}), }); }); afterEach(mock.restore); - it('works for an accessible file', function() { + it('works for an accessible file', function () { fs.accessSync('path/to/777'); fs.accessSync('path/to/777', fs.F_OK); fs.accessSync('path/to/777', fs.X_OK); @@ -655,39 +656,39 @@ fs.accessSync('path/to/777', fs.X_OK | fs.W_OK | fs.R_OK); }); - it('throws EACCESS for broken link', function() { - assert.throws(function() { + it('throws EACCESS for broken link', function () { + assert.throws(function () { fs.accessSync('broken-link'); }); }); - it('throws ELOOP for circular link', function() { - assert.throws(function() { + it('throws ELOOP for circular link', function () { + assert.throws(function () { fs.accessSync('circular-link'); }); }); - it('throws EACCESS for all but F_OK for 000', function() { + it('throws EACCESS for all but F_OK for 000', function () { fs.accessSync('path/to/000'); - assert.throws(function() { + assert.throws(function () { fs.accessSync('path/to/000', fs.X_OK); }); - assert.throws(function() { + assert.throws(function () { fs.accessSync('path/to/000', fs.W_OK); }); - assert.throws(function() { + assert.throws(function () { fs.accessSync('path/to/000', fs.X_OK | fs.W_OK); }); - assert.throws(function() { + assert.throws(function () { fs.accessSync('path/to/000', fs.R_OK); }); - assert.throws(function() { + assert.throws(function () { fs.accessSync('path/to/000', fs.X_OK | fs.R_OK); }); - assert.throws(function() { + assert.throws(function () { fs.accessSync('path/to/000', fs.W_OK | fs.R_OK); }); - assert.throws(function() { + assert.throws(function () { fs.accessSync('path/to/000', fs.X_OK | fs.W_OK | fs.R_OK); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.appendFile.spec.js node-mock-fs-5.1.4/test/lib/fs.appendFile.spec.js --- node-mock-fs-5.1.2/test/lib/fs.appendFile.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.appendFile.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,22 +1,22 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; -describe('fs.appendFile(filename, data, [options], callback)', function() { - beforeEach(function() { +describe('fs.appendFile(filename, data, [options], callback)', function () { + beforeEach(function () { mock({ 'dir/file.txt': 'file content', - 'link.txt': mock.symlink({path: 'dir/file.txt'}) + 'link.txt': mock.symlink({path: 'dir/file.txt'}), }); }); afterEach(mock.restore); - it('writes a string to a new file', function(done) { - fs.appendFile('foo', 'bar', function(err) { + it('writes a string to a new file', function (done) { + fs.appendFile('foo', 'bar', function (err) { if (err) { return done(err); } @@ -25,15 +25,15 @@ }); }); - it('promise writes a string to a new file', function(done) { - fs.promises.appendFile('foo', 'bar').then(function() { + it('promise writes a string to a new file', function (done) { + fs.promises.appendFile('foo', 'bar').then(function () { assert.equal(String(fs.readFileSync('foo')), 'bar'); done(); }, done); }); - it('appends a string to an existing file', function(done) { - fs.appendFile('dir/file.txt', ' bar', function(err) { + it('appends a string to an existing file', function (done) { + fs.appendFile('dir/file.txt', ' bar', function (err) { if (err) { return done(err); } @@ -42,15 +42,15 @@ }); }); - it('promise appends a string to an existing file', function(done) { - fs.promises.appendFile('dir/file.txt', ' bar').then(function() { + it('promise appends a string to an existing file', function (done) { + fs.promises.appendFile('dir/file.txt', ' bar').then(function () { assert.equal(String(fs.readFileSync('dir/file.txt')), 'file content bar'); done(); }, done); }); - it('appends a buffer to a file', function(done) { - fs.appendFile('dir/file.txt', Buffer.from(' bar'), function(err) { + it('appends a buffer to a file', function (done) { + fs.appendFile('dir/file.txt', Buffer.from(' bar'), function (err) { if (err) { return done(err); } @@ -59,10 +59,10 @@ }); }); - it('promise appends a buffer to a file', function(done) { + it('promise appends a buffer to a file', function (done) { fs.promises .appendFile('dir/file.txt', Buffer.from(' bar')) - .then(function() { + .then(function () { assert.equal( String(fs.readFileSync('dir/file.txt')), 'file content bar' @@ -71,8 +71,8 @@ }, done); }); - it('appends via a symbolic link file', function(done) { - fs.appendFile('link.txt', ' bar', function(err) { + it('appends via a symbolic link file', function (done) { + fs.appendFile('link.txt', ' bar', function (err) { if (err) { return done(err); } @@ -81,26 +81,26 @@ }); }); - it('promise appends via a symbolic link file', function(done) { - fs.promises.appendFile('link.txt', ' bar').then(function() { + it('promise appends via a symbolic link file', function (done) { + fs.promises.appendFile('link.txt', ' bar').then(function () { assert.equal(String(fs.readFileSync('dir/file.txt')), 'file content bar'); done(); }, done); }); - it('fails if directory does not exist', function(done) { - fs.appendFile('foo/bar', 'baz', function(err) { + it('fails if directory does not exist', function (done) { + fs.appendFile('foo/bar', 'baz', function (err) { assert.instanceOf(err, Error); done(); }); }); - it('promise fails if directory does not exist', function(done) { + it('promise fails if directory does not exist', function (done) { fs.promises.appendFile('foo/bar', 'baz').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); @@ -109,26 +109,26 @@ }); }); -describe('fs.appendFileSync(filename, data, [options]', function() { - beforeEach(function() { +describe('fs.appendFileSync(filename, data, [options]', function () { + beforeEach(function () { mock({ - 'path/to/file': 'content' + 'path/to/file': 'content', }); }); afterEach(mock.restore); - it('writes a string to a new file', function() { + it('writes a string to a new file', function () { fs.appendFileSync('foo', 'bar'); assert.equal(String(fs.readFileSync('foo')), 'bar'); }); - it('appends a string to an existing file', function() { + it('appends a string to an existing file', function () { fs.appendFileSync('path/to/file', ' bar'); assert.equal(String(fs.readFileSync('path/to/file')), 'content bar'); }); - it('fails if directory does not exist', function() { - assert.throws(function() { + it('fails if directory does not exist', function () { + assert.throws(function () { fs.appendFileSync('foo/bar', 'baz'); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.chmod-fchmod.spec.js node-mock-fs-5.1.4/test/lib/fs.chmod-fchmod.spec.js --- node-mock-fs-5.1.2/test/lib/fs.chmod-fchmod.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.chmod-fchmod.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,21 +1,21 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; -describe('fs.chmod(path, mode, callback)', function() { - beforeEach(function() { +describe('fs.chmod(path, mode, callback)', function () { + beforeEach(function () { mock({ - 'file.txt': mock.file({mode: parseInt('0644', 8)}) + 'file.txt': mock.file({mode: parseInt('0644', 8)}), }); }); afterEach(mock.restore); - it('changes permissions of a file', function(done) { - fs.chmod('file.txt', parseInt('0664', 8), function(err) { + it('changes permissions of a file', function (done) { + fs.chmod('file.txt', parseInt('0664', 8), function (err) { if (err) { return done(err); } @@ -25,8 +25,8 @@ }); }); - it('supports Buffer input', function(done) { - fs.chmod(Buffer.from('file.txt'), parseInt('0664', 8), function(err) { + it('supports Buffer input', function (done) { + fs.chmod(Buffer.from('file.txt'), parseInt('0664', 8), function (err) { if (err) { return done(err); } @@ -36,28 +36,28 @@ }); }); - it('promise changes permissions of a file', function(done) { - fs.promises.chmod('file.txt', parseInt('0664', 8)).then(function() { + it('promise changes permissions of a file', function (done) { + fs.promises.chmod('file.txt', parseInt('0664', 8)).then(function () { const stats = fs.statSync('file.txt'); assert.equal(stats.mode & parseInt('0777', 8), parseInt('0664', 8)); done(); }, done); }); - it('fails if file does not exist', function(done) { - fs.chmod('bogus.txt', parseInt('0664', 8), function(err) { + it('fails if file does not exist', function (done) { + fs.chmod('bogus.txt', parseInt('0664', 8), function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); }); }); - it('promise fails if file does not exist', function(done) { + it('promise fails if file does not exist', function (done) { fs.promises.chmod('bogus.txt', parseInt('0664', 8)).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); @@ -66,38 +66,38 @@ }); }); -describe('fs.chmodSync(path, mode)', function() { - beforeEach(function() { +describe('fs.chmodSync(path, mode)', function () { + beforeEach(function () { mock({ - 'file.txt': mock.file({mode: parseInt('0666', 8)}) + 'file.txt': mock.file({mode: parseInt('0666', 8)}), }); }); afterEach(mock.restore); - it('changes permissions of a file', function() { + it('changes permissions of a file', function () { fs.chmodSync('file.txt', parseInt('0644', 8)); const stats = fs.statSync('file.txt'); assert.equal(stats.mode & parseInt('0777', 8), parseInt('0644', 8)); }); - it('fails if file does not exist', function() { - assert.throws(function() { + it('fails if file does not exist', function () { + assert.throws(function () { fs.chmodSync('bogus.txt', parseInt('0644', 8)); }); }); }); -describe('fs.fchmod(fd, mode, callback)', function() { - beforeEach(function() { +describe('fs.fchmod(fd, mode, callback)', function () { + beforeEach(function () { mock({ - 'file.txt': mock.file({mode: parseInt('0666', 8)}) + 'file.txt': mock.file({mode: parseInt('0666', 8)}), }); }); afterEach(mock.restore); - it('changes permissions of a file', function(done) { + it('changes permissions of a file', function (done) { const fd = fs.openSync('file.txt', 'r'); - fs.fchmod(fd, parseInt('0644', 8), function(err) { + fs.fchmod(fd, parseInt('0644', 8), function (err) { if (err) { return done(err); } @@ -107,13 +107,13 @@ }); }); - it('promise changes permissions of a file', function(done) { + it('promise changes permissions of a file', function (done) { fs.promises .open('file.txt', 'r') - .then(function(fd) { + .then(function (fd) { return fd.chmod(parseInt('0644', 8)); }) - .then(function() { + .then(function () { const stats = fs.statSync('file.txt'); assert.equal(stats.mode & parseInt('0777', 8), parseInt('0644', 8)); done(); @@ -121,15 +121,15 @@ }); }); -describe('fs.fchmodSync(fd, mode)', function() { - beforeEach(function() { +describe('fs.fchmodSync(fd, mode)', function () { + beforeEach(function () { mock({ - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('changes permissions of a file', function() { + it('changes permissions of a file', function () { const fd = fs.openSync('file.txt', 'r'); fs.fchmodSync(fd, parseInt('0444', 8)); const stats = fs.statSync('file.txt'); diff -Nru node-mock-fs-5.1.2/test/lib/fs.chown-fchown.spec.js node-mock-fs-5.1.4/test/lib/fs.chown-fchown.spec.js --- node-mock-fs-5.1.2/test/lib/fs.chown-fchown.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.chown-fchown.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,45 +1,45 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; -describe('fs.chown(path, uid, gid, callback)', function() { - beforeEach(function() { +describe('fs.chown(path, uid, gid, callback)', function () { + beforeEach(function () { mock({ 'path/empty': {}, - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('changes ownership of a file', function(done) { + it('changes ownership of a file', function (done) { fs.chown('file.txt', 42, 43, done); }); - it('supports Buffer input', function(done) { + it('supports Buffer input', function (done) { fs.chown(Buffer.from('file.txt'), 42, 43, done); }); - it('promise changes ownership of a file', function(done) { + it('promise changes ownership of a file', function (done) { fs.promises.chown('file.txt', 42, 43).then(done, done); }); - it('fails if file does not exist', function(done) { - fs.chown('bogus.txt', 42, 43, function(err) { + it('fails if file does not exist', function (done) { + fs.chown('bogus.txt', 42, 43, function (err) { assert.instanceOf(err, Error); done(); }); }); - it('promise fails if file does not exist', function(done) { + it('promise fails if file does not exist', function (done) { fs.promises.chown('bogus.txt', 42, 43).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); @@ -48,60 +48,60 @@ }); }); -describe('fs.chownSync(path, uid, gid)', function() { - beforeEach(function() { +describe('fs.chownSync(path, uid, gid)', function () { + beforeEach(function () { mock({ 'path/empty': {}, - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('changes ownership of a file', function() { + it('changes ownership of a file', function () { fs.chownSync('file.txt', 42, 43); }); - it('fails if file does not exist', function() { - assert.throws(function() { + it('fails if file does not exist', function () { + assert.throws(function () { fs.chownSync('bogus.txt', 42, 43); }); }); }); -describe('fs.fchown(fd, uid, gid, callback)', function() { - beforeEach(function() { +describe('fs.fchown(fd, uid, gid, callback)', function () { + beforeEach(function () { mock({ 'path/empty': {}, - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('changes ownership of a file', function(done) { + it('changes ownership of a file', function (done) { const fd = fs.openSync('file.txt', 'r'); fs.fchown(fd, 42, 43, done); }); - it('promise changes ownership of a file', function(done) { + it('promise changes ownership of a file', function (done) { fs.promises .open('file.txt', 'r') - .then(function(fd) { + .then(function (fd) { return fd.chown(42, 43); }) .then(done, done); }); }); -describe('fs.fchownSync(fd, uid, gid)', function() { - beforeEach(function() { +describe('fs.fchownSync(fd, uid, gid)', function () { + beforeEach(function () { mock({ 'path/empty': {}, - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('changes ownership of a file', function() { + it('changes ownership of a file', function () { const fd = fs.openSync('file.txt', 'r'); fs.fchownSync(fd, 42, 43); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.copyFile.spec.js node-mock-fs-5.1.4/test/lib/fs.copyFile.spec.js --- node-mock-fs-5.1.2/test/lib/fs.copyFile.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.copyFile.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,24 +1,24 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; if (fs.copyFile && fs.copyFileSync) { - describe('fs.copyFile(src, dest[, flags], callback)', function() { - beforeEach(function() { + describe('fs.copyFile(src, dest[, flags], callback)', function () { + beforeEach(function () { mock({ 'path/to/src.txt': 'file content', 'path/to/other.txt': 'other file content', - empty: {} + empty: {}, }); }); afterEach(mock.restore); - it('copies a file to an empty directory', function(done) { - fs.copyFile('path/to/src.txt', 'empty/dest.txt', function(err) { + it('copies a file to an empty directory', function (done) { + fs.copyFile('path/to/src.txt', 'empty/dest.txt', function (err) { assert.isTrue(!err); assert.isTrue(fs.existsSync('empty/dest.txt')); assert.equal(String(fs.readFileSync('empty/dest.txt')), 'file content'); @@ -26,11 +26,11 @@ }); }); - it('supports Buffer input', function(done) { + it('supports Buffer input', function (done) { fs.copyFile( Buffer.from('path/to/src.txt'), Buffer.from('empty/dest.txt'), - function(err) { + function (err) { assert.isTrue(!err); assert.isTrue(fs.existsSync('empty/dest.txt')); assert.equal( @@ -42,10 +42,10 @@ ); }); - it('promise copies a file to an empty directory', function(done) { + it('promise copies a file to an empty directory', function (done) { fs.promises .copyFile('path/to/src.txt', 'empty/dest.txt') - .then(function() { + .then(function () { assert.isTrue(fs.existsSync('empty/dest.txt')); assert.equal( String(fs.readFileSync('empty/dest.txt')), @@ -55,8 +55,8 @@ }, done); }); - it('truncates dest file if it exists', function(done) { - fs.copyFile('path/to/src.txt', 'path/to/other.txt', function(err) { + it('truncates dest file if it exists', function (done) { + fs.copyFile('path/to/src.txt', 'path/to/other.txt', function (err) { assert.isTrue(!err); assert.equal( String(fs.readFileSync('path/to/other.txt')), @@ -66,10 +66,10 @@ }); }); - it('promise truncates dest file if it exists', function(done) { + it('promise truncates dest file if it exists', function (done) { fs.promises .copyFile('path/to/src.txt', 'path/to/other.txt') - .then(function() { + .then(function () { assert.equal( String(fs.readFileSync('path/to/other.txt')), 'file content' @@ -78,12 +78,12 @@ }, done); }); - it('throws if dest exists and exclusive', function(done) { + it('throws if dest exists and exclusive', function (done) { fs.copyFile( 'path/to/src.txt', 'path/to/other.txt', fs.constants.COPYFILE_EXCL, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EEXIST'); done(); @@ -91,7 +91,7 @@ ); }); - it('promise throws if dest exists and exclusive', function(done) { + it('promise throws if dest exists and exclusive', function (done) { fs.promises .copyFile( 'path/to/src.txt', @@ -99,10 +99,10 @@ fs.constants.COPYFILE_EXCL ) .then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EEXIST'); done(); @@ -110,20 +110,20 @@ ); }); - it('fails if src does not exist', function(done) { - fs.copyFile('path/to/bogus.txt', 'empty/dest.txt', function(err) { + it('fails if src does not exist', function (done) { + fs.copyFile('path/to/bogus.txt', 'empty/dest.txt', function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); }); }); - it('promise fails if src does not exist', function(done) { + it('promise fails if src does not exist', function (done) { fs.promises.copyFile('path/to/bogus.txt', 'empty/dest.txt').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); @@ -131,20 +131,20 @@ ); }); - it('fails if dest path does not exist', function(done) { - fs.copyFile('path/to/src.txt', 'path/nope/dest.txt', function(err) { + it('fails if dest path does not exist', function (done) { + fs.copyFile('path/to/src.txt', 'path/nope/dest.txt', function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); }); }); - it('promise fails if dest path does not exist', function(done) { + it('promise fails if dest path does not exist', function (done) { fs.promises.copyFile('path/to/src.txt', 'path/nope/dest.txt').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); @@ -152,20 +152,20 @@ ); }); - it('fails if dest is a directory', function(done) { - fs.copyFile('path/to/src.txt', 'empty', function(err) { + it('fails if dest is a directory', function (done) { + fs.copyFile('path/to/src.txt', 'empty', function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EISDIR'); done(); }); }); - it('promise fails if dest is a directory', function(done) { + it('promise fails if dest is a directory', function (done) { fs.promises.copyFile('path/to/src.txt', 'empty').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EISDIR'); done(); diff -Nru node-mock-fs-5.1.2/test/lib/fs.createReadStream.spec.js node-mock-fs-5.1.4/test/lib/fs.createReadStream.spec.js --- node-mock-fs-5.1.2/test/lib/fs.createReadStream.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.createReadStream.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,29 +1,29 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; -describe('fs.createReadStream(path, [options])', function() { - beforeEach(function() { +describe('fs.createReadStream(path, [options])', function () { + beforeEach(function () { mock({ - 'dir/source': 'source content' + 'dir/source': 'source content', }); }); afterEach(mock.restore); - it('creates a readable stream', function() { + it('creates a readable stream', function () { const stream = fs.createReadStream('dir/source'); assert.isTrue(stream.readable); }); - it('allows piping to a writable stream', function(done) { + it('allows piping to a writable stream', function (done) { const input = fs.createReadStream('dir/source'); const output = fs.createWriteStream('dir/dest'); - output.on('close', function() { - fs.readFile('dir/dest', function(err, data) { + output.on('close', function () { + fs.readFile('dir/dest', function (err, data) { if (err) { return done(err); } diff -Nru node-mock-fs-5.1.2/test/lib/fs.createWriteStream.spec.js node-mock-fs-5.1.4/test/lib/fs.createWriteStream.spec.js --- node-mock-fs-5.1.2/test/lib/fs.createWriteStream.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.createWriteStream.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,22 +1,22 @@ 'use strict'; const Writable = require('stream').Writable; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; -describe('fs.createWriteStream(path[, options])', function() { - beforeEach(function() { +describe('fs.createWriteStream(path[, options])', function () { + beforeEach(function () { mock(); }); afterEach(mock.restore); - it('provides a write stream for a file in buffered mode', function(done) { + it('provides a write stream for a file in buffered mode', function (done) { const output = fs.createWriteStream('test.txt'); - output.on('close', function() { - fs.readFile('test.txt', function(err, data) { + output.on('close', function () { + fs.readFile('test.txt', function (err, data) { if (err) { return done(err); } @@ -34,10 +34,10 @@ output.end(Buffer.from('content')); }); - it('provides a write stream for a file', function(done) { + it('provides a write stream for a file', function (done) { const output = fs.createWriteStream('test.txt'); - output.on('close', function() { - fs.readFile('test.txt', function(err, data) { + output.on('close', function () { + fs.readFile('test.txt', function (err, data) { if (err) { return done(err); } @@ -48,11 +48,11 @@ output.on('error', done); output.write(Buffer.from('lots ')); - setTimeout(function() { + setTimeout(function () { output.write(Buffer.from('of ')); - setTimeout(function() { + setTimeout(function () { output.write(Buffer.from('source ')); - setTimeout(function() { + setTimeout(function () { output.end(Buffer.from('content')); }, 50); }, 50); @@ -60,10 +60,10 @@ }); if (Writable && Writable.prototype.cork) { - it('works when write stream is corked', function(done) { + it('works when write stream is corked', function (done) { const output = fs.createWriteStream('test.txt'); - output.on('close', function() { - fs.readFile('test.txt', function(err, data) { + output.on('close', function () { + fs.readFile('test.txt', function (err, data) { if (err) { return done(err); } diff -Nru node-mock-fs-5.1.2/test/lib/fs.exists.spec.js node-mock-fs-5.1.4/test/lib/fs.exists.spec.js --- node-mock-fs-5.1.2/test/lib/fs.exists.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.exists.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,126 +1,126 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const path = require('path'); const assert = helper.assert; -describe('fs.exists(path, callback)', function() { - beforeEach(function() { +describe('fs.exists(path, callback)', function () { + beforeEach(function () { mock({ 'path/to/a.bin': Buffer.from([1, 2, 3]), empty: {}, nested: { dir: { - 'file.txt': '' - } - } + 'file.txt': '', + }, + }, }); }); afterEach(mock.restore); - it('calls with true if file exists', function(done) { - fs.exists(path.join('path', 'to', 'a.bin'), function(exists) { + it('calls with true if file exists', function (done) { + fs.exists(path.join('path', 'to', 'a.bin'), function (exists) { assert.isTrue(exists); done(); }); }); - it('calls with true if directory exists', function(done) { - fs.exists('path', function(exists) { + it('calls with true if directory exists', function (done) { + fs.exists('path', function (exists) { assert.isTrue(exists); done(); }); }); - it('calls with true if empty directory exists', function(done) { - fs.exists('empty', function(exists) { + it('calls with true if empty directory exists', function (done) { + fs.exists('empty', function (exists) { assert.isTrue(exists); done(); }); }); - it('calls with true if nested directory exists', function(done) { - fs.exists(path.join('nested', 'dir'), function(exists) { + it('calls with true if nested directory exists', function (done) { + fs.exists(path.join('nested', 'dir'), function (exists) { assert.isTrue(exists); done(); }); }); - it('calls with true if file exists', function(done) { - fs.exists(path.join('path', 'to', 'a.bin'), function(exists) { + it('calls with true if file exists', function (done) { + fs.exists(path.join('path', 'to', 'a.bin'), function (exists) { assert.isTrue(exists); done(); }); }); - it('calls with true if empty file exists', function(done) { - fs.exists(path.join('nested', 'dir', 'file.txt'), function(exists) { + it('calls with true if empty file exists', function (done) { + fs.exists(path.join('nested', 'dir', 'file.txt'), function (exists) { assert.isTrue(exists); done(); }); }); - it('calls with false for bogus path', function(done) { - fs.exists(path.join('bogus', 'path'), function(exists) { + it('calls with false for bogus path', function (done) { + fs.exists(path.join('bogus', 'path'), function (exists) { assert.isFalse(exists); done(); }); }); - it('calls with false for bogus path (II)', function(done) { - fs.exists(path.join('nested', 'dir', 'none'), function(exists) { + it('calls with false for bogus path (II)', function (done) { + fs.exists(path.join('nested', 'dir', 'none'), function (exists) { assert.isFalse(exists); done(); }); }); }); -describe('fs.existsSync(path)', function() { - beforeEach(function() { +describe('fs.existsSync(path)', function () { + beforeEach(function () { mock({ 'path/to/a.bin': Buffer.from([1, 2, 3]), empty: {}, nested: { dir: { - 'file.txt': '' - } - } + 'file.txt': '', + }, + }, }); }); afterEach(mock.restore); - it('returns true if file exists', function() { + it('returns true if file exists', function () { assert.isTrue(fs.existsSync(path.join('path', 'to', 'a.bin'))); }); - it('returns true if directory exists', function() { + it('returns true if directory exists', function () { assert.isTrue(fs.existsSync('path')); }); - it('returns true if empty directory exists', function() { + it('returns true if empty directory exists', function () { assert.isTrue(fs.existsSync('empty')); }); - it('returns true if nested directory exists', function() { + it('returns true if nested directory exists', function () { assert.isTrue(fs.existsSync(path.join('nested', 'dir'))); }); - it('returns true if file exists', function() { + it('returns true if file exists', function () { assert.isTrue(fs.existsSync(path.join('path', 'to', 'a.bin'))); }); - it('returns true if empty file exists', function() { + it('returns true if empty file exists', function () { assert.isTrue(fs.existsSync(path.join('nested', 'dir', 'file.txt'))); }); - it('returns false for bogus path', function() { + it('returns false for bogus path', function () { assert.isFalse(fs.existsSync(path.join('bogus', 'path'))); }); - it('returns false for bogus path (II)', function() { + it('returns false for bogus path (II)', function () { assert.isFalse(fs.existsSync(path.join('nested', 'dir', 'none'))); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.link-symlink.spec.js node-mock-fs-5.1.4/test/lib/fs.link-symlink.spec.js --- node-mock-fs-5.1.2/test/lib/fs.link-symlink.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.link-symlink.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,25 +1,25 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; const inVersion = helper.inVersion; -describe('fs.link(srcpath, dstpath, callback)', function() { - beforeEach(function() { +describe('fs.link(srcpath, dstpath, callback)', function () { + beforeEach(function () { mock({ dir: {}, - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('creates a link to a file', function(done) { + it('creates a link to a file', function (done) { assert.equal(fs.statSync('file.txt').nlink, 1); - fs.link('file.txt', 'link.txt', function(err) { + fs.link('file.txt', 'link.txt', function (err) { if (err) { return done(err); } @@ -31,10 +31,10 @@ }); }); - it('supports Buffer input', function(done) { + it('supports Buffer input', function (done) { assert.equal(fs.statSync('file.txt').nlink, 1); - fs.link(Buffer.from('file.txt'), Buffer.from('link.txt'), function(err) { + fs.link(Buffer.from('file.txt'), Buffer.from('link.txt'), function (err) { if (err) { return done(err); } @@ -46,10 +46,10 @@ }); }); - it('promise creates a link to a file', function(done) { + it('promise creates a link to a file', function (done) { assert.equal(fs.statSync('file.txt').nlink, 1); - fs.promises.link('file.txt', 'link.txt').then(function() { + fs.promises.link('file.txt', 'link.txt').then(function () { assert.isTrue(fs.statSync('link.txt').isFile()); assert.equal(fs.statSync('link.txt').nlink, 2); assert.equal(fs.statSync('file.txt').nlink, 2); @@ -58,8 +58,8 @@ }, done); }); - it('works if original is renamed', function(done) { - fs.link('file.txt', 'link.txt', function(err) { + it('works if original is renamed', function (done) { + fs.link('file.txt', 'link.txt', function (err) { if (err) { return done(err); } @@ -70,8 +70,8 @@ }); }); - it('promise works if original is renamed', function(done) { - fs.promises.link('file.txt', 'link.txt').then(function() { + it('promise works if original is renamed', function (done) { + fs.promises.link('file.txt', 'link.txt').then(function () { fs.renameSync('file.txt', 'renamed.txt'); assert.isTrue(fs.statSync('link.txt').isFile()); assert.equal(String(fs.readFileSync('link.txt')), 'content'); @@ -79,10 +79,10 @@ }, done); }); - it('works if original is removed', function(done) { + it('works if original is removed', function (done) { assert.equal(fs.statSync('file.txt').nlink, 1); - fs.link('file.txt', 'link.txt', function(err) { + fs.link('file.txt', 'link.txt', function (err) { if (err) { return done(err); } @@ -96,10 +96,10 @@ }); }); - it('promise works if original is removed', function(done) { + it('promise works if original is removed', function (done) { assert.equal(fs.statSync('file.txt').nlink, 1); - fs.promises.link('file.txt', 'link.txt').then(function() { + fs.promises.link('file.txt', 'link.txt').then(function () { assert.equal(fs.statSync('link.txt').nlink, 2); assert.equal(fs.statSync('file.txt').nlink, 2); fs.unlinkSync('file.txt'); @@ -110,20 +110,20 @@ }, done); }); - it('fails if original is a directory', function(done) { - fs.link('dir', 'link', function(err) { + it('fails if original is a directory', function (done) { + fs.link('dir', 'link', function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EPERM'); done(); }); }); - it('promise fails if original is a directory', function(done) { + it('promise fails if original is a directory', function (done) { fs.promises.link('dir', 'link').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EPERM'); done(); @@ -132,52 +132,52 @@ }); }); -describe('fs.linkSync(srcpath, dstpath)', function() { - beforeEach(function() { +describe('fs.linkSync(srcpath, dstpath)', function () { + beforeEach(function () { mock({ - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('creates a link to a file', function() { + it('creates a link to a file', function () { fs.linkSync('file.txt', 'link.txt'); assert.isTrue(fs.statSync('link.txt').isFile()); assert.equal(String(fs.readFileSync('link.txt')), 'content'); }); - it('works if original is renamed', function() { + it('works if original is renamed', function () { fs.linkSync('file.txt', 'link.txt'); fs.renameSync('file.txt', 'renamed.txt'); assert.isTrue(fs.statSync('link.txt').isFile()); assert.equal(String(fs.readFileSync('link.txt')), 'content'); }); - it('works if original is removed', function() { + it('works if original is removed', function () { fs.linkSync('file.txt', 'link.txt'); fs.unlinkSync('file.txt'); assert.isTrue(fs.statSync('link.txt').isFile()); assert.equal(String(fs.readFileSync('link.txt')), 'content'); }); - it('fails if original is a directory', function() { - assert.throws(function() { + it('fails if original is a directory', function () { + assert.throws(function () { fs.linkSync('dir', 'link'); }); }); }); -describe('fs.symlink(srcpath, dstpath, [type], callback)', function() { - beforeEach(function() { +describe('fs.symlink(srcpath, dstpath, [type], callback)', function () { + beforeEach(function () { mock({ dir: {}, - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('creates a symbolic link to a file', function(done) { - fs.symlink('../file.txt', 'dir/link.txt', function(err) { + it('creates a symbolic link to a file', function (done) { + fs.symlink('../file.txt', 'dir/link.txt', function (err) { if (err) { return done(err); } @@ -189,11 +189,11 @@ // https://github.com/nodejs/node/issues/34514 if (process.platform === 'win32') { - inVersion('>=15.0.0').it('supports Buffer input', function(done) { + inVersion('>=15.0.0').it('supports Buffer input', function (done) { fs.symlink( Buffer.from('../file.txt'), Buffer.from('dir/link.txt'), - function(err) { + function (err) { if (err) { return done(err); } @@ -204,11 +204,11 @@ ); }); } else { - it('supports Buffer input', function(done) { + it('supports Buffer input', function (done) { fs.symlink( Buffer.from('../file.txt'), Buffer.from('dir/link.txt'), - function(err) { + function (err) { if (err) { return done(err); } @@ -220,16 +220,16 @@ }); } - it('promise creates a symbolic link to a file', function(done) { - fs.promises.symlink('../file.txt', 'dir/link.txt').then(function() { + it('promise creates a symbolic link to a file', function (done) { + fs.promises.symlink('../file.txt', 'dir/link.txt').then(function () { assert.isTrue(fs.statSync('dir/link.txt').isFile()); assert.equal(String(fs.readFileSync('dir/link.txt')), 'content'); done(); }, done); }); - it('breaks if original is renamed', function(done) { - fs.symlink('file.txt', 'link.txt', function(err) { + it('breaks if original is renamed', function (done) { + fs.symlink('file.txt', 'link.txt', function (err) { if (err) { return done(err); } @@ -240,8 +240,8 @@ }); }); - it('promise breaks if original is renamed', function(done) { - fs.promises.symlink('file.txt', 'link.txt').then(function() { + it('promise breaks if original is renamed', function (done) { + fs.promises.symlink('file.txt', 'link.txt').then(function () { assert.isTrue(fs.existsSync('link.txt')); fs.renameSync('file.txt', 'renamed.txt'); assert.isFalse(fs.existsSync('link.txt')); @@ -249,8 +249,8 @@ }, done); }); - it('works if original is a directory', function(done) { - fs.symlink('dir', 'link', function(err) { + it('works if original is a directory', function (done) { + fs.symlink('dir', 'link', function (err) { if (err) { return done(err); } @@ -259,37 +259,37 @@ }); }); - it('promise works if original is a directory', function(done) { - fs.promises.symlink('dir', 'link').then(function() { + it('promise works if original is a directory', function (done) { + fs.promises.symlink('dir', 'link').then(function () { assert.isTrue(fs.statSync('link').isDirectory()); done(); }, done); }); }); -describe('fs.symlinkSync(srcpath, dstpath, [type])', function() { - beforeEach(function() { +describe('fs.symlinkSync(srcpath, dstpath, [type])', function () { + beforeEach(function () { mock({ dir: {}, - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('creates a symbolic link to a file', function() { + it('creates a symbolic link to a file', function () { fs.symlinkSync('../file.txt', 'dir/link.txt'); assert.isTrue(fs.statSync('dir/link.txt').isFile()); assert.equal(String(fs.readFileSync('dir/link.txt')), 'content'); }); - it('breaks if original is renamed', function() { + it('breaks if original is renamed', function () { fs.symlinkSync('file.txt', 'link.txt'); assert.isTrue(fs.existsSync('link.txt')); fs.renameSync('file.txt', 'renamed.txt'); assert.isFalse(fs.existsSync('link.txt')); }); - it('works if original is a directory', function() { + it('works if original is a directory', function () { fs.symlinkSync('dir', 'link'); assert.isTrue(fs.statSync('link').isDirectory()); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.lstat.spec.js node-mock-fs-5.1.4/test/lib/fs.lstat.spec.js --- node-mock-fs-5.1.2/test/lib/fs.lstat.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.lstat.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,28 +1,28 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; -describe('fs.lstat(path, options, callback)', function() { - beforeEach(function() { +describe('fs.lstat(path, options, callback)', function () { + beforeEach(function () { mock({ 'file.txt': mock.file({ content: 'content', - mtime: new Date(1) + mtime: new Date(1), }), link: mock.symlink({ path: './file.txt', - mtime: new Date(2) - }) + mtime: new Date(2), + }), }); }); afterEach(mock.restore); - it('stats a symbolic link', function(done) { - fs.lstat('link', function(err, stats) { + it('stats a symbolic link', function (done) { + fs.lstat('link', function (err, stats) { if (err) { return done(err); } @@ -33,8 +33,8 @@ }); }); - it('stats a symbolic link with bigint', function(done) { - fs.lstat('link', {bigint: true}, function(err, stats) { + it('stats a symbolic link with bigint', function (done) { + fs.lstat('link', {bigint: true}, function (err, stats) { if (err) { return done(err); } @@ -45,8 +45,8 @@ }); }); - it('suports Buffer input', function(done) { - fs.lstat(Buffer.from('link'), function(err, stats) { + it('suports Buffer input', function (done) { + fs.lstat(Buffer.from('link'), function (err, stats) { if (err) { return done(err); } @@ -57,8 +57,8 @@ }); }); - it('suports Buffer input with bigint', function(done) { - fs.lstat(Buffer.from('link'), {bigint: true}, function(err, stats) { + it('suports Buffer input with bigint', function (done) { + fs.lstat(Buffer.from('link'), {bigint: true}, function (err, stats) { if (err) { return done(err); } @@ -69,8 +69,8 @@ }); }); - it('promise stats a symbolic link', function(done) { - fs.promises.lstat('link').then(function(stats) { + it('promise stats a symbolic link', function (done) { + fs.promises.lstat('link').then(function (stats) { assert.isTrue(stats.isSymbolicLink()); assert.isFalse(stats.isFile()); assert.equal(stats.mtime.getTime(), 2); @@ -78,8 +78,8 @@ }, done); }); - it('promise stats a symbolic link with bigint', function(done) { - fs.promises.lstat('link', {bigint: true}).then(function(stats) { + it('promise stats a symbolic link with bigint', function (done) { + fs.promises.lstat('link', {bigint: true}).then(function (stats) { assert.isTrue(stats.isSymbolicLink()); assert.isFalse(stats.isFile()); assert.equal(typeof stats.mtimeMs, 'bigint'); @@ -87,8 +87,8 @@ }, done); }); - it('stats a regular file', function(done) { - fs.lstat('file.txt', function(err, stats) { + it('stats a regular file', function (done) { + fs.lstat('file.txt', function (err, stats) { if (err) { return done(err); } @@ -99,8 +99,8 @@ }); }); - it('stats a regular file with bigint', function(done) { - fs.lstat('file.txt', {bigint: true}, function(err, stats) { + it('stats a regular file with bigint', function (done) { + fs.lstat('file.txt', {bigint: true}, function (err, stats) { if (err) { return done(err); } @@ -111,8 +111,8 @@ }); }); - it('promise stats a regular file', function(done) { - fs.promises.lstat('file.txt').then(function(stats) { + it('promise stats a regular file', function (done) { + fs.promises.lstat('file.txt').then(function (stats) { assert.isTrue(stats.isFile()); assert.isFalse(stats.isSymbolicLink()); assert.equal(stats.mtime.getTime(), 1); @@ -120,8 +120,8 @@ }, done); }); - it('promise stats a regular file with bigint', function(done) { - fs.promises.lstat('file.txt', {bigint: true}).then(function(stats) { + it('promise stats a regular file with bigint', function (done) { + fs.promises.lstat('file.txt', {bigint: true}).then(function (stats) { assert.isTrue(stats.isFile()); assert.isFalse(stats.isSymbolicLink()); assert.equal(typeof stats.mtimeMs, 'bigint'); @@ -129,20 +129,20 @@ }, done); }); - it('fails on file not exist', function(done) { - fs.lstat('bogus', function(err, stats) { + it('fails on file not exist', function (done) { + fs.lstat('bogus', function (err, stats) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); }); }); - it('promise fails on file not exist', function(done) { + it('promise fails on file not exist', function (done) { fs.promises.lstat('bogus').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); @@ -151,51 +151,51 @@ }); }); -describe('fs.lstatSync(path, options)', function() { - beforeEach(function() { +describe('fs.lstatSync(path, options)', function () { + beforeEach(function () { mock({ 'file.txt': mock.file({ content: 'content', - mtime: new Date(1) + mtime: new Date(1), }), link: mock.symlink({ path: './file.txt', - mtime: new Date(2) - }) + mtime: new Date(2), + }), }); }); afterEach(mock.restore); - it('stats a symbolic link', function() { + it('stats a symbolic link', function () { const stats = fs.lstatSync('link'); assert.isTrue(stats.isSymbolicLink()); assert.isFalse(stats.isFile()); assert.equal(stats.mtime.getTime(), 2); }); - it('stats a symbolic link with bigint', function() { + it('stats a symbolic link with bigint', function () { const stats = fs.lstatSync('link', {bigint: true}); assert.isTrue(stats.isSymbolicLink()); assert.isFalse(stats.isFile()); assert.equal(typeof stats.mtimeMs, 'bigint'); }); - it('stats a regular file', function() { + it('stats a regular file', function () { const stats = fs.lstatSync('file.txt'); assert.isTrue(stats.isFile()); assert.isFalse(stats.isSymbolicLink()); assert.equal(stats.mtime.getTime(), 1); }); - it('stats a regular file with bigint', function() { + it('stats a regular file with bigint', function () { const stats = fs.lstatSync('file.txt', {bigint: true}); assert.isTrue(stats.isFile()); assert.isFalse(stats.isSymbolicLink()); assert.equal(typeof stats.mtimeMs, 'bigint'); }); - it('fails on file not exist', function() { - assert.throws(function() { + it('fails on file not exist', function () { + assert.throws(function () { fs.lstatSync('bogus'); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.mkdir.spec.js node-mock-fs-5.1.4/test/lib/fs.mkdir.spec.js --- node-mock-fs-5.1.2/test/lib/fs.mkdir.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.mkdir.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,28 +1,28 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; const testParentPerms = process.getuid && process.getgid; -describe('fs.mkdir(path, [mode], callback)', function() { - beforeEach(function() { +describe('fs.mkdir(path, [mode], callback)', function () { + beforeEach(function () { mock({ parent: { 'file.md': '', - child: {} + child: {}, }, 'file.txt': '', - unwriteable: mock.directory({mode: parseInt('0555', 8)}) + unwriteable: mock.directory({mode: parseInt('0555', 8)}), }); }); afterEach(mock.restore); - it('creates a new directory', function(done) { - fs.mkdir('parent/dir', function(err) { + it('creates a new directory', function (done) { + fs.mkdir('parent/dir', function (err) { if (err) { return done(err); } @@ -32,8 +32,8 @@ }); }); - it('supports Buffer input', function(done) { - fs.mkdir(Buffer.from('parent/dir'), function(err) { + it('supports Buffer input', function (done) { + fs.mkdir(Buffer.from('parent/dir'), function (err) { if (err) { return done(err); } @@ -43,16 +43,16 @@ }); }); - it('promise creates a new directory', function(done) { - fs.promises.mkdir('parent/dir').then(function() { + it('promise creates a new directory', function (done) { + fs.promises.mkdir('parent/dir').then(function () { const stats = fs.statSync('parent/dir'); assert.isTrue(stats.isDirectory()); done(); }, done); }); - it('creates a new directory recursively', function(done) { - fs.mkdir('parent/foo/bar/dir', {recursive: true}, function(err) { + it('creates a new directory recursively', function (done) { + fs.mkdir('parent/foo/bar/dir', {recursive: true}, function (err) { if (err) { return done(err); } @@ -66,20 +66,22 @@ }); }); - it('promise creates a new directory recursively', function(done) { - fs.promises.mkdir('parent/foo/bar/dir', {recursive: true}).then(function() { - let stats = fs.statSync('parent/foo/bar/dir'); - assert.isTrue(stats.isDirectory()); - stats = fs.statSync('parent/foo/bar'); - assert.isTrue(stats.isDirectory()); - stats = fs.statSync('parent/foo'); - assert.isTrue(stats.isDirectory()); - done(); - }, done); + it('promise creates a new directory recursively', function (done) { + fs.promises + .mkdir('parent/foo/bar/dir', {recursive: true}) + .then(function () { + let stats = fs.statSync('parent/foo/bar/dir'); + assert.isTrue(stats.isDirectory()); + stats = fs.statSync('parent/foo/bar'); + assert.isTrue(stats.isDirectory()); + stats = fs.statSync('parent/foo'); + assert.isTrue(stats.isDirectory()); + done(); + }, done); }); - it('accepts dir mode', function(done) { - fs.mkdir('parent/dir', parseInt('0755', 8), function(err) { + it('accepts dir mode', function (done) { + fs.mkdir('parent/dir', parseInt('0755', 8), function (err) { if (err) { return done(err); } @@ -90,8 +92,8 @@ }); }); - it('promise accepts dir mode', function(done) { - fs.promises.mkdir('parent/dir', parseInt('0755', 8)).then(function() { + it('promise accepts dir mode', function (done) { + fs.promises.mkdir('parent/dir', parseInt('0755', 8)).then(function () { const stats = fs.statSync('parent/dir'); assert.isTrue(stats.isDirectory()); assert.equal(stats.mode & parseInt('0777', 8), parseInt('0755', 8)); @@ -99,11 +101,11 @@ }, done); }); - it('accepts dir mode recursively', function(done) { + it('accepts dir mode recursively', function (done) { fs.mkdir( 'parent/foo/bar/dir', {recursive: true, mode: parseInt('0755', 8)}, - function(err) { + function (err) { if (err) { return done(err); } @@ -123,10 +125,10 @@ ); }); - it('promise accepts dir mode recursively', function(done) { + it('promise accepts dir mode recursively', function (done) { fs.promises .mkdir('parent/foo/bar/dir', {recursive: true, mode: parseInt('0755', 8)}) - .then(function() { + .then(function () { let stats = fs.statSync('parent/foo/bar/dir'); assert.isTrue(stats.isDirectory()); assert.equal(stats.mode & parseInt('0777', 8), parseInt('0755', 8)); @@ -142,20 +144,20 @@ }, done); }); - it('fails if parent does not exist', function(done) { - fs.mkdir('parent/bogus/dir', function(err) { + it('fails if parent does not exist', function (done) { + fs.mkdir('parent/bogus/dir', function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); }); }); - it('promise fails if parent does not exist', function(done) { + it('promise fails if parent does not exist', function (done) { fs.promises.mkdir('parent/bogus/dir').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); @@ -163,67 +165,67 @@ ); }); - it('fails if one parent is not a folder in recursive creation', function(done) { - fs.mkdir('file.txt/bogus/dir', {recursive: true}, function(err) { + it('fails if one parent is not a folder in recursive creation', function (done) { + fs.mkdir('file.txt/bogus/dir', {recursive: true}, function (err) { assert.instanceOf(err, Error); done(); }); }); - it('promise fails if one parent is not a folder in recursive creation', function(done) { + it('promise fails if one parent is not a folder in recursive creation', function (done) { fs.promises.mkdir('file.txt/bogus/dir', {recursive: true}).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); done(); } ); }); - it('fails if permission does not allow recursive creation', function(done) { + it('fails if permission does not allow recursive creation', function (done) { fs.mkdir( 'parent/foo/bar/dir', {recursive: true, mode: parseInt('0400', 8)}, - function(err) { + function (err) { assert.instanceOf(err, Error); done(); } ); }); - it('promise fails if permission does not allow recursive creation', function(done) { + it('promise fails if permission does not allow recursive creation', function (done) { fs.promises .mkdir('parent/foo/bar/dir', { recursive: true, - mode: parseInt('0400', 8) + mode: parseInt('0400', 8), }) .then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); done(); } ); }); - it('fails if directory already exists', function(done) { - fs.mkdir('parent', function(err) { + it('fails if directory already exists', function (done) { + fs.mkdir('parent', function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EEXIST'); done(); }); }); - it('promise fails if directory already exists', function(done) { + it('promise fails if directory already exists', function (done) { fs.promises.mkdir('parent').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EEXIST'); done(); @@ -231,20 +233,20 @@ ); }); - it('fails if file already exists', function(done) { - fs.mkdir('file.txt', function(err) { + it('fails if file already exists', function (done) { + fs.mkdir('file.txt', function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EEXIST'); done(); }); }); - it('promise fails if file already exists', function(done) { + it('promise fails if file already exists', function (done) { fs.promises.mkdir('file.txt').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EEXIST'); done(); @@ -252,20 +254,20 @@ ); }); - it('fails in recursive mode if file already exists', function(done) { - fs.mkdir('parent/file.md', {recursive: true}, function(err) { + it('fails in recursive mode if file already exists', function (done) { + fs.mkdir('parent/file.md', {recursive: true}, function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EEXIST'); done(); }); }); - it('promise fails in recursive mode if file already exists', function(done) { + it('promise fails in recursive mode if file already exists', function (done) { fs.promises.mkdir('parent/file.md', {recursive: true}).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EEXIST'); done(); @@ -273,32 +275,32 @@ ); }); - it('passes in recursive mode if directory already exists', function(done) { - fs.mkdir('parent/child', {recursive: true}, function(err) { + it('passes in recursive mode if directory already exists', function (done) { + fs.mkdir('parent/child', {recursive: true}, function (err) { assert.isNotOk(err, Error); done(); }); }); - it('promise passes in recursive mode if directory already exists', function(done) { + it('promise passes in recursive mode if directory already exists', function (done) { fs.promises.mkdir('parent/child', {recursive: true}).then(done, done); }); if (testParentPerms) { - it('fails if parent is not writeable', function(done) { - fs.mkdir('unwriteable/child', function(err) { + it('fails if parent is not writeable', function (done) { + fs.mkdir('unwriteable/child', function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise fails if parent is not writeable', function(done) { + it('promise fails if parent is not writeable', function (done) { fs.promises.mkdir('unwriteable/child').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -307,41 +309,41 @@ }); } - it('calls callback with a single argument on success', function(done) { - fs.mkdir('parent/arity', function(_) { + it('calls callback with a single argument on success', function (done) { + fs.mkdir('parent/arity', function (_) { assert.equal(arguments.length, 1); done(); }); }); - it('calls callback with a single argument on failure', function(done) { - fs.mkdir('parent', function(err) { + it('calls callback with a single argument on failure', function (done) { + fs.mkdir('parent', function (err) { assert.instanceOf(err, Error); done(); }); }); }); -describe('fs.mkdirSync(path, [mode])', function() { - beforeEach(function() { +describe('fs.mkdirSync(path, [mode])', function () { + beforeEach(function () { mock({ parent: { 'file.md': '', - child: {} + child: {}, }, 'file.txt': 'content', - unwriteable: mock.directory({mode: parseInt('0555', 8)}) + unwriteable: mock.directory({mode: parseInt('0555', 8)}), }); }); afterEach(mock.restore); - it('creates a new directory', function() { + it('creates a new directory', function () { fs.mkdirSync('parent/dir'); const stats = fs.statSync('parent/dir'); assert.isTrue(stats.isDirectory()); }); - it('creates a new directory recursively', function() { + it('creates a new directory recursively', function () { fs.mkdirSync('parent/foo/bar/dir', {recursive: true}); let stats = fs.statSync('parent/foo/bar/dir'); assert.isTrue(stats.isDirectory()); @@ -351,17 +353,17 @@ assert.isTrue(stats.isDirectory()); }); - it('accepts dir mode', function() { + it('accepts dir mode', function () { fs.mkdirSync('parent/dir', parseInt('0755', 8)); const stats = fs.statSync('parent/dir'); assert.isTrue(stats.isDirectory()); assert.equal(stats.mode & parseInt('0777', 8), parseInt('0755', 8)); }); - it('accepts dir mode recursively', function() { + it('accepts dir mode recursively', function () { fs.mkdirSync('parent/foo/bar/dir', { recursive: true, - mode: parseInt('0755', 8) + mode: parseInt('0755', 8), }); let stats = fs.statSync('parent/foo/bar/dir'); assert.isTrue(stats.isDirectory()); @@ -376,54 +378,54 @@ assert.equal(stats.mode & parseInt('0777', 8), parseInt('0755', 8)); }); - it('fails if parent does not exist', function() { - assert.throws(function() { + it('fails if parent does not exist', function () { + assert.throws(function () { fs.mkdirSync('parent/bogus/dir'); }); }); - it('fails if one parent is not a folder in recursive creation', function() { - assert.throws(function() { + it('fails if one parent is not a folder in recursive creation', function () { + assert.throws(function () { fs.mkdirSync('file.txt/bogus/dir', {recursive: true}); }); }); - it('fails if permission does not allow recursive creation', function() { - assert.throws(function() { + it('fails if permission does not allow recursive creation', function () { + assert.throws(function () { fs.mkdirSync('parent/foo/bar/dir', { recursive: true, - mode: parseInt('0400', 8) + mode: parseInt('0400', 8), }); }); }); - it('fails if directory already exists', function() { - assert.throws(function() { + it('fails if directory already exists', function () { + assert.throws(function () { fs.mkdirSync('parent'); }); }); - it('fails if file already exists', function() { - assert.throws(function() { + it('fails if file already exists', function () { + assert.throws(function () { fs.mkdirSync('file.txt'); }); }); - it('fails in recursive mode if file already exists', function() { - assert.throws(function() { + it('fails in recursive mode if file already exists', function () { + assert.throws(function () { fs.mkdirSync('parent/file.md', {recursive: true}); }); }); - it('passes in recursive mode if directory already exists', function() { - assert.doesNotThrow(function() { + it('passes in recursive mode if directory already exists', function () { + assert.doesNotThrow(function () { fs.mkdirSync('parent/child', {recursive: true}); }); }); if (testParentPerms) { - it('fails if parent is not writeable', function() { - assert.throws(function() { + it('fails if parent is not writeable', function () { + assert.throws(function () { fs.mkdirSync('unwriteable/child'); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.mkdtemp.spec.js node-mock-fs-5.1.4/test/lib/fs.mkdtemp.spec.js --- node-mock-fs-5.1.2/test/lib/fs.mkdtemp.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.mkdtemp.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,8 +1,8 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const path = require('path'); const assert = helper.assert; @@ -10,18 +10,18 @@ const testParentPerms = process.getuid && process.getgid; if (fs.mkdtemp) { - describe('fs.mkdtemp(prefix[, options], callback)', function() { - beforeEach(function() { + describe('fs.mkdtemp(prefix[, options], callback)', function () { + beforeEach(function () { mock({ parent: {}, file: 'contents', - unwriteable: mock.directory({mode: parseInt('0555', 8)}) + unwriteable: mock.directory({mode: parseInt('0555', 8)}), }); }); afterEach(mock.restore); - it('creates a new directory', function(done) { - fs.mkdtemp('parent/dir', function(err, dirPath) { + it('creates a new directory', function (done) { + fs.mkdtemp('parent/dir', function (err, dirPath) { if (err) { return done(err); } @@ -33,8 +33,8 @@ }); }); - it('promise creates a new directory', function(done) { - fs.promises.mkdtemp('parent/dir').then(function(dirPath) { + it('promise creates a new directory', function (done) { + fs.promises.mkdtemp('parent/dir').then(function (dirPath) { const parentPath = path.dirname(dirPath); assert.equal(parentPath, 'parent'); const stats = fs.statSync(dirPath); @@ -43,8 +43,8 @@ }, done); }); - it('accepts a "utf8" encoding argument', function(done) { - fs.mkdtemp('parent/dir', 'utf8', function(err, dirPath) { + it('accepts a "utf8" encoding argument', function (done) { + fs.mkdtemp('parent/dir', 'utf8', function (err, dirPath) { if (err) { return done(err); } @@ -57,8 +57,8 @@ }); }); - it('promise accepts a "utf8" encoding argument', function(done) { - fs.promises.mkdtemp('parent/dir', 'utf8').then(function(dirPath) { + it('promise accepts a "utf8" encoding argument', function (done) { + fs.promises.mkdtemp('parent/dir', 'utf8').then(function (dirPath) { assert.isString(dirPath); const parentPath = path.dirname(dirPath); assert.equal(parentPath, 'parent'); @@ -68,8 +68,8 @@ }, done); }); - it('accepts a "buffer" encoding argument', function(done) { - fs.mkdtemp('parent/dir', 'buffer', function(err, buffer) { + it('accepts a "buffer" encoding argument', function (done) { + fs.mkdtemp('parent/dir', 'buffer', function (err, buffer) { if (err) { return done(err); } @@ -83,8 +83,8 @@ }); }); - it('promise accepts a "buffer" encoding argument', function(done) { - fs.promises.mkdtemp('parent/dir', 'buffer').then(function(buffer) { + it('promise accepts a "buffer" encoding argument', function (done) { + fs.promises.mkdtemp('parent/dir', 'buffer').then(function (buffer) { assert.instanceOf(buffer, Buffer); const dirPath = buffer.toString(); const parentPath = path.dirname(dirPath); @@ -95,8 +95,8 @@ }, done); }); - it('accepts an options argument with "utf8" encoding', function(done) { - fs.mkdtemp('parent/dir', {encoding: 'utf8'}, function(err, dirPath) { + it('accepts an options argument with "utf8" encoding', function (done) { + fs.mkdtemp('parent/dir', {encoding: 'utf8'}, function (err, dirPath) { if (err) { return done(err); } @@ -109,10 +109,10 @@ }); }); - it('promise accepts an options argument with "utf8" encoding', function(done) { + it('promise accepts an options argument with "utf8" encoding', function (done) { fs.promises .mkdtemp('parent/dir', {encoding: 'utf8'}) - .then(function(dirPath) { + .then(function (dirPath) { assert.isString(dirPath); const parentPath = path.dirname(dirPath); assert.equal(parentPath, 'parent'); @@ -122,8 +122,8 @@ }, done); }); - it('accepts an options argument with "buffer" encoding', function(done) { - fs.mkdtemp('parent/dir', {encoding: 'buffer'}, function(err, buffer) { + it('accepts an options argument with "buffer" encoding', function (done) { + fs.mkdtemp('parent/dir', {encoding: 'buffer'}, function (err, buffer) { if (err) { return done(err); } @@ -137,10 +137,10 @@ }); }); - it('promise accepts an options argument with "buffer" encoding', function(done) { + it('promise accepts an options argument with "buffer" encoding', function (done) { fs.promises .mkdtemp('parent/dir', {encoding: 'buffer'}) - .then(function(buffer) { + .then(function (buffer) { assert.instanceOf(buffer, Buffer); const dirPath = buffer.toString(); const parentPath = path.dirname(dirPath); @@ -151,8 +151,8 @@ }, done); }); - it('fails if parent does not exist', function(done) { - fs.mkdtemp('unknown/child', function(err, dirPath) { + it('fails if parent does not exist', function (done) { + fs.mkdtemp('unknown/child', function (err, dirPath) { if (!err || dirPath) { done(new Error('Expected failure')); } else { @@ -164,12 +164,12 @@ }); }); - it('promise fails if parent does not exist', function(done) { + it('promise fails if parent does not exist', function (done) { fs.promises.mkdtemp('unknown/child').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); @@ -177,8 +177,8 @@ ); }); - it('fails if parent is a file', function(done) { - fs.mkdtemp('file/child', function(err, dirPath) { + it('fails if parent is a file', function (done) { + fs.mkdtemp('file/child', function (err, dirPath) { if (!err || dirPath) { done(new Error('Expected failure')); } else { @@ -190,12 +190,12 @@ }); }); - it('promise fails if parent is a file', function(done) { + it('promise fails if parent is a file', function (done) { fs.promises.mkdtemp('file/child').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOTDIR'); done(); @@ -204,8 +204,8 @@ }); if (testParentPerms) { - it('fails if parent is not writeable', function(done) { - fs.mkdtemp('unwriteable/child', function(err, dirPath) { + it('fails if parent is not writeable', function (done) { + fs.mkdtemp('unwriteable/child', function (err, dirPath) { if (!err || dirPath) { done(new Error('Expected failure')); } else { @@ -217,12 +217,12 @@ }); }); - it('promise fails if parent is not writeable', function(done) { + it('promise fails if parent is not writeable', function (done) { fs.promises.mkdtemp('unwriteable/child').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -234,17 +234,17 @@ } if (fs.mkdtempSync) { - describe('fs.mkdtempSync(prefix[, options])', function() { - beforeEach(function() { + describe('fs.mkdtempSync(prefix[, options])', function () { + beforeEach(function () { mock({ parent: {}, file: 'contents', - unwriteable: mock.directory({mode: parseInt('0555', 8)}) + unwriteable: mock.directory({mode: parseInt('0555', 8)}), }); }); afterEach(mock.restore); - it('creates a new directory', function() { + it('creates a new directory', function () { const dirPath = fs.mkdtempSync('parent/dir'); const parentPath = path.dirname(dirPath); assert.equal(parentPath, 'parent'); @@ -252,7 +252,7 @@ assert.isTrue(stats.isDirectory()); }); - it('accepts a "utf8" encoding argument', function() { + it('accepts a "utf8" encoding argument', function () { const dirPath = fs.mkdtempSync('parent/dir', 'utf8'); assert.isString(dirPath); const parentPath = path.dirname(dirPath); @@ -261,7 +261,7 @@ assert.isTrue(stats.isDirectory()); }); - it('accepts a "buffer" encoding argument', function() { + it('accepts a "buffer" encoding argument', function () { const buffer = fs.mkdtempSync('parent/dir', 'buffer'); assert.instanceOf(buffer, Buffer); const dirPath = buffer.toString(); @@ -271,7 +271,7 @@ assert.isTrue(stats.isDirectory()); }); - it('accepts an options argument with "utf8" encoding', function() { + it('accepts an options argument with "utf8" encoding', function () { const dirPath = fs.mkdtempSync('parent/dir', {encoding: 'utf8'}); assert.isString(dirPath); const parentPath = path.dirname(dirPath); @@ -280,7 +280,7 @@ assert.isTrue(stats.isDirectory()); }); - it('accepts an options argument with "buffer" encoding', function() { + it('accepts an options argument with "buffer" encoding', function () { const buffer = fs.mkdtempSync('parent/dir', {encoding: 'buffer'}); assert.instanceOf(buffer, Buffer); const dirPath = buffer.toString(); @@ -290,21 +290,21 @@ assert.isTrue(stats.isDirectory()); }); - it('fails if parent does not exist', function() { - assert.throws(function() { + it('fails if parent does not exist', function () { + assert.throws(function () { fs.mkdtempSync('unknown/child'); }); }); - it('fails if parent is a file', function() { - assert.throws(function() { + it('fails if parent is a file', function () { + assert.throws(function () { fs.mkdtempSync('file/child'); }); }); if (testParentPerms) { - it('fails if parent is not writeable', function() { - assert.throws(function() { + it('fails if parent is not writeable', function () { + assert.throws(function () { fs.mkdtempSync('unwriteable/child'); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.open-close.spec.js node-mock-fs-5.1.4/test/lib/fs.open-close.spec.js --- node-mock-fs-5.1.2/test/lib/fs.open-close.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.open-close.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,14 +1,14 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; const inVersion = helper.inVersion; -describe('fs.open(path, flags, [mode], callback)', function() { - beforeEach(function() { +describe('fs.open(path, flags, [mode], callback)', function () { + beforeEach(function () { mock({ 'path/to/file.txt': 'file content', nested: { @@ -16,16 +16,16 @@ dir: { 'one.txt': 'one content', 'two.txt': 'two content', - empty: {} - } - } - } + empty: {}, + }, + }, + }, }); }); afterEach(mock.restore); - it('opens an existing file for reading (r)', function(done) { - fs.open('nested/sub/dir/one.txt', 'r', function(err, fd) { + it('opens an existing file for reading (r)', function (done) { + fs.open('nested/sub/dir/one.txt', 'r', function (err, fd) { if (err) { return done(err); } @@ -34,8 +34,8 @@ }); }); - it('supports Buffer input', function(done) { - fs.open(Buffer.from('nested/sub/dir/one.txt'), 'r', function(err, fd) { + it('supports Buffer input', function (done) { + fs.open(Buffer.from('nested/sub/dir/one.txt'), 'r', function (err, fd) { if (err) { return done(err); } @@ -44,27 +44,27 @@ }); }); - it('promise opens an existing file for reading (r)', function(done) { - fs.promises.open('nested/sub/dir/one.txt', 'r').then(function(fd) { + it('promise opens an existing file for reading (r)', function (done) { + fs.promises.open('nested/sub/dir/one.txt', 'r').then(function (fd) { assert.isNumber(fd.fd); done(); }, done); }); - it('fails if file does not exist (r)', function(done) { - fs.open('bogus.txt', 'r', function(err, fd) { + it('fails if file does not exist (r)', function (done) { + fs.open('bogus.txt', 'r', function (err, fd) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); }); }); - it('promise fails if file does not exist (r)', function(done) { + it('promise fails if file does not exist (r)', function (done) { fs.promises.open('bogus.txt', 'r').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); @@ -72,8 +72,8 @@ ); }); - it('creates a new file for writing (w)', function(done) { - fs.open('path/to/new.txt', 'w', parseInt('0666', 8), function(err, fd) { + it('creates a new file for writing (w)', function (done) { + fs.open('path/to/new.txt', 'w', parseInt('0666', 8), function (err, fd) { if (err) { return done(err); } @@ -83,18 +83,18 @@ }); }); - it('promise creates a new file for writing (w)', function(done) { + it('promise creates a new file for writing (w)', function (done) { fs.promises .open('path/to/new.txt', 'w', parseInt('0666', 8)) - .then(function(fd) { + .then(function (fd) { assert.isNumber(fd.fd); assert.isTrue(fs.existsSync('path/to/new.txt')); done(); }, done); }); - it('opens an existing file for writing (w)', function(done) { - fs.open('path/to/file.txt', 'w', parseInt('0666', 8), function(err, fd) { + it('opens an existing file for writing (w)', function (done) { + fs.open('path/to/file.txt', 'w', parseInt('0666', 8), function (err, fd) { if (err) { return done(err); } @@ -103,29 +103,29 @@ }); }); - it('promise opens an existing file for writing (w)', function(done) { + it('promise opens an existing file for writing (w)', function (done) { fs.promises .open('path/to/file.txt', 'w', parseInt('0666', 8)) - .then(function(fd) { + .then(function (fd) { assert.isNumber(fd.fd); done(); }, done); }); - it('fails if file exists (wx)', function(done) { - fs.open('path/to/file.txt', 'wx', parseInt('0666', 8), function(err, fd) { + it('fails if file exists (wx)', function (done) { + fs.open('path/to/file.txt', 'wx', parseInt('0666', 8), function (err, fd) { assert.instanceOf(err, Error); assert.equal(err.code, 'EEXIST'); done(); }); }); - it('promise fails if file exists (wx)', function(done) { + it('promise fails if file exists (wx)', function (done) { fs.promises.open('path/to/file.txt', 'wx', parseInt('0666', 8)).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EEXIST'); done(); @@ -134,8 +134,8 @@ }); }); -describe('fs.openSync(path, flags, [mode])', function() { - beforeEach(function() { +describe('fs.openSync(path, flags, [mode])', function () { + beforeEach(function () { mock({ 'path/to/file.txt': 'file content', nested: { @@ -143,72 +143,72 @@ dir: { 'one.txt': 'one content', 'two.txt': 'two content', - empty: {} - } - } - } + empty: {}, + }, + }, + }, }); }); afterEach(mock.restore); - it('opens an existing file for reading (r)', function() { + it('opens an existing file for reading (r)', function () { const fd = fs.openSync('path/to/file.txt', 'r'); assert.isNumber(fd); }); - it('fails if file does not exist (r)', function() { - assert.throws(function() { + it('fails if file does not exist (r)', function () { + assert.throws(function () { fs.openSync('bogus.txt', 'r'); }); }); - it('creates a new file for writing (w)', function() { + it('creates a new file for writing (w)', function () { const fd = fs.openSync('nested/sub/new.txt', 'w', parseInt('0666', 8)); assert.isNumber(fd); assert.isTrue(fs.existsSync('nested/sub/new.txt')); }); - it('opens an existing file for writing (w)', function() { + it('opens an existing file for writing (w)', function () { const fd = fs.openSync('path/to/one.txt', 'w', parseInt('0666', 8)); assert.isNumber(fd); }); - it('fails if file exists (wx)', function() { - assert.throws(function() { + it('fails if file exists (wx)', function () { + assert.throws(function () { fs.openSync('path/to/file.txt', 'wx', parseInt('0666', 8)); }); }); }); -describe('fs.close(fd, callback)', function() { - beforeEach(function() { +describe('fs.close(fd, callback)', function () { + beforeEach(function () { mock({dir: {}}); }); afterEach(mock.restore); - it('closes a file descriptor', function(done) { + it('closes a file descriptor', function (done) { const fd = fs.openSync('dir/file.txt', 'w'); - fs.close(fd, function(err) { + fs.close(fd, function (err) { done(err); }); }); - it('promise closes a file descriptor', function(done) { + it('promise closes a file descriptor', function (done) { fs.promises .open('dir/file.txt', 'w') - .then(function(fd) { + .then(function (fd) { return fd.close(); }) .then(done, done); }); - it('fails for closed file descriptors', function(done) { + it('fails for closed file descriptors', function (done) { const fd = fs.openSync('dir/file.txt', 'w'); - fs.close(fd, function(err) { + fs.close(fd, function (err) { if (err) { return done(err); } - fs.close(fd, function(err) { + fs.close(fd, function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EBADF'); done(); @@ -216,45 +216,46 @@ }); }); - inVersion('<14.0.0').it('promise fails for closed file descriptors', function( - done - ) { - fs.promises - .open('dir/file.txt', 'w') - .then(function(fd) { - return fd.close().then(function() { - // in Nodejs v14+, closing on closed file descriptor is silently ignored. - return fd.close(); - }); - }) - .then( - function() { - done(new Error('should not succeed.')); - }, - function(err) { - assert.instanceOf(err, Error); - assert.equal(err.code, 'EBADF'); - done(); - } - ); - }); + inVersion('<14.0.0').it( + 'promise fails for closed file descriptors', + function (done) { + fs.promises + .open('dir/file.txt', 'w') + .then(function (fd) { + return fd.close().then(function () { + // in Nodejs v14+, closing on closed file descriptor is silently ignored. + return fd.close(); + }); + }) + .then( + function () { + done(new Error('should not succeed.')); + }, + function (err) { + assert.instanceOf(err, Error); + assert.equal(err.code, 'EBADF'); + done(); + } + ); + } + ); }); -describe('fs.closeSync(fd)', function() { - beforeEach(function() { +describe('fs.closeSync(fd)', function () { + beforeEach(function () { mock({dir: {}}); }); afterEach(mock.restore); - it('closes a file descriptor', function() { + it('closes a file descriptor', function () { const fd = fs.openSync('dir/file.txt', 'w'); fs.closeSync(fd); }); - it('fails for closed file descriptors', function() { + it('fails for closed file descriptors', function () { const fd = fs.openSync('dir/file.txt', 'w'); fs.closeSync(fd); - assert.throws(function() { + assert.throws(function () { fs.closeSync(fd); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.readdir.spec.js node-mock-fs-5.1.4/test/lib/fs.readdir.spec.js --- node-mock-fs-5.1.2/test/lib/fs.readdir.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.readdir.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,14 +1,14 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const path = require('path'); const assert = helper.assert; -describe('fs.readdir(path, callback)', function() { - beforeEach(function() { +describe('fs.readdir(path, callback)', function () { + beforeEach(function () { mock({ 'path/to/file.txt': 'file content', nested: { @@ -16,24 +16,24 @@ dir: { 'one.txt': 'one content', 'two.txt': 'two content', - empty: {} - } - } + empty: {}, + }, + }, }, denied: mock.directory({ mode: 0o000, items: [ { - 'one.txt': 'content' - } - ] - }) + 'one.txt': 'content', + }, + ], + }), }); }); afterEach(mock.restore); - it('lists directory contents', function(done) { - fs.readdir(path.join('path', 'to'), function(err, items) { + it('lists directory contents', function (done) { + fs.readdir(path.join('path', 'to'), function (err, items) { assert.isNull(err); assert.isArray(items); assert.deepEqual(items, ['file.txt']); @@ -41,8 +41,8 @@ }); }); - it('supports Buffer input', function(done) { - fs.readdir(Buffer.from(path.join('path', 'to')), function(err, items) { + it('supports Buffer input', function (done) { + fs.readdir(Buffer.from(path.join('path', 'to')), function (err, items) { assert.isNull(err); assert.isArray(items); assert.deepEqual(items, ['file.txt']); @@ -50,16 +50,16 @@ }); }); - it('promise lists directory contents', function(done) { - fs.promises.readdir(path.join('path', 'to')).then(function(items) { + it('promise lists directory contents', function (done) { + fs.promises.readdir(path.join('path', 'to')).then(function (items) { assert.isArray(items); assert.deepEqual(items, ['file.txt']); done(); }, done); }); - it('lists nested directory contents', function(done) { - fs.readdir(path.join('nested', 'sub', 'dir'), function(err, items) { + it('lists nested directory contents', function (done) { + fs.readdir(path.join('nested', 'sub', 'dir'), function (err, items) { assert.isNull(err); assert.isArray(items); assert.deepEqual(items, ['empty', 'one.txt', 'two.txt']); @@ -67,38 +67,38 @@ }); }); - it('promise lists nested directory contents', function(done) { + it('promise lists nested directory contents', function (done) { fs.promises .readdir(path.join('nested', 'sub', 'dir')) - .then(function(items) { + .then(function (items) { assert.isArray(items); assert.deepEqual(items, ['empty', 'one.txt', 'two.txt']); done(); }, done); }); - it('calls with an error for bogus path', function(done) { - fs.readdir('bogus', function(err, items) { + it('calls with an error for bogus path', function (done) { + fs.readdir('bogus', function (err, items) { assert.instanceOf(err, Error); assert.isUndefined(items); done(); }); }); - it('promise calls with an error for bogus path', function(done) { + it('promise calls with an error for bogus path', function (done) { fs.promises.readdir('bogus').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); done(); } ); }); - it('calls with an error for restricted path', function(done) { - fs.readdir('denied', function(err, items) { + it('calls with an error for restricted path', function (done) { + fs.readdir('denied', function (err, items) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); assert.isUndefined(items); @@ -106,12 +106,12 @@ }); }); - it('promise calls with an error for restricted path', function(done) { + it('promise calls with an error for restricted path', function (done) { fs.promises.readdir('denied').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -119,15 +119,15 @@ ); }); - it('should support "withFileTypes" option', function(done) { + it('should support "withFileTypes" option', function (done) { fs.readdir( path.join('nested', 'sub', 'dir'), {withFileTypes: true}, - function(err, items) { + function (err, items) { assert.isNull(err); assert.isArray(items); assert.deepEqual( - items.map(i => i.name), + items.map((i) => i.name), ['empty', 'one.txt', 'two.txt'] ); assert.ok(items[0].isDirectory()); @@ -138,13 +138,13 @@ ); }); - it('should support "withFileTypes" option', function(done) { + it('should support "withFileTypes" option', function (done) { fs.promises .readdir(path.join('nested', 'sub', 'dir'), {withFileTypes: true}) - .then(function(items) { + .then(function (items) { assert.isArray(items); assert.deepEqual( - items.map(i => i.name), + items.map((i) => i.name), ['empty', 'one.txt', 'two.txt'] ); assert.ok(items[0].isDirectory()); @@ -154,17 +154,17 @@ }, done); }); - it('should support "withFileTypes" option with "encoding" option', function(done) { + it('should support "withFileTypes" option with "encoding" option', function (done) { fs.readdir( path.join('nested', 'sub', 'dir'), {withFileTypes: true, encoding: 'buffer'}, - function(err, items) { + function (err, items) { assert.isNull(err); assert.isArray(items); - items.forEach(function(item) { + items.forEach(function (item) { assert.equal(Buffer.isBuffer(item.name), true); }); - const names = items.map(function(item) { + const names = items.map(function (item) { return item.name.toString(); }); assert.deepEqual(names, ['empty', 'one.txt', 'two.txt']); @@ -176,18 +176,18 @@ ); }); - it('should support "withFileTypes" option with "encoding" option', function(done) { + it('should support "withFileTypes" option with "encoding" option', function (done) { fs.promises .readdir(path.join('nested', 'sub', 'dir'), { withFileTypes: true, - encoding: 'buffer' + encoding: 'buffer', }) - .then(function(items) { + .then(function (items) { assert.isArray(items); - items.forEach(function(item) { + items.forEach(function (item) { assert.equal(Buffer.isBuffer(item.name), true); }); - const names = items.map(function(item) { + const names = items.map(function (item) { return item.name.toString(); }); assert.deepEqual(names, ['empty', 'one.txt', 'two.txt']); @@ -199,8 +199,8 @@ }); }); -describe('fs.readdirSync(path)', function() { - beforeEach(function() { +describe('fs.readdirSync(path)', function () { + beforeEach(function () { mock({ 'path/to/file.txt': 'file content', nested: { @@ -208,34 +208,34 @@ dir: { 'one.txt': 'one content', 'two.txt': 'two content', - empty: {} - } - } - } + empty: {}, + }, + }, + }, }); }); afterEach(mock.restore); - it('lists directory contents', function() { + it('lists directory contents', function () { const items = fs.readdirSync(path.join('path', 'to')); assert.isArray(items); assert.deepEqual(items, ['file.txt']); }); - it('lists nested directory contents', function() { + it('lists nested directory contents', function () { const items = fs.readdirSync(path.join('nested', 'sub', 'dir')); assert.isArray(items); assert.deepEqual(items, ['empty', 'one.txt', 'two.txt']); }); - it('throws for bogus path', function() { - assert.throws(function() { + it('throws for bogus path', function () { + assert.throws(function () { fs.readdirSync('bogus'); }); }); - it('throws when access refused', function() { - assert.throws(function() { + it('throws when access refused', function () { + assert.throws(function () { fs.readdirSync('denied'); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.readFile.spec.js node-mock-fs-5.1.4/test/lib/fs.readFile.spec.js --- node-mock-fs-5.1.2/test/lib/fs.readFile.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.readFile.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,24 +1,24 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; -describe('fs.readFile(filename, [options], callback)', function() { +describe('fs.readFile(filename, [options], callback)', function () { // this is provided by fs.open, fs.fstat, and fs.read // so more heavily tested elsewhere - beforeEach(function() { + beforeEach(function () { mock({ - 'path/to/file.txt': 'file content' + 'path/to/file.txt': 'file content', }); }); afterEach(mock.restore); - it('allows a file to be read asynchronously', function(done) { - fs.readFile('path/to/file.txt', function(err, data) { + it('allows a file to be read asynchronously', function (done) { + fs.readFile('path/to/file.txt', function (err, data) { if (err) { return done(err); } @@ -28,28 +28,28 @@ }); }); - it('promise allows a file to be read asynchronously', function(done) { - fs.promises.readFile('path/to/file.txt').then(function(data) { + it('promise allows a file to be read asynchronously', function (done) { + fs.promises.readFile('path/to/file.txt').then(function (data) { assert.isTrue(Buffer.isBuffer(data)); assert.equal(String(data), 'file content'); done(); }, done); }); - it('fails for directory', function(done) { - fs.readFile('path/to', function(err, data) { + it('fails for directory', function (done) { + fs.readFile('path/to', function (err, data) { assert.instanceOf(err, Error); assert.equal(err.code, 'EISDIR'); done(); }); }); - it('promise fails for directory', function(done) { + it('promise fails for directory', function (done) { fs.promises.readFile('path/to').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EISDIR'); done(); @@ -57,8 +57,8 @@ ); }); - it('fails for bad path', function(done) { - fs.readFile('path/to/bogus', function(err, data) { + it('fails for bad path', function (done) { + fs.readFile('path/to/bogus', function (err, data) { assert.instanceOf(err, Error); // windows has different errno for ENOENT assert.equal(err.code, 'ENOENT'); @@ -66,12 +66,12 @@ }); }); - it('promise fails for bad path', function(done) { + it('promise fails for bad path', function (done) { fs.promises.readFile('path/to/bogus').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); // windows has different errno for ENOENT assert.equal(err.code, 'ENOENT'); @@ -81,24 +81,24 @@ }); }); -describe('fs.readFileSync(filename, [options])', function() { +describe('fs.readFileSync(filename, [options])', function () { // this is provided by fs.openSync, fs.fstatSync, and fs.readSync // so more heavily tested elsewhere - beforeEach(function() { + beforeEach(function () { mock({ - 'path/to/file.txt': 'file content' + 'path/to/file.txt': 'file content', }); }); afterEach(mock.restore); - it('allows a file to be read synchronously', function() { + it('allows a file to be read synchronously', function () { const data = fs.readFileSync('path/to/file.txt'); assert.isTrue(Buffer.isBuffer(data)); assert.equal(String(data), 'file content'); }); - it('fails for directory', function() { + it('fails for directory', function () { try { fs.readFileSync('path/to'); assert.fail('should not succeed.'); @@ -108,8 +108,8 @@ } }); - it('fails for bad path', function() { - assert.throws(function() { + it('fails for bad path', function () { + assert.throws(function () { fs.readFileSync('path/to/bogus'); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.readlink.spec.js node-mock-fs-5.1.4/test/lib/fs.readlink.spec.js --- node-mock-fs-5.1.2/test/lib/fs.readlink.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.readlink.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,22 +1,22 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; -describe('fs.readlink(path, callback)', function() { - beforeEach(function() { +describe('fs.readlink(path, callback)', function () { + beforeEach(function () { mock({ 'file.txt': 'content', - link: mock.symlink({path: './file.txt'}) + link: mock.symlink({path: './file.txt'}), }); }); afterEach(mock.restore); - it('reads a symbolic link', function(done) { - fs.readlink('link', function(err, srcPath) { + it('reads a symbolic link', function (done) { + fs.readlink('link', function (err, srcPath) { if (err) { return done(err); } @@ -25,8 +25,8 @@ }); }); - it('supports Buffer input', function(done) { - fs.readlink(Buffer.from('link'), function(err, srcPath) { + it('supports Buffer input', function (done) { + fs.readlink(Buffer.from('link'), function (err, srcPath) { if (err) { return done(err); } @@ -35,26 +35,26 @@ }); }); - it('promise reads a symbolic link', function(done) { - fs.promises.readlink('link').then(function(srcPath) { + it('promise reads a symbolic link', function (done) { + fs.promises.readlink('link').then(function (srcPath) { assert.equal(srcPath, './file.txt'); done(); }, done); }); - it('fails for regular files', function(done) { - fs.readlink('file.txt', function(err, srcPath) { + it('fails for regular files', function (done) { + fs.readlink('file.txt', function (err, srcPath) { assert.instanceOf(err, Error); done(); }); }); - it('promise fails for regular files', function(done) { + it('promise fails for regular files', function (done) { fs.promises.readlink('file.txt').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); done(); } @@ -62,21 +62,21 @@ }); }); -describe('fs.readlinkSync(path)', function() { - beforeEach(function() { +describe('fs.readlinkSync(path)', function () { + beforeEach(function () { mock({ 'file.txt': 'content', - link: mock.symlink({path: './file.txt'}) + link: mock.symlink({path: './file.txt'}), }); }); afterEach(mock.restore); - it('reads a symbolic link', function() { + it('reads a symbolic link', function () { assert.equal(fs.readlinkSync('link'), './file.txt'); }); - it('fails for regular files', function() { - assert.throws(function() { + it('fails for regular files', function () { + assert.throws(function () { fs.readlinkSync('file.txt'); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.read.spec.js node-mock-fs-5.1.4/test/lib/fs.read.spec.js --- node-mock-fs-5.1.2/test/lib/fs.read.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.read.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,26 +1,26 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; -describe('fs.read(fd, buffer, offset, length, position, callback)', function() { - beforeEach(function() { +describe('fs.read(fd, buffer, offset, length, position, callback)', function () { + beforeEach(function () { mock({ - 'path/to/file.txt': 'file content' + 'path/to/file.txt': 'file content', }); }); afterEach(mock.restore); - it('allows file contents to be read', function(done) { - fs.open('path/to/file.txt', 'r', function(err, fd) { + it('allows file contents to be read', function (done) { + fs.open('path/to/file.txt', 'r', function (err, fd) { if (err) { return done(err); } const buffer = Buffer.alloc(12); - fs.read(fd, buffer, 0, 12, 0, function(err2, bytesRead, buf) { + fs.read(fd, buffer, 0, 12, 0, function (err2, bytesRead, buf) { if (err2) { return done(err2); } @@ -32,14 +32,14 @@ }); }); - it('promise allows file contents to be read', function(done) { + it('promise allows file contents to be read', function (done) { const buffer = Buffer.alloc(12); fs.promises .open('path/to/file.txt', 'r') - .then(function(fd) { + .then(function (fd) { return fd.read(buffer, 0, 12, 0); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesRead, 12); assert.equal(result.buffer, buffer); assert.equal(String(buffer), 'file content'); @@ -47,13 +47,13 @@ }, done); }); - it('allows file contents to be read w/ offset', function(done) { - fs.open('path/to/file.txt', 'r', function(err, fd) { + it('allows file contents to be read w/ offset', function (done) { + fs.open('path/to/file.txt', 'r', function (err, fd) { if (err) { return done(err); } const buffer = Buffer.alloc(12); - fs.read(fd, buffer, 5, 7, 0, function(err2, bytesRead, buf) { + fs.read(fd, buffer, 5, 7, 0, function (err2, bytesRead, buf) { if (err2) { return done(err2); } @@ -65,14 +65,14 @@ }); }); - it('promise allows file contents to be read w/ offset', function(done) { + it('promise allows file contents to be read w/ offset', function (done) { const buffer = Buffer.alloc(12); fs.promises .open('path/to/file.txt', 'r') - .then(function(fd) { + .then(function (fd) { return fd.read(buffer, 5, 7, 0); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesRead, 7); assert.equal(result.buffer, buffer); assert.equal(String(buffer.slice(5)), 'file co'); @@ -80,13 +80,13 @@ }, done); }); - it('allows file contents to be read w/ length', function(done) { - fs.open('path/to/file.txt', 'r', function(err, fd) { + it('allows file contents to be read w/ length', function (done) { + fs.open('path/to/file.txt', 'r', function (err, fd) { if (err) { return done(err); } const buffer = Buffer.alloc(12); - fs.read(fd, buffer, 0, 4, 0, function(err2, bytesRead, buf) { + fs.read(fd, buffer, 0, 4, 0, function (err2, bytesRead, buf) { if (err2) { return done(err2); } @@ -98,14 +98,14 @@ }); }); - it('promise allows file contents to be read w/ length', function(done) { + it('promise allows file contents to be read w/ length', function (done) { const buffer = Buffer.alloc(12); fs.promises .open('path/to/file.txt', 'r') - .then(function(fd) { + .then(function (fd) { return fd.read(buffer, 0, 4, 0); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesRead, 4); assert.equal(result.buffer, buffer); assert.equal(String(buffer.slice(0, 4)), 'file'); @@ -113,13 +113,13 @@ }, done); }); - it('allows file contents to be read w/ offset & length', function(done) { - fs.open('path/to/file.txt', 'r', function(err, fd) { + it('allows file contents to be read w/ offset & length', function (done) { + fs.open('path/to/file.txt', 'r', function (err, fd) { if (err) { return done(err); } const buffer = Buffer.alloc(12); - fs.read(fd, buffer, 2, 4, 0, function(err2, bytesRead, buf) { + fs.read(fd, buffer, 2, 4, 0, function (err2, bytesRead, buf) { if (err2) { return done(err2); } @@ -131,14 +131,14 @@ }); }); - it('promise allows file contents to be read w/ offset & length', function(done) { + it('promise allows file contents to be read w/ offset & length', function (done) { const buffer = Buffer.alloc(12); fs.promises .open('path/to/file.txt', 'r') - .then(function(fd) { + .then(function (fd) { return fd.read(buffer, 2, 4, 0); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesRead, 4); assert.equal(result.buffer, buffer); assert.equal(String(buffer.slice(2, 6)), 'file'); @@ -146,13 +146,13 @@ }, done); }); - it('allows file contents to be read w/ position', function(done) { - fs.open('path/to/file.txt', 'r', function(err, fd) { + it('allows file contents to be read w/ position', function (done) { + fs.open('path/to/file.txt', 'r', function (err, fd) { if (err) { return done(err); } const buffer = Buffer.alloc(7); - fs.read(fd, buffer, 0, 7, 5, function(err2, bytesRead, buf) { + fs.read(fd, buffer, 0, 7, 5, function (err2, bytesRead, buf) { if (err2) { return done(err2); } @@ -164,14 +164,14 @@ }); }); - it('promise allows file contents to be read w/ position', function(done) { + it('promise allows file contents to be read w/ position', function (done) { const buffer = Buffer.alloc(7); fs.promises .open('path/to/file.txt', 'r') - .then(function(fd) { + .then(function (fd) { return fd.read(buffer, 0, 7, 5); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesRead, 7); assert.equal(result.buffer, buffer); assert.equal(String(buffer), 'content'); @@ -179,13 +179,13 @@ }, done); }); - it('allows read w/ offset, length, & position', function(done) { - fs.open('path/to/file.txt', 'r', function(err, fd) { + it('allows read w/ offset, length, & position', function (done) { + fs.open('path/to/file.txt', 'r', function (err, fd) { if (err) { return done(err); } const buffer = Buffer.alloc(12); - fs.read(fd, buffer, 2, 7, 5, function(err2, bytesRead, buf) { + fs.read(fd, buffer, 2, 7, 5, function (err2, bytesRead, buf) { if (err2) { return done(err2); } @@ -197,14 +197,14 @@ }); }); - it('promise allows read w/ offset, length, & position', function(done) { + it('promise allows read w/ offset, length, & position', function (done) { const buffer = Buffer.alloc(12); fs.promises .open('path/to/file.txt', 'r') - .then(function(fd) { + .then(function (fd) { return fd.read(buffer, 2, 7, 5); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesRead, 7); assert.equal(result.buffer, buffer); assert.equal(String(buffer.slice(2, 9)), 'content'); @@ -212,10 +212,10 @@ }, done); }); - it('fails for closed file descriptor', function(done) { + it('fails for closed file descriptor', function (done) { const fd = fs.openSync('path/to/file.txt', 'r'); fs.closeSync(fd); - fs.read(fd, Buffer.alloc(12), 0, 12, 0, function(err, bytesRead, buf) { + fs.read(fd, Buffer.alloc(12), 0, 12, 0, function (err, bytesRead, buf) { assert.instanceOf(err, Error); assert.equal(err.code, 'EBADF'); assert.equal(0, bytesRead); @@ -223,19 +223,19 @@ }); }); - it('promise fails for closed file descriptor', function(done) { + it('promise fails for closed file descriptor', function (done) { fs.promises .open('path/to/file.txt', 'r') - .then(function(fd) { - return fd.close().then(function() { + .then(function (fd) { + return fd.close().then(function () { return fd.read(Buffer.alloc(12), 0, 12, 0); }); }) .then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EBADF'); done(); @@ -243,26 +243,26 @@ ); }); - it('fails if not open for reading', function(done) { + it('fails if not open for reading', function (done) { const fd = fs.openSync('path/to/file.txt', 'w'); - fs.read(fd, Buffer.alloc(12), 0, 12, 0, function(err, bytesRead, buf) { + fs.read(fd, Buffer.alloc(12), 0, 12, 0, function (err, bytesRead, buf) { assert.instanceOf(err, Error); assert.equal(0, bytesRead); done(); }); }); - it('promise fails if not open for reading', function(done) { + it('promise fails if not open for reading', function (done) { fs.promises .open('path/to/file.txt', 'w') - .then(function(fd) { + .then(function (fd) { return fd.read(Buffer.alloc(12), 0, 12, 0); }) .then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EBADF'); done(); @@ -271,15 +271,15 @@ }); }); -describe('fs.readSync(fd, buffer, offset, length, position)', function() { - beforeEach(function() { +describe('fs.readSync(fd, buffer, offset, length, position)', function () { + beforeEach(function () { mock({ - 'path/to/file.txt': 'file content' + 'path/to/file.txt': 'file content', }); }); afterEach(mock.restore); - it('allows a file to be read synchronously', function() { + it('allows a file to be read synchronously', function () { const fd = fs.openSync('path/to/file.txt', 'r'); const buffer = Buffer.alloc(12); const read = fs.readSync(fd, buffer, 0, 12, 0); @@ -287,7 +287,7 @@ assert.equal(String(buffer), 'file content'); }); - it('allows a file to be read in two parts', function() { + it('allows a file to be read in two parts', function () { const fd = fs.openSync('path/to/file.txt', 'r'); const first = Buffer.alloc(4); fs.readSync(fd, first, 0, 4, 0); @@ -298,7 +298,7 @@ assert.equal(String(second), 'content'); }); - it('treats null position as current position', function() { + it('treats null position as current position', function () { const fd = fs.openSync('path/to/file.txt', 'r'); const first = Buffer.alloc(4); fs.readSync(fd, first, 0, 4, null); diff -Nru node-mock-fs-5.1.2/test/lib/fs.realpath.spec.js node-mock-fs-5.1.4/test/lib/fs.realpath.spec.js --- node-mock-fs-5.1.2/test/lib/fs.realpath.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.realpath.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,24 +1,24 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); const path = require('path'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; const assertEqualPaths = helper.assertEqualPaths; -describe('fs.realpath(path, [cache], callback)', function() { - beforeEach(function() { +describe('fs.realpath(path, [cache], callback)', function () { + beforeEach(function () { mock({ 'dir/file.txt': 'content', - link: mock.symlink({path: './dir/file.txt'}) + link: mock.symlink({path: './dir/file.txt'}), }); }); afterEach(mock.restore); - it('resolves the real path for a symbolic link', function(done) { - fs.realpath('link', function(err, resolved) { + it('resolves the real path for a symbolic link', function (done) { + fs.realpath('link', function (err, resolved) { if (err) { return done(err); } @@ -27,15 +27,15 @@ }); }); - it('promise resolves the real path for a symbolic link', function(done) { - fs.promises.realpath('link').then(function(resolved) { + it('promise resolves the real path for a symbolic link', function (done) { + fs.promises.realpath('link').then(function (resolved) { assertEqualPaths(resolved, path.resolve('dir/file.txt')); done(); }, done); }); - it('resolves the real path regular file', function(done) { - fs.realpath('dir/file.txt', function(err, resolved) { + it('resolves the real path regular file', function (done) { + fs.realpath('dir/file.txt', function (err, resolved) { if (err) { return done(err); } @@ -44,27 +44,27 @@ }); }); - it('promise resolves the real path regular file', function(done) { - fs.promises.realpath('dir/file.txt').then(function(resolved) { + it('promise resolves the real path regular file', function (done) { + fs.promises.realpath('dir/file.txt').then(function (resolved) { assertEqualPaths(resolved, path.resolve('dir/file.txt')); done(); }, done); }); - it('fails on file not exist', function(done) { - fs.realpath('bogus', function(err, resolved) { + it('fails on file not exist', function (done) { + fs.realpath('bogus', function (err, resolved) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); }); }); - it('promise fails on file not exist', function(done) { + it('promise fails on file not exist', function (done) { fs.promises.realpath('bogus').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); @@ -74,17 +74,17 @@ }); if (fs.realpath.native) { - describe('fs.realpath.native(path, [cache], callback)', function() { - beforeEach(function() { + describe('fs.realpath.native(path, [cache], callback)', function () { + beforeEach(function () { mock({ 'dir/file.txt': 'content', - link: mock.symlink({path: './dir/file.txt'}) + link: mock.symlink({path: './dir/file.txt'}), }); }); afterEach(mock.restore); - it('resolves the real path for a symbolic link', function(done) { - fs.realpath.native('link', function(err, resolved) { + it('resolves the real path for a symbolic link', function (done) { + fs.realpath.native('link', function (err, resolved) { if (err) { return done(err); } @@ -93,8 +93,8 @@ }); }); - it('resolves the real path regular file', function(done) { - fs.realpath.native('dir/file.txt', function(err, resolved) { + it('resolves the real path regular file', function (done) { + fs.realpath.native('dir/file.txt', function (err, resolved) { if (err) { return done(err); } @@ -103,8 +103,8 @@ }); }); - it('fails on file not exist', function(done) { - fs.realpath.native('bogus', function(err, resolved) { + it('fails on file not exist', function (done) { + fs.realpath.native('bogus', function (err, resolved) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); @@ -113,54 +113,54 @@ }); } -describe('fs.realpathSync(path, [cache])', function() { - beforeEach(function() { +describe('fs.realpathSync(path, [cache])', function () { + beforeEach(function () { mock({ 'dir/file.txt': 'content', - link: mock.symlink({path: './dir/file.txt'}) + link: mock.symlink({path: './dir/file.txt'}), }); }); afterEach(mock.restore); - it('resolves the real path for a symbolic link', function() { + it('resolves the real path for a symbolic link', function () { const resolved = fs.realpathSync('link'); assertEqualPaths(resolved, path.resolve('dir/file.txt')); }); - it('resolves the real path regular file', function() { + it('resolves the real path regular file', function () { const resolved = fs.realpathSync('dir/file.txt'); assertEqualPaths(resolved, path.resolve('dir/file.txt')); }); - it('fails on file not exist', function() { - assert.throws(function() { + it('fails on file not exist', function () { + assert.throws(function () { fs.realpathSync('bogus'); }); }); }); if (fs.realpathSync.native) { - describe('fs.realpathSync.native(path, [cache])', function() { - beforeEach(function() { + describe('fs.realpathSync.native(path, [cache])', function () { + beforeEach(function () { mock({ 'dir/file.txt': 'content', - link: mock.symlink({path: './dir/file.txt'}) + link: mock.symlink({path: './dir/file.txt'}), }); }); afterEach(mock.restore); - it('resolves the real path for a symbolic link', function() { + it('resolves the real path for a symbolic link', function () { const resolved = fs.realpathSync.native('link'); assertEqualPaths(resolved, path.resolve('dir/file.txt')); }); - it('resolves the real path regular file', function() { + it('resolves the real path regular file', function () { const resolved = fs.realpathSync.native('dir/file.txt'); assertEqualPaths(resolved, path.resolve('dir/file.txt')); }); - it('fails on file not exist', function() { - assert.throws(function() { + it('fails on file not exist', function () { + assert.throws(function () { fs.realpathSync.native('bogus'); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.rename.spec.js node-mock-fs-5.1.4/test/lib/fs.rename.spec.js --- node-mock-fs-5.1.2/test/lib/fs.rename.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.rename.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,28 +1,28 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; -describe('fs.rename(oldPath, newPath, callback)', function() { - beforeEach(function() { +describe('fs.rename(oldPath, newPath, callback)', function () { + beforeEach(function () { mock({ 'path/to/a.bin': Buffer.from([1, 2, 3]), empty: {}, nested: { dir: mock.directory({ mtime: new Date(1), - items: {'file.txt': ''} - }) - } + items: {'file.txt': ''}, + }), + }, }); }); afterEach(mock.restore); - it('allows files to be renamed', function(done) { - fs.rename('path/to/a.bin', 'path/to/b.bin', function(err) { + it('allows files to be renamed', function (done) { + fs.rename('path/to/a.bin', 'path/to/b.bin', function (err) { assert.isTrue(!err); assert.isFalse(fs.existsSync('path/to/a.bin')); assert.isTrue(fs.existsSync('path/to/b.bin')); @@ -30,11 +30,11 @@ }); }); - it('supports Buffer input', function(done) { + it('supports Buffer input', function (done) { fs.rename( Buffer.from('path/to/a.bin'), Buffer.from('path/to/b.bin'), - function(err) { + function (err) { assert.isTrue(!err); assert.isFalse(fs.existsSync('path/to/a.bin')); assert.isTrue(fs.existsSync('path/to/b.bin')); @@ -43,17 +43,17 @@ ); }); - it('promise allows files to be renamed', function(done) { - fs.promises.rename('path/to/a.bin', 'path/to/b.bin').then(function() { + it('promise allows files to be renamed', function (done) { + fs.promises.rename('path/to/a.bin', 'path/to/b.bin').then(function () { assert.isFalse(fs.existsSync('path/to/a.bin')); assert.isTrue(fs.existsSync('path/to/b.bin')); done(); }, done); }); - it('updates mtime of parent directory', function(done) { + it('updates mtime of parent directory', function (done) { const oldTime = fs.statSync('nested/dir').mtime; - fs.rename('nested/dir/file.txt', 'nested/dir/renamed.txt', function(err) { + fs.rename('nested/dir/file.txt', 'nested/dir/renamed.txt', function (err) { assert.isTrue(!err); assert.isFalse(fs.existsSync('nested/dir/file.txt')); assert.isTrue(fs.existsSync('nested/dir/renamed.txt')); @@ -63,11 +63,11 @@ }); }); - it('promise updates mtime of parent directory', function(done) { + it('promise updates mtime of parent directory', function (done) { const oldTime = fs.statSync('nested/dir').mtime; fs.promises .rename('nested/dir/file.txt', 'nested/dir/renamed.txt') - .then(function() { + .then(function () { assert.isFalse(fs.existsSync('nested/dir/file.txt')); assert.isTrue(fs.existsSync('nested/dir/renamed.txt')); const newTime = fs.statSync('nested/dir').mtime; @@ -76,27 +76,27 @@ }, done); }); - it('calls callback with error if old path does not exist', function(done) { - fs.rename('bogus', 'empty', function(err) { + it('calls callback with error if old path does not exist', function (done) { + fs.rename('bogus', 'empty', function (err) { assert.instanceOf(err, Error); done(); }); }); - it('promise calls callback with error if old path does not exist', function(done) { + it('promise calls callback with error if old path does not exist', function (done) { fs.promises.rename('bogus', 'empty').then( - function() { + function () { done(new Error('Should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); done(); } ); }); - it('overwrites existing files', function(done) { - fs.rename('path/to/a.bin', 'nested/dir/file.txt', function(err) { + it('overwrites existing files', function (done) { + fs.rename('path/to/a.bin', 'nested/dir/file.txt', function (err) { assert.isTrue(!err); assert.isFalse(fs.existsSync('path/to/a.bin')); assert.isTrue(fs.existsSync('nested/dir/file.txt')); @@ -104,16 +104,18 @@ }); }); - it('promise overwrites existing files', function(done) { - fs.promises.rename('path/to/a.bin', 'nested/dir/file.txt').then(function() { - assert.isFalse(fs.existsSync('path/to/a.bin')); - assert.isTrue(fs.existsSync('nested/dir/file.txt')); - done(); - }, done); + it('promise overwrites existing files', function (done) { + fs.promises + .rename('path/to/a.bin', 'nested/dir/file.txt') + .then(function () { + assert.isFalse(fs.existsSync('path/to/a.bin')); + assert.isTrue(fs.existsSync('nested/dir/file.txt')); + done(); + }, done); }); - it('allows directories to be renamed', function(done) { - fs.rename('path/to', 'path/foo', function(err) { + it('allows directories to be renamed', function (done) { + fs.rename('path/to', 'path/foo', function (err) { assert.isTrue(!err); assert.isFalse(fs.existsSync('path/to')); assert.isTrue(fs.existsSync('path/foo')); @@ -122,8 +124,8 @@ }); }); - it('promise allows directories to be renamed', function(done) { - fs.promises.rename('path/to', 'path/foo').then(function() { + it('promise allows directories to be renamed', function (done) { + fs.promises.rename('path/to', 'path/foo').then(function () { assert.isFalse(fs.existsSync('path/to')); assert.isTrue(fs.existsSync('path/foo')); assert.deepEqual(fs.readdirSync('path/foo'), ['a.bin']); @@ -131,19 +133,19 @@ }, done); }); - it('calls callback with error if new directory not empty', function(done) { - fs.rename('path', 'nested', function(err) { + it('calls callback with error if new directory not empty', function (done) { + fs.rename('path', 'nested', function (err) { assert.instanceOf(err, Error); done(); }); }); - it('promise calls callback with error if new directory not empty', function(done) { + it('promise calls callback with error if new directory not empty', function (done) { fs.promises.rename('path', 'nested').then( - function() { + function () { done(new Error('Should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); done(); } @@ -151,68 +153,68 @@ }); }); -describe('fs.renameSync(oldPath, newPath)', function() { - beforeEach(function() { +describe('fs.renameSync(oldPath, newPath)', function () { + beforeEach(function () { mock({ 'path/to/a.bin': Buffer.from([1, 2, 3]), empty: {}, nested: { dir: { - 'file.txt': '' - } + 'file.txt': '', + }, }, - link: mock.symlink({path: './path/to/a.bin'}) + link: mock.symlink({path: './path/to/a.bin'}), }); }); afterEach(mock.restore); - it('allows files to be renamed', function() { + it('allows files to be renamed', function () { fs.renameSync('path/to/a.bin', 'path/to/b.bin'); assert.isFalse(fs.existsSync('path/to/a.bin')); assert.isTrue(fs.existsSync('path/to/b.bin')); }); - it('overwrites existing files', function() { + it('overwrites existing files', function () { fs.renameSync('path/to/a.bin', 'nested/dir/file.txt'); assert.isFalse(fs.existsSync('path/to/a.bin')); assert.isTrue(fs.existsSync('nested/dir/file.txt')); }); - it('allows directories to be renamed', function() { + it('allows directories to be renamed', function () { fs.renameSync('path/to', 'path/foo'); assert.isFalse(fs.existsSync('path/to')); assert.isTrue(fs.existsSync('path/foo')); assert.deepEqual(fs.readdirSync('path/foo'), ['a.bin']); }); - it('replaces existing directories (if empty)', function() { + it('replaces existing directories (if empty)', function () { fs.renameSync('path/to', 'empty'); assert.isFalse(fs.existsSync('path/to')); assert.isTrue(fs.existsSync('empty')); assert.deepEqual(fs.readdirSync('empty'), ['a.bin']); }); - it('renames symbolic links', function() { + it('renames symbolic links', function () { fs.renameSync('link', 'renamed'); assert.isTrue(fs.existsSync('renamed')); assert.isFalse(fs.existsSync('link')); assert.isTrue(fs.existsSync('path/to/a.bin')); }); - it('throws if old path does not exist', function() { - assert.throws(function() { + it('throws if old path does not exist', function () { + assert.throws(function () { fs.renameSync('bogus', 'empty'); }); }); - it('throws if new path basename is not directory', function() { - assert.throws(function() { + it('throws if new path basename is not directory', function () { + assert.throws(function () { fs.renameSync('path/to/a.bin', 'bogus/a.bin'); }); }); - it('throws if new dir is not empty dir', function() { - assert.throws(function() { + it('throws if new dir is not empty dir', function () { + assert.throws(function () { fs.renameSync('path/to', 'nested'); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.rmdir.spec.js node-mock-fs-5.1.4/test/lib/fs.rmdir.spec.js --- node-mock-fs-5.1.2/test/lib/fs.rmdir.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.rmdir.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,8 +1,8 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; const inVersion = helper.inVersion; @@ -14,31 +14,31 @@ 'path/to/empty': {}, 'path2/to': { empty: { - deep: {} + deep: {}, }, 'non-empty': { deep: { - 'b.file': 'lorem' + 'b.file': 'lorem', }, - 'a.file': '' - } + 'a.file': '', + }, }, 'file.txt': 'content', unwriteable: mock.directory({ mode: parseInt('0555', 8), - items: {child: {}} - }) + items: {child: {}}, + }), }); } -describe('fs.rmdir(path, callback)', function() { +describe('fs.rmdir(path, callback)', function () { beforeEach(setup); afterEach(mock.restore); - it('removes an empty directory', function(done) { + it('removes an empty directory', function (done) { assert.equal(fs.statSync('path/to').nlink, 3); - fs.rmdir('path/to/empty', function(err) { + fs.rmdir('path/to/empty', function (err) { if (err) { return done(err); } @@ -48,10 +48,10 @@ }); }); - it('supports Buffer input', function(done) { + it('supports Buffer input', function (done) { assert.equal(fs.statSync('path/to').nlink, 3); - fs.rmdir(Buffer.from('path/to/empty'), function(err) { + fs.rmdir(Buffer.from('path/to/empty'), function (err) { if (err) { return done(err); } @@ -61,30 +61,30 @@ }); }); - it('promise removes an empty directory', function(done) { + it('promise removes an empty directory', function (done) { assert.equal(fs.statSync('path/to').nlink, 3); - fs.promises.rmdir('path/to/empty').then(function() { + fs.promises.rmdir('path/to/empty').then(function () { assert.isFalse(fs.existsSync('path/to/empty')); assert.equal(fs.statSync('path/to').nlink, 2); done(); }, done); }); - it('fails if not empty', function(done) { - fs.rmdir('path/to', function(err) { + it('fails if not empty', function (done) { + fs.rmdir('path/to', function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOTEMPTY'); done(); }); }); - it('promise fails if not empty', function(done) { + it('promise fails if not empty', function (done) { fs.promises.rmdir('path/to').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOTEMPTY'); done(); @@ -92,20 +92,20 @@ ); }); - it('fails if file', function(done) { - fs.rmdir('file.txt', function(err) { + it('fails if file', function (done) { + fs.rmdir('file.txt', function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOTDIR'); done(); }); }); - it('promise fails if file', function(done) { + it('promise fails if file', function (done) { fs.promises.rmdir('file.txt').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOTDIR'); done(); @@ -113,11 +113,11 @@ ); }); - inVersion('>=12.10').run(function() { - it('recursively remove empty directory', function(done) { + inVersion('>=12.10').run(function () { + it('recursively remove empty directory', function (done) { assert.equal(fs.statSync('path2/to').nlink, 4); - fs.rmdir('path2/to/empty', {recursive: true}, function(err) { + fs.rmdir('path2/to/empty', {recursive: true}, function (err) { if (err) { return done(err); } @@ -127,20 +127,20 @@ }); }); - it('promise recursively remove empty directory', function(done) { + it('promise recursively remove empty directory', function (done) { assert.equal(fs.statSync('path2/to').nlink, 4); - fs.promises.rmdir('path2/to/empty', {recursive: true}).then(function() { + fs.promises.rmdir('path2/to/empty', {recursive: true}).then(function () { assert.isFalse(fs.existsSync('path2/to/empty')); assert.equal(fs.statSync('path2/to').nlink, 3); done(); }, done); }); - it('recursively remove non-empty directory', function(done) { + it('recursively remove non-empty directory', function (done) { assert.equal(fs.statSync('path2/to').nlink, 4); - fs.rmdir('path2/to/non-empty', {recursive: true}, function(err) { + fs.rmdir('path2/to/non-empty', {recursive: true}, function (err) { if (err) { return done(err); } @@ -150,12 +150,12 @@ }); }); - it('promise recursively remove non-empty directory', function(done) { + it('promise recursively remove non-empty directory', function (done) { assert.equal(fs.statSync('path2/to').nlink, 4); fs.promises .rmdir('path2/to/non-empty', {recursive: true}) - .then(function() { + .then(function () { assert.isFalse(fs.existsSync('path2/to/non-empty')); assert.equal(fs.statSync('path2/to').nlink, 3); done(); @@ -164,20 +164,20 @@ }); if (testParentPerms) { - it('fails if parent is not writeable', function(done) { - fs.rmdir('unwriteable/child', function(err) { + it('fails if parent is not writeable', function (done) { + fs.rmdir('unwriteable/child', function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); }); }); - it('promise fails if parent is not writeable', function(done) { + it('promise fails if parent is not writeable', function (done) { fs.promises.rmdir('unwriteable/child').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EACCES'); done(); @@ -187,42 +187,42 @@ } }); -describe('fs.rmdirSync(path)', function() { +describe('fs.rmdirSync(path)', function () { beforeEach(setup); afterEach(mock.restore); - it('removes an empty directory', function() { + it('removes an empty directory', function () { fs.rmdirSync('path/to/empty'); assert.isFalse(fs.existsSync('path/empty')); }); - it('fails if directory does not exist', function() { - assert.throws(function() { + it('fails if directory does not exist', function () { + assert.throws(function () { fs.rmdirSync('path/bogus'); }); }); - it('fails if not empty', function() { - assert.throws(function() { + it('fails if not empty', function () { + assert.throws(function () { fs.rmdirSync('path'); }); }); - it('fails if file', function() { - assert.throws(function() { + it('fails if file', function () { + assert.throws(function () { fs.rmdirSync('file.txt'); }); }); - inVersion('>=12.10').run(function() { - it('recursively remove empty directory', function() { + inVersion('>=12.10').run(function () { + it('recursively remove empty directory', function () { assert.equal(fs.statSync('path2/to').nlink, 4); fs.rmdirSync('path2/to/empty', {recursive: true}); assert.isFalse(fs.existsSync('path2/to/empty')); assert.equal(fs.statSync('path2/to').nlink, 3); }); - it('recursively remove non-empty directory', function() { + it('recursively remove non-empty directory', function () { assert.equal(fs.statSync('path2/to').nlink, 4); fs.rmdirSync('path2/to/non-empty', {recursive: true}); assert.isFalse(fs.existsSync('path2/to/non-empty')); @@ -231,8 +231,8 @@ }); if (testParentPerms) { - it('fails if parent is not writeable', function() { - assert.throws(function() { + it('fails if parent is not writeable', function () { + assert.throws(function () { fs.rmdirSync('unwriteable/child'); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.stat-fstat.spec.js node-mock-fs-5.1.4/test/lib/fs.stat-fstat.spec.js --- node-mock-fs-5.1.2/test/lib/fs.stat-fstat.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.stat-fstat.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,33 +1,33 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const semver = require('semver'); const assert = helper.assert; -describe('fs.stat(path, options, callback)', function() { - beforeEach(function() { +describe('fs.stat(path, options, callback)', function () { + beforeEach(function () { mock({ '/path/to/file.txt': mock.file({ ctime: new Date(1), mtime: new Date(2), atime: new Date(3), uid: 42, - gid: 43 + gid: 43, }), '/dir/symlink': mock.symlink({ path: '/path/to/file.txt', - mtime: new Date(2) + mtime: new Date(2), }), - '/empty': {} + '/empty': {}, }); }); afterEach(mock.restore); - xit('creates an instance of fs.Stats', function(done) { - fs.stat('/path/to/file.txt', function(err, stats) { + xit('creates an instance of fs.Stats', function (done) { + fs.stat('/path/to/file.txt', function (err, stats) { if (err) { return done(err); } @@ -36,15 +36,15 @@ }); }); - xit('promise creates an instance of fs.Stats', function(done) { - fs.promises.stat('/path/to/file.txt').then(function(stats) { + xit('promise creates an instance of fs.Stats', function (done) { + fs.promises.stat('/path/to/file.txt').then(function (stats) { assert.instanceOf(stats, fs.Stats); done(); }, done); }); - it('identifies files', function(done) { - fs.stat('/path/to/file.txt', function(err, stats) { + it('identifies files', function (done) { + fs.stat('/path/to/file.txt', function (err, stats) { if (err) { return done(err); } @@ -55,8 +55,8 @@ }); }); - it('identifies files with bigint', function(done) { - fs.stat('/path/to/file.txt', {bigint: true}, function(err, stats) { + it('identifies files with bigint', function (done) { + fs.stat('/path/to/file.txt', {bigint: true}, function (err, stats) { if (err) { return done(err); } @@ -67,8 +67,8 @@ }); }); - it('supports Buffer input', function(done) { - fs.stat(Buffer.from('/path/to/file.txt'), function(err, stats) { + it('supports Buffer input', function (done) { + fs.stat(Buffer.from('/path/to/file.txt'), function (err, stats) { if (err) { return done(err); } @@ -79,23 +79,24 @@ }); }); - it('supports Buffer input with bigint', function(done) { - fs.stat(Buffer.from('/path/to/file.txt'), {bigint: true}, function( - err, - stats - ) { - if (err) { - return done(err); + it('supports Buffer input with bigint', function (done) { + fs.stat( + Buffer.from('/path/to/file.txt'), + {bigint: true}, + function (err, stats) { + if (err) { + return done(err); + } + assert.isTrue(stats.isFile()); + assert.isFalse(stats.isDirectory()); + assert.equal(typeof stats.mtimeMs, 'bigint'); + done(); } - assert.isTrue(stats.isFile()); - assert.isFalse(stats.isDirectory()); - assert.equal(typeof stats.mtimeMs, 'bigint'); - done(); - }); + ); }); - it('promise identifies files', function(done) { - fs.promises.stat('/path/to/file.txt').then(function(stats) { + it('promise identifies files', function (done) { + fs.promises.stat('/path/to/file.txt').then(function (stats) { assert.isTrue(stats.isFile()); assert.isFalse(stats.isDirectory()); done(); @@ -103,17 +104,19 @@ }, done); }); - it('promise identifies files', function(done) { - fs.promises.stat('/path/to/file.txt', {bigint: true}).then(function(stats) { - assert.isTrue(stats.isFile()); - assert.isFalse(stats.isDirectory()); - done(); - assert.equal(typeof stats.mtimeMs, 'bigint'); - }, done); + it('promise identifies files', function (done) { + fs.promises + .stat('/path/to/file.txt', {bigint: true}) + .then(function (stats) { + assert.isTrue(stats.isFile()); + assert.isFalse(stats.isDirectory()); + done(); + assert.equal(typeof stats.mtimeMs, 'bigint'); + }, done); }); - it('identifies directories', function(done) { - fs.stat('/empty', function(err, stats) { + it('identifies directories', function (done) { + fs.stat('/empty', function (err, stats) { if (err) { return done(err); } @@ -124,8 +127,8 @@ }); }); - it('identifies directories with bigint', function(done) { - fs.stat('/empty', {bigint: true}, function(err, stats) { + it('identifies directories with bigint', function (done) { + fs.stat('/empty', {bigint: true}, function (err, stats) { if (err) { return done(err); } @@ -136,8 +139,8 @@ }); }); - it('promise identifies directories', function(done) { - fs.promises.stat('/empty').then(function(stats) { + it('promise identifies directories', function (done) { + fs.promises.stat('/empty').then(function (stats) { assert.isTrue(stats.isDirectory()); assert.isFalse(stats.isFile()); assert.equal(stats.size, 1); @@ -145,8 +148,8 @@ }, done); }); - it('promise identifies directories with bigint', function(done) { - fs.promises.stat('/empty', {bigint: true}).then(function(stats) { + it('promise identifies directories with bigint', function (done) { + fs.promises.stat('/empty', {bigint: true}).then(function (stats) { assert.isTrue(stats.isDirectory()); assert.isFalse(stats.isFile()); assert.equal(typeof stats.size, 'bigint'); @@ -154,8 +157,8 @@ }, done); }); - it('provides file stats', function(done) { - fs.stat('/path/to/file.txt', function(err, stats) { + it('provides file stats', function (done) { + fs.stat('/path/to/file.txt', function (err, stats) { if (err) { return done(err); } @@ -170,8 +173,8 @@ }); }); - it('provides file stats with bigint', function(done) { - fs.stat('/path/to/file.txt', {bigint: true}, function(err, stats) { + it('provides file stats with bigint', function (done) { + fs.stat('/path/to/file.txt', {bigint: true}, function (err, stats) { if (err) { return done(err); } @@ -186,8 +189,8 @@ }); }); - it('promise provides file stats', function(done) { - fs.promises.stat('/path/to/file.txt').then(function(stats) { + it('promise provides file stats', function (done) { + fs.promises.stat('/path/to/file.txt').then(function (stats) { assert.equal(stats.ctime.getTime(), 1); assert.equal(stats.mtime.getTime(), 2); assert.equal(stats.atime.getTime(), 3); @@ -199,17 +202,19 @@ }, done); }); - it('promise provides file stats with bigint', function(done) { - fs.promises.stat('/path/to/file.txt', {bigint: true}).then(function(stats) { - assert.equal(typeof stats.ctimeMs, 'bigint'); - assert.equal(typeof stats.mtimeMs, 'bigint'); - assert.equal(typeof stats.atimeMs, 'bigint'); - assert.equal(typeof stats.uid, 'bigint'); - assert.equal(typeof stats.gid, 'bigint'); - assert.equal(typeof stats.nlink, 'bigint'); - assert.equal(typeof stats.rdev, 'bigint'); - done(); - }, done); + it('promise provides file stats with bigint', function (done) { + fs.promises + .stat('/path/to/file.txt', {bigint: true}) + .then(function (stats) { + assert.equal(typeof stats.ctimeMs, 'bigint'); + assert.equal(typeof stats.mtimeMs, 'bigint'); + assert.equal(typeof stats.atimeMs, 'bigint'); + assert.equal(typeof stats.uid, 'bigint'); + assert.equal(typeof stats.gid, 'bigint'); + assert.equal(typeof stats.nlink, 'bigint'); + assert.equal(typeof stats.rdev, 'bigint'); + done(); + }, done); }); if ( @@ -218,8 +223,8 @@ ) { // The fix for https://github.com/nodejs/node/issues/25913 // is not shipped in v10. But it's shipped in v12. - it('includes blocks and blksize in stats', function(done) { - fs.stat('/path/to/file.txt', function(err, stats) { + it('includes blocks and blksize in stats', function (done) { + fs.stat('/path/to/file.txt', function (err, stats) { if (err) { return done(err); } @@ -229,8 +234,8 @@ }); }); - it('promise includes blocks and blksize in stats', function(done) { - fs.promises.stat('/path/to/file.txt').then(function(stats) { + it('promise includes blocks and blksize in stats', function (done) { + fs.promises.stat('/path/to/file.txt').then(function (stats) { assert.isNumber(stats.blocks); assert.isNumber(stats.blksize); done(); @@ -238,8 +243,8 @@ }); } - it('provides directory stats', function(done) { - fs.stat('/path', function(err, stats) { + it('provides directory stats', function (done) { + fs.stat('/path', function (err, stats) { if (err) { return done(err); } @@ -262,8 +267,8 @@ }); }); - it('provides directory stats with bigint', function(done) { - fs.stat('/path', {bigint: true}, function(err, stats) { + it('provides directory stats with bigint', function (done) { + fs.stat('/path', {bigint: true}, function (err, stats) { if (err) { return done(err); } @@ -286,8 +291,8 @@ }); }); - it('promise provides directory stats', function(done) { - fs.promises.stat('/path').then(function(stats) { + it('promise provides directory stats', function (done) { + fs.promises.stat('/path').then(function (stats) { assert.instanceOf(stats.ctime, Date); assert.instanceOf(stats.mtime, Date); assert.instanceOf(stats.atime, Date); @@ -307,8 +312,8 @@ }, done); }); - it('promise provides directory stats with bigint', function(done) { - fs.promises.stat('/path', {bigint: true}).then(function(stats) { + it('promise provides directory stats with bigint', function (done) { + fs.promises.stat('/path', {bigint: true}).then(function (stats) { assert.instanceOf(stats.ctime, Date); assert.instanceOf(stats.mtime, Date); assert.instanceOf(stats.atime, Date); @@ -334,8 +339,8 @@ ) { // The fix for https://github.com/nodejs/node/issues/25913 // is not shipped in v10. But it's shipped in v12. - it('includes blocks and blksize in directory stats', function(done) { - fs.stat('/path', function(err, stats) { + it('includes blocks and blksize in directory stats', function (done) { + fs.stat('/path', function (err, stats) { if (err) { return done(err); } @@ -345,8 +350,8 @@ }); }); - it('promise includes blocks and blksize in directory stats', function(done) { - fs.promises.stat('/path').then(function(stats) { + it('promise includes blocks and blksize in directory stats', function (done) { + fs.promises.stat('/path').then(function (stats) { assert.isNumber(stats.blocks); assert.isNumber(stats.blksize); done(); @@ -355,18 +360,18 @@ } }); -describe('fs.fstat(fd, options, callback)', function() { - beforeEach(function() { +describe('fs.fstat(fd, options, callback)', function () { + beforeEach(function () { mock({ 'path/to/file.txt': 'file content', - empty: {} + empty: {}, }); }); afterEach(mock.restore); - it('accepts a file descriptor for a file (r)', function(done) { + it('accepts a file descriptor for a file (r)', function (done) { const fd = fs.openSync('path/to/file.txt', 'r'); - fs.fstat(fd, function(err, stats) { + fs.fstat(fd, function (err, stats) { if (err) { return done(err); } @@ -376,9 +381,9 @@ }); }); - it('accepts a file descriptor for a file (r) with bigint', function(done) { + it('accepts a file descriptor for a file (r) with bigint', function (done) { const fd = fs.openSync('path/to/file.txt', 'r'); - fs.fstat(fd, {bigint: true}, function(err, stats) { + fs.fstat(fd, {bigint: true}, function (err, stats) { if (err) { return done(err); } @@ -388,35 +393,35 @@ }); }); - it('promise accepts a file descriptor for a file (r)', function(done) { + it('promise accepts a file descriptor for a file (r)', function (done) { fs.promises .open('path/to/file.txt', 'r') - .then(function(fd) { + .then(function (fd) { return fd.stat(); }) - .then(function(stats) { + .then(function (stats) { assert.isTrue(stats.isFile()); assert.equal(stats.size, 12); done(); }, done); }); - it('promise accepts a file descriptor for a file (r) with bigint', function(done) { + it('promise accepts a file descriptor for a file (r) with bigint', function (done) { fs.promises .open('path/to/file.txt', 'r') - .then(function(fd) { + .then(function (fd) { return fd.stat({bigint: true}); }) - .then(function(stats) { + .then(function (stats) { assert.isTrue(stats.isFile()); assert.equal(typeof stats.size, 'bigint'); done(); }, done); }); - it('accepts a file descriptor for a directory (r)', function(done) { + it('accepts a file descriptor for a directory (r)', function (done) { const fd = fs.openSync('path/to', 'r'); - fs.fstat(fd, function(err, stats) { + fs.fstat(fd, function (err, stats) { if (err) { return done(err); } @@ -426,9 +431,9 @@ }); }); - it('accepts a file descriptor for a directory (r) with bigint', function(done) { + it('accepts a file descriptor for a directory (r) with bigint', function (done) { const fd = fs.openSync('path/to', 'r'); - fs.fstat(fd, {bigint: true}, function(err, stats) { + fs.fstat(fd, {bigint: true}, function (err, stats) { if (err) { return done(err); } @@ -438,55 +443,55 @@ }); }); - it('promise accepts a file descriptor for a directory (r)', function(done) { + it('promise accepts a file descriptor for a directory (r)', function (done) { fs.promises .open('path/to', 'r') - .then(function(fd) { + .then(function (fd) { return fd.stat(); }) - .then(function(stats) { + .then(function (stats) { assert.isTrue(stats.isDirectory()); assert.equal(stats.size, 1); done(); }, done); }); - it('promise accepts a file descriptor for a directory (r) with bigint', function(done) { + it('promise accepts a file descriptor for a directory (r) with bigint', function (done) { fs.promises .open('path/to', 'r') - .then(function(fd) { + .then(function (fd) { return fd.stat({bigint: true}); }) - .then(function(stats) { + .then(function (stats) { assert.isTrue(stats.isDirectory()); assert.equal(typeof stats.size, 'bigint'); done(); }, done); }); - it('fails for bad file descriptor', function(done) { + it('fails for bad file descriptor', function (done) { const fd = fs.openSync('path/to/file.txt', 'r'); fs.closeSync(fd); - fs.fstat(fd, function(err, stats) { + fs.fstat(fd, function (err, stats) { assert.instanceOf(err, Error); assert.equal(err.code, 'EBADF'); done(); }); }); - it('promise fails for bad file descriptor', function(done) { + it('promise fails for bad file descriptor', function (done) { fs.promises .open('path/to/file.txt', 'r') - .then(function(fd) { - return fd.close().then(function() { + .then(function (fd) { + return fd.close().then(function () { return fd.stat({bigint: true}); }); }) .then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EBADF'); done(); @@ -495,47 +500,47 @@ }); }); -describe('fs.fstatSync(fd, options)', function() { - beforeEach(function() { +describe('fs.fstatSync(fd, options)', function () { + beforeEach(function () { mock({ 'path/to/file.txt': 'file content', - empty: {} + empty: {}, }); }); afterEach(mock.restore); - it('accepts a file descriptor for a file (r)', function() { + it('accepts a file descriptor for a file (r)', function () { const fd = fs.openSync('path/to/file.txt', 'r'); const stats = fs.fstatSync(fd); assert.isTrue(stats.isFile()); assert.equal(stats.size, 12); }); - it('accepts a file descriptor for a file (r) with bigint', function() { + it('accepts a file descriptor for a file (r) with bigint', function () { const fd = fs.openSync('path/to/file.txt', 'r'); const stats = fs.fstatSync(fd, {bigint: true}); assert.isTrue(stats.isFile()); assert.equal(typeof stats.size, 'bigint'); }); - it('accepts a file descriptor for a directory (r)', function() { + it('accepts a file descriptor for a directory (r)', function () { const fd = fs.openSync('path/to', 'r'); const stats = fs.fstatSync(fd); assert.isTrue(stats.isDirectory()); assert.equal(stats.size, 1); }); - it('accepts a file descriptor for a directory (r) with bigint', function() { + it('accepts a file descriptor for a directory (r) with bigint', function () { const fd = fs.openSync('path/to', 'r'); const stats = fs.fstatSync(fd, {bigint: true}); assert.isTrue(stats.isDirectory()); assert.equal(typeof stats.size, 'bigint'); }); - it('fails for bad file descriptor', function() { + it('fails for bad file descriptor', function () { const fd = fs.openSync('path/to/file.txt', 'r'); fs.closeSync(fd); - assert.throws(function() { + assert.throws(function () { fs.fstatSync(fd); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.unlink.spec.js node-mock-fs-5.1.4/test/lib/fs.unlink.spec.js --- node-mock-fs-5.1.2/test/lib/fs.unlink.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.unlink.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,26 +1,26 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; -describe('fs.unlink(path, callback)', function() { - beforeEach(function() { +describe('fs.unlink(path, callback)', function () { + beforeEach(function () { mock({ dir: {}, dir2: mock.directory({ mtime: new Date(1), - items: {file: 'content here'} + items: {file: 'content here'}, }), - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('deletes a file', function(done) { - fs.unlink('file.txt', function(err) { + it('deletes a file', function (done) { + fs.unlink('file.txt', function (err) { if (err) { return done(err); } @@ -29,8 +29,8 @@ }); }); - it('supports Buffer input', function(done) { - fs.unlink(Buffer.from('file.txt'), function(err) { + it('supports Buffer input', function (done) { + fs.unlink(Buffer.from('file.txt'), function (err) { if (err) { return done(err); } @@ -39,16 +39,16 @@ }); }); - it('promise deletes a file', function(done) { - fs.promises.unlink('file.txt').then(function() { + it('promise deletes a file', function (done) { + fs.promises.unlink('file.txt').then(function () { assert.isFalse(fs.existsSync('file.txt')); done(); }, done); }); - it('updates mtime of parent', function(done) { + it('updates mtime of parent', function (done) { const oldTime = fs.statSync('dir2').mtime; - fs.unlink('dir2/file', function(err) { + fs.unlink('dir2/file', function (err) { if (err) { return done(err); } @@ -59,9 +59,9 @@ }); }); - it('updates mtime of parent', function(done) { + it('updates mtime of parent', function (done) { const oldTime = fs.statSync('dir2').mtime; - fs.promises.unlink('dir2/file').then(function() { + fs.promises.unlink('dir2/file').then(function () { assert.isFalse(fs.existsSync('dir2/file')); const newTime = fs.statSync('dir2').mtime; assert.isTrue(newTime > oldTime); @@ -69,8 +69,8 @@ }, done); }); - it('fails for a directory', function(done) { - fs.unlink('dir', function(err) { + it('fails for a directory', function (done) { + fs.unlink('dir', function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EPERM'); assert.isTrue(fs.existsSync('dir')); @@ -78,12 +78,12 @@ }); }); - it('promise fails for a directory', function(done) { + it('promise fails for a directory', function (done) { fs.promises.unlink('dir').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EPERM'); assert.isTrue(fs.existsSync('dir')); @@ -92,9 +92,9 @@ ); }); - it('respects previously opened file descriptors', function(done) { + it('respects previously opened file descriptors', function (done) { const fd = fs.openSync('file.txt', 'r'); - fs.unlink('file.txt', function(err) { + fs.unlink('file.txt', function (err) { if (err) { return done(err); } @@ -108,9 +108,9 @@ }); }); - it('promise respects previously opened file descriptors', function(done) { + it('promise respects previously opened file descriptors', function (done) { const fd = fs.openSync('file.txt', 'r'); - fs.promises.unlink('file.txt').then(function() { + fs.promises.unlink('file.txt').then(function () { assert.isFalse(fs.existsSync('file.txt')); // but we can still use fd to read const buffer = Buffer.alloc(7); @@ -122,20 +122,20 @@ }); }); -describe('fs.unlinkSync(path)', function() { - beforeEach(function() { +describe('fs.unlinkSync(path)', function () { + beforeEach(function () { mock({ - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('deletes a file', function() { + it('deletes a file', function () { fs.unlinkSync('file.txt'); assert.isFalse(fs.existsSync('file.txt')); }); - it('respects previously opened file descriptors', function() { + it('respects previously opened file descriptors', function () { const fd = fs.openSync('file.txt', 'r'); fs.unlinkSync('file.txt'); assert.isFalse(fs.existsSync('file.txt')); diff -Nru node-mock-fs-5.1.2/test/lib/fs.utimes-futimes.spec.js node-mock-fs-5.1.4/test/lib/fs.utimes-futimes.spec.js --- node-mock-fs-5.1.2/test/lib/fs.utimes-futimes.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.utimes-futimes.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,22 +1,22 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; -describe('fs.utimes(path, atime, mtime, callback)', function() { - beforeEach(function() { +describe('fs.utimes(path, atime, mtime, callback)', function () { + beforeEach(function () { mock({ dir: {}, - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('updates timestamps for a file', function(done) { - fs.utimes('file.txt', new Date(100), new Date(200), function(err) { + it('updates timestamps for a file', function (done) { + fs.utimes('file.txt', new Date(100), new Date(200), function (err) { if (err) { return done(err); } @@ -27,24 +27,27 @@ }); }); - it('supports Buffer input', function(done) { - fs.utimes(Buffer.from('file.txt'), new Date(100), new Date(200), function( - err - ) { - if (err) { - return done(err); + it('supports Buffer input', function (done) { + fs.utimes( + Buffer.from('file.txt'), + new Date(100), + new Date(200), + function (err) { + if (err) { + return done(err); + } + const stats = fs.statSync('file.txt'); + assert.equal(stats.atime.getTime(), 100); + assert.equal(stats.mtime.getTime(), 200); + done(); } - const stats = fs.statSync('file.txt'); - assert.equal(stats.atime.getTime(), 100); - assert.equal(stats.mtime.getTime(), 200); - done(); - }); + ); }); - it('promise updates timestamps for a file', function(done) { + it('promise updates timestamps for a file', function (done) { fs.promises .utimes('file.txt', new Date(100), new Date(200)) - .then(function() { + .then(function () { const stats = fs.statSync('file.txt'); assert.equal(stats.atime.getTime(), 100); assert.equal(stats.mtime.getTime(), 200); @@ -52,8 +55,8 @@ }, done); }); - it('updates timestamps for a directory', function(done) { - fs.utimes('dir', new Date(300), new Date(400), function(err) { + it('updates timestamps for a directory', function (done) { + fs.utimes('dir', new Date(300), new Date(400), function (err) { if (err) { return done(err); } @@ -64,8 +67,8 @@ }); }); - it('promise updates timestamps for a directory', function(done) { - fs.promises.utimes('dir', new Date(300), new Date(400)).then(function() { + it('promise updates timestamps for a directory', function (done) { + fs.promises.utimes('dir', new Date(300), new Date(400)).then(function () { const stats = fs.statSync('dir'); assert.equal(stats.atime.getTime(), 300); assert.equal(stats.mtime.getTime(), 400); @@ -73,20 +76,20 @@ }, done); }); - it('fails for a bogus path', function(done) { - fs.utimes('bogus.txt', new Date(100), new Date(200), function(err) { + it('fails for a bogus path', function (done) { + fs.utimes('bogus.txt', new Date(100), new Date(200), function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); }); }); - it('promise fails for a bogus path', function(done) { + it('promise fails for a bogus path', function (done) { fs.promises.utimes('bogus.txt', new Date(100), new Date(200)).then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); @@ -95,15 +98,15 @@ }); }); -describe('fs.utimesSync(path, atime, mtime)', function() { - beforeEach(function() { +describe('fs.utimesSync(path, atime, mtime)', function () { + beforeEach(function () { mock({ - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('updates timestamps for a file', function() { + it('updates timestamps for a file', function () { fs.utimesSync('file.txt', new Date(100), new Date(200)); const stats = fs.statSync('file.txt'); assert.equal(stats.atime.getTime(), 100); @@ -111,18 +114,18 @@ }); }); -describe('fs.futimes(fd, atime, mtime, callback)', function() { - beforeEach(function() { +describe('fs.futimes(fd, atime, mtime, callback)', function () { + beforeEach(function () { mock({ dir: {}, - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('updates timestamps for a file', function(done) { + it('updates timestamps for a file', function (done) { const fd = fs.openSync('file.txt', 'r'); - fs.futimes(fd, new Date(100), new Date(200), function(err) { + fs.futimes(fd, new Date(100), new Date(200), function (err) { if (err) { return done(err); } @@ -133,13 +136,13 @@ }); }); - it('promise updates timestamps for a file', function(done) { + it('promise updates timestamps for a file', function (done) { fs.promises .open('file.txt', 'r') - .then(function(fd) { + .then(function (fd) { return fd.utimes(new Date(100), new Date(200)); }) - .then(function() { + .then(function () { const stats = fs.statSync('file.txt'); assert.equal(stats.atime.getTime(), 100); assert.equal(stats.mtime.getTime(), 200); @@ -147,9 +150,9 @@ }, done); }); - it('updates timestamps for a directory', function(done) { + it('updates timestamps for a directory', function (done) { const fd = fs.openSync('dir', 'r'); - fs.futimes(fd, new Date(300), new Date(400), function(err) { + fs.futimes(fd, new Date(300), new Date(400), function (err) { if (err) { return done(err); } @@ -160,13 +163,13 @@ }); }); - it('promise updates timestamps for a directory', function(done) { + it('promise updates timestamps for a directory', function (done) { fs.promises .open('dir', 'r') - .then(function(fd) { + .then(function (fd) { return fd.utimes(new Date(300), new Date(400)); }) - .then(function() { + .then(function () { const stats = fs.statSync('dir'); assert.equal(stats.atime.getTime(), 300); assert.equal(stats.mtime.getTime(), 400); @@ -175,15 +178,15 @@ }); }); -describe('fs.futimesSync(path, atime, mtime)', function() { - beforeEach(function() { +describe('fs.futimesSync(path, atime, mtime)', function () { + beforeEach(function () { mock({ - 'file.txt': 'content' + 'file.txt': 'content', }); }); afterEach(mock.restore); - it('updates timestamps for a file', function() { + it('updates timestamps for a file', function () { const fd = fs.openSync('file.txt', 'r'); fs.futimesSync(fd, new Date(100), new Date(200)); const stats = fs.statSync('file.txt'); diff -Nru node-mock-fs-5.1.2/test/lib/fs.writeFile.spec.js node-mock-fs-5.1.4/test/lib/fs.writeFile.spec.js --- node-mock-fs-5.1.2/test/lib/fs.writeFile.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.writeFile.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,23 +1,23 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; -describe('fs.writeFile(filename, data, [options], callback)', function() { - beforeEach(function() { +describe('fs.writeFile(filename, data, [options], callback)', function () { + beforeEach(function () { mock({ dir: mock.directory({ - mtime: new Date(1) - }) + mtime: new Date(1), + }), }); }); afterEach(mock.restore); - it('writes a string to a file', function(done) { - fs.writeFile('dir/foo', 'bar', function(err) { + it('writes a string to a file', function (done) { + fs.writeFile('dir/foo', 'bar', function (err) { if (err) { return done(err); } @@ -26,16 +26,16 @@ }); }); - it('promise writes a string to a file', function(done) { - fs.promises.writeFile('dir/foo', 'bar').then(function() { + it('promise writes a string to a file', function (done) { + fs.promises.writeFile('dir/foo', 'bar').then(function () { assert.equal(String(fs.readFileSync('dir/foo')), 'bar'); done(); }, done); }); - it('updates mtime of parent directory', function(done) { + it('updates mtime of parent directory', function (done) { const oldTime = fs.statSync('dir').mtime; - fs.writeFile('dir/foo', 'bar', function(err) { + fs.writeFile('dir/foo', 'bar', function (err) { if (err) { return done(err); } @@ -45,17 +45,17 @@ }); }); - it('promise updates mtime of parent directory', function(done) { + it('promise updates mtime of parent directory', function (done) { const oldTime = fs.statSync('dir').mtime; - fs.promises.writeFile('dir/foo', 'bar').then(function() { + fs.promises.writeFile('dir/foo', 'bar').then(function () { const newTime = fs.statSync('dir').mtime; assert.isTrue(newTime > oldTime); done(); }, done); }); - it('writes a buffer to a file', function(done) { - fs.writeFile('dir/foo', Buffer.from('bar'), function(err) { + it('writes a buffer to a file', function (done) { + fs.writeFile('dir/foo', Buffer.from('bar'), function (err) { if (err) { return done(err); } @@ -64,27 +64,27 @@ }); }); - it('promise writes a buffer to a file', function(done) { - fs.promises.writeFile('dir/foo', Buffer.from('bar')).then(function() { + it('promise writes a buffer to a file', function (done) { + fs.promises.writeFile('dir/foo', Buffer.from('bar')).then(function () { assert.equal(String(fs.readFileSync('dir/foo')), 'bar'); done(); }, done); }); - it('fails if directory does not exist', function(done) { - fs.writeFile('foo/bar', 'baz', function(err) { + it('fails if directory does not exist', function (done) { + fs.writeFile('foo/bar', 'baz', function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); }); }); - it('promise fails if directory does not exist', function(done) { + it('promise fails if directory does not exist', function (done) { fs.promises.writeFile('foo/bar', 'baz').then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'ENOENT'); done(); @@ -93,26 +93,26 @@ }); }); -describe('fs.writeFileSync(filename, data, [options]', function() { - beforeEach(function() { +describe('fs.writeFileSync(filename, data, [options]', function () { + beforeEach(function () { mock({ - '.': {} + '.': {}, }); }); afterEach(mock.restore); - it('writes a string to a file', function() { + it('writes a string to a file', function () { fs.writeFileSync('foo', 'bar'); assert.equal(String(fs.readFileSync('foo')), 'bar'); }); - it('writes a buffer to a file', function() { + it('writes a buffer to a file', function () { fs.writeFileSync('foo', Buffer.from('bar')); assert.equal(String(fs.readFileSync('foo')), 'bar'); }); - it('fails if directory does not exist', function() { - assert.throws(function() { + it('fails if directory does not exist', function () { + assert.throws(function () { fs.writeFileSync('foo/bar', 'baz'); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/fs.write.spec.js node-mock-fs-5.1.4/test/lib/fs.write.spec.js --- node-mock-fs-5.1.2/test/lib/fs.write.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/fs.write.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,23 +1,23 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const assert = helper.assert; -describe('fs.write(fd, buffer, offset, length, position, callback)', function() { - beforeEach(function() { +describe('fs.write(fd, buffer, offset, length, position, callback)', function () { + beforeEach(function () { mock({ - 'path/to/file.txt': 'file content' + 'path/to/file.txt': 'file content', }); }); afterEach(mock.restore); - it('writes a buffer to a file', function(done) { + it('writes a buffer to a file', function (done) { const fd = fs.openSync('path/new-file.txt', 'w'); const buffer = Buffer.from('new file'); - fs.write(fd, buffer, 0, buffer.length, null, function(err, written, buf) { + fs.write(fd, buffer, 0, buffer.length, null, function (err, written, buf) { if (err) { return done(err); } @@ -28,14 +28,14 @@ }); }); - it('promise writes a buffer to a file', function(done) { + it('promise writes a buffer to a file', function (done) { const buffer = Buffer.from('new file'); fs.promises .open('path/new-file.txt', 'w') - .then(function(fd) { + .then(function (fd) { return fd.write(buffer, 0, buffer.length); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesWritten, 8); assert.equal(result.buffer, buffer); assert.equal(String(fs.readFileSync('path/new-file.txt')), 'new file'); @@ -43,10 +43,10 @@ }, done); }); - it('writes a buffer to a file with implicit offset, length, position', function(done) { + it('writes a buffer to a file with implicit offset, length, position', function (done) { const fd = fs.openSync('path/new-file.txt', 'w'); const buffer = Buffer.from('new file'); - fs.write(fd, buffer, function(err, written, buf) { + fs.write(fd, buffer, function (err, written, buf) { if (err) { return done(err); } @@ -57,14 +57,14 @@ }); }); - it('promise writes a buffer to a file with implicit offset, length, position', function(done) { + it('promise writes a buffer to a file with implicit offset, length, position', function (done) { const buffer = Buffer.from('new file'); fs.promises .open('path/new-file.txt', 'w') - .then(function(fd) { + .then(function (fd) { return fd.write(buffer); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesWritten, 8); assert.equal(result.buffer, buffer); assert.equal(String(fs.readFileSync('path/new-file.txt')), 'new file'); @@ -72,13 +72,13 @@ }, done); }); - it('can write a portion of a buffer to a file', function(done) { - fs.open('path/new-file.txt', 'w', function(err, fd) { + it('can write a portion of a buffer to a file', function (done) { + fs.open('path/new-file.txt', 'w', function (err, fd) { if (err) { return done(err); } const buffer = Buffer.from('new file'); - fs.write(fd, buffer, 1, 5, null, function(err2, written, buf) { + fs.write(fd, buffer, 1, 5, null, function (err2, written, buf) { if (err2) { return done(err2); } @@ -90,14 +90,14 @@ }); }); - it('promise can write a portion of a buffer to a file', function(done) { + it('promise can write a portion of a buffer to a file', function (done) { const buffer = Buffer.from('new file'); fs.promises .open('path/new-file.txt', 'w') - .then(function(fd) { + .then(function (fd) { return fd.write(buffer, 1, 5); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesWritten, 5); assert.equal(result.buffer, buffer); assert.equal(String(fs.readFileSync('path/new-file.txt')), 'ew fi'); @@ -105,13 +105,13 @@ }, done); }); - it('can write a portion of a buffer to a file position', function(done) { - fs.open('path/to/file.txt', 'a', function(err, fd) { + it('can write a portion of a buffer to a file position', function (done) { + fs.open('path/to/file.txt', 'a', function (err, fd) { if (err) { return done(err); } const buffer = Buffer.from('new file'); - fs.write(fd, buffer, 1, 5, 2, function(err2, written, buf) { + fs.write(fd, buffer, 1, 5, 2, function (err2, written, buf) { if (err2) { return done(err2); } @@ -126,14 +126,14 @@ }); }); - it('promise can write a portion of a buffer to a file position', function(done) { + it('promise can write a portion of a buffer to a file position', function (done) { const buffer = Buffer.from('new file'); fs.promises .open('path/to/file.txt', 'a') - .then(function(fd) { + .then(function (fd) { return fd.write(buffer, 1, 5, 2); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesWritten, 5); assert.equal(result.buffer, buffer); assert.equal( @@ -144,13 +144,13 @@ }, done); }); - it('can write a portion of a buffer to a file position and enlarge the file', function(done) { - fs.open('path/to/file.txt', 'a', function(err, fd) { + it('can write a portion of a buffer to a file position and enlarge the file', function (done) { + fs.open('path/to/file.txt', 'a', function (err, fd) { if (err) { return done(err); } const buffer = Buffer.from('new file'); - fs.write(fd, buffer, 1, 5, 8, function(err2, written, buf) { + fs.write(fd, buffer, 1, 5, 8, function (err2, written, buf) { if (err2) { return done(err2); } @@ -165,14 +165,14 @@ }); }); - it('promise can write a portion of a buffer to a file position and enlarge the file', function(done) { + it('promise can write a portion of a buffer to a file position and enlarge the file', function (done) { const buffer = Buffer.from('new file'); fs.promises .open('path/to/file.txt', 'a') - .then(function(fd) { + .then(function (fd) { return fd.write(buffer, 1, 5, 8); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesWritten, 5); assert.equal(result.buffer, buffer); assert.equal( @@ -183,13 +183,13 @@ }, done); }); - it('can append to a file', function(done) { - fs.open('path/to/file.txt', 'a', function(err, fd) { + it('can append to a file', function (done) { + fs.open('path/to/file.txt', 'a', function (err, fd) { if (err) { return done(err); } const buffer = Buffer.from(' more'); - fs.write(fd, buffer, 0, 5, null, function(err2, written, buf) { + fs.write(fd, buffer, 0, 5, null, function (err2, written, buf) { if (err2) { return done(err2); } @@ -204,14 +204,14 @@ }); }); - it('promise can append to a file', function(done) { + it('promise can append to a file', function (done) { const buffer = Buffer.from(' more'); fs.promises .open('path/to/file.txt', 'a') - .then(function(fd) { + .then(function (fd) { return fd.write(buffer, 0, 5); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesWritten, 5); assert.equal(result.buffer, buffer); assert.equal( @@ -222,12 +222,12 @@ }, done); }); - it('fails if file not open for writing', function(done) { - fs.open('path/to/file.txt', 'r', function(err, fd) { + it('fails if file not open for writing', function (done) { + fs.open('path/to/file.txt', 'r', function (err, fd) { if (err) { return done(err); } - fs.write(fd, Buffer.from('oops'), 0, 4, null, function(err2) { + fs.write(fd, Buffer.from('oops'), 0, 4, null, function (err2) { assert.instanceOf(err2, Error); assert.equal(err2.code, 'EBADF'); done(); @@ -235,17 +235,17 @@ }); }); - it('fails if file not open for writing', function(done) { + it('fails if file not open for writing', function (done) { fs.promises .open('path/to/file.txt', 'r') - .then(function(fd) { + .then(function (fd) { return fd.write(Buffer.from('oops'), 0, 4); }) .then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EBADF'); done(); @@ -254,15 +254,15 @@ }); }); -describe('fs.writeSync(fd, buffer, offset, length, position)', function() { - beforeEach(function() { +describe('fs.writeSync(fd, buffer, offset, length, position)', function () { + beforeEach(function () { mock({ - 'path/to/file.txt': 'file content' + 'path/to/file.txt': 'file content', }); }); afterEach(mock.restore); - it('writes a buffer to a file', function() { + it('writes a buffer to a file', function () { const buffer = Buffer.from('new file'); const fd = fs.openSync('path/new-file.txt', 'w'); const written = fs.writeSync(fd, buffer, 0, buffer.length); @@ -270,7 +270,7 @@ assert.equal(String(fs.readFileSync('path/new-file.txt')), 'new file'); }); - it('can write a portion of a buffer to a file', function() { + it('can write a portion of a buffer to a file', function () { const buffer = Buffer.from('new file'); const fd = fs.openSync('path/new-file.txt', 'w'); const written = fs.writeSync(fd, buffer, 1, 5); @@ -278,7 +278,7 @@ assert.equal(String(fs.readFileSync('path/new-file.txt')), 'ew fi'); }); - it('can append to a file', function() { + it('can append to a file', function () { const buffer = Buffer.from(' more'); const fd = fs.openSync('path/to/file.txt', 'a'); const written = fs.writeSync(fd, buffer, 0, 5); @@ -289,29 +289,29 @@ ); }); - it('fails if file not open for writing', function() { + it('fails if file not open for writing', function () { const fd = fs.openSync('path/to/file.txt', 'r'); - assert.throws(function() { + assert.throws(function () { fs.writeSync(fd, Buffer.from('oops'), 0, 4); }); }); }); -describe('fs.write(fd, data[, position[, encoding]], callback)', function() { - beforeEach(function() { +describe('fs.write(fd, data[, position[, encoding]], callback)', function () { + beforeEach(function () { mock({ - 'path/to/file.txt': 'file content' + 'path/to/file.txt': 'file content', }); }); afterEach(mock.restore); - it('writes a string to a file', function(done) { - fs.open('path/new-file.txt', 'w', function(err, fd) { + it('writes a string to a file', function (done) { + fs.open('path/new-file.txt', 'w', function (err, fd) { if (err) { return done(err); } const string = 'new file'; - fs.write(fd, string, null, 'utf-8', function(err2, written, str) { + fs.write(fd, string, null, 'utf-8', function (err2, written, str) { if (err2) { return done(err2); } @@ -323,14 +323,14 @@ }); }); - it('promise writes a string to a file', function(done) { + it('promise writes a string to a file', function (done) { const string = 'new file'; fs.promises .open('path/new-file.txt', 'w') - .then(function(fd) { + .then(function (fd) { return fd.write(string, null, 'utf-8'); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesWritten, 8); assert.equal(String(result.buffer), string); assert.equal(String(fs.readFileSync('path/new-file.txt')), 'new file'); @@ -338,13 +338,13 @@ }, done); }); - it('writes a string to a file with implicit position and encoding', function(done) { - fs.open('path/new-file.txt', 'w', function(err, fd) { + it('writes a string to a file with implicit position and encoding', function (done) { + fs.open('path/new-file.txt', 'w', function (err, fd) { if (err) { return done(err); } const string = 'new file'; - fs.write(fd, string, function(err2, written, str) { + fs.write(fd, string, function (err2, written, str) { if (err2) { return done(err2); } @@ -356,14 +356,14 @@ }); }); - it('promise writes a string to a file with implicit position and encoding', function(done) { + it('promise writes a string to a file with implicit position and encoding', function (done) { const string = 'new file'; fs.promises .open('path/new-file.txt', 'w') - .then(function(fd) { + .then(function (fd) { return fd.write(string); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesWritten, 8); assert.equal(String(result.buffer), string); assert.equal(String(fs.readFileSync('path/new-file.txt')), 'new file'); @@ -371,13 +371,13 @@ }, done); }); - it('can append to a file', function(done) { - fs.open('path/to/file.txt', 'a', function(err, fd) { + it('can append to a file', function (done) { + fs.open('path/to/file.txt', 'a', function (err, fd) { if (err) { return done(err); } const string = ' more'; - fs.write(fd, string, null, 'utf-8', function(err2, written, str) { + fs.write(fd, string, null, 'utf-8', function (err2, written, str) { if (err2) { return done(err2); } @@ -389,14 +389,14 @@ }); }); - it('promise can append to a file', function(done) { + it('promise can append to a file', function (done) { const string = ' more'; fs.promises .open('path/to/file.txt', 'a') - .then(function(fd) { + .then(function (fd) { return fd.write(string); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesWritten, 5); assert.equal(String(result.buffer), string); assert.equal( @@ -407,13 +407,13 @@ }, done); }); - it('can write to a position of a file', function(done) { - fs.open('path/to/file.txt', 'a', function(err, fd) { + it('can write to a position of a file', function (done) { + fs.open('path/to/file.txt', 'a', function (err, fd) { if (err) { return done(err); } const string = ' more'; - fs.write(fd, string, 3, function(err2, written, str) { + fs.write(fd, string, 3, function (err2, written, str) { if (err2) { return done(err2); } @@ -425,14 +425,14 @@ }); }); - it('promise can write to a position of a file', function(done) { + it('promise can write to a position of a file', function (done) { const string = ' more'; fs.promises .open('path/to/file.txt', 'a') - .then(function(fd) { + .then(function (fd) { return fd.write(string, 3); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesWritten, 5); assert.equal(String(result.buffer), string); assert.equal( @@ -443,13 +443,13 @@ }, done); }); - it('can write to a position of a file and enlarge it', function(done) { - fs.open('path/to/file.txt', 'a', function(err, fd) { + it('can write to a position of a file and enlarge it', function (done) { + fs.open('path/to/file.txt', 'a', function (err, fd) { if (err) { return done(err); } const string = ' more'; - fs.write(fd, string, 9, function(err2, written, str) { + fs.write(fd, string, 9, function (err2, written, str) { if (err2) { return done(err2); } @@ -461,14 +461,14 @@ }); }); - it('promise can write to a position of a file and enlarge it', function(done) { + it('promise can write to a position of a file and enlarge it', function (done) { const string = ' more'; fs.promises .open('path/to/file.txt', 'a') - .then(function(fd) { + .then(function (fd) { return fd.write(string, 9); }) - .then(function(result) { + .then(function (result) { assert.equal(result.bytesWritten, 5); assert.equal(String(result.buffer), string); assert.equal( @@ -479,29 +479,29 @@ }, done); }); - it('fails if file not open for writing', function(done) { - fs.open('path/to/file.txt', 'r', function(err, fd) { + it('fails if file not open for writing', function (done) { + fs.open('path/to/file.txt', 'r', function (err, fd) { if (err) { return done(err); } - fs.write(fd, 'oops', null, 'utf-8', function(err2) { + fs.write(fd, 'oops', null, 'utf-8', function (err2) { assert.instanceOf(err2, Error); done(); }); }); }); - it('promise fails if file not open for writing', function(done) { + it('promise fails if file not open for writing', function (done) { fs.promises .open('path/to/file.txt', 'r') - .then(function(fd) { + .then(function (fd) { return fd.write('oops'); }) .then( - function() { + function () { done(new Error('should not succeed.')); }, - function(err) { + function (err) { assert.instanceOf(err, Error); assert.equal(err.code, 'EBADF'); done(); @@ -510,15 +510,15 @@ }); }); -describe('fs.writeSync(fd, data[, position[, encoding]])', function() { - beforeEach(function() { +describe('fs.writeSync(fd, data[, position[, encoding]])', function () { + beforeEach(function () { mock({ - 'path/to/file.txt': 'file content' + 'path/to/file.txt': 'file content', }); }); afterEach(mock.restore); - it('writes a string to a file', function() { + it('writes a string to a file', function () { const fd = fs.openSync('path/new-file.txt', 'w'); const string = 'new file'; const written = fs.writeSync(fd, string, null, 'utf-8'); @@ -526,7 +526,7 @@ assert.equal(fs.readFileSync('path/new-file.txt'), 'new file'); }); - it('can append to a file', function() { + it('can append to a file', function () { const fd = fs.openSync('path/to/file.txt', 'a'); const string = ' more'; const written = fs.writeSync(fd, string, null, 'utf-8'); @@ -534,9 +534,9 @@ assert.equal(fs.readFileSync('path/to/file.txt'), 'file content more'); }); - it('fails if file not open for writing', function() { + it('fails if file not open for writing', function () { const fd = fs.openSync('path/to/file.txt', 'r'); - assert.throws(function() { + assert.throws(function () { fs.writeSync(fd, 'oops', null, 'utf-8'); }); }); diff -Nru node-mock-fs-5.1.2/test/lib/index.spec.js node-mock-fs-5.1.4/test/lib/index.spec.js --- node-mock-fs-5.1.2/test/lib/index.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/index.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,22 +1,22 @@ 'use strict'; -const helper = require('../helper'); +const helper = require('../helper.js'); const fs = require('fs'); -const mock = require('../../lib/index'); +const mock = require('../../lib/index.js'); const os = require('os'); const path = require('path'); -const File = require('../../lib/file'); -const {fixWin32Permissions} = require('../../lib/item'); -const Directory = require('../../lib/directory'); +const File = require('../../lib/file.js'); +const {fixWin32Permissions} = require('../../lib/item.js'); +const Directory = require('../../lib/directory.js'); const assert = helper.assert; const assetsPath = path.resolve(__dirname, '../assets'); -describe('The API', function() { - describe('mock()', function() { - it('configures the real fs module with a mock file system', function() { +describe('The API', function () { + describe('mock()', function () { + it('configures the real fs module with a mock file system', function () { mock({ - 'fake-file-for-testing-only': 'file content' + 'fake-file-for-testing-only': 'file content', }); assert.isTrue(fs.existsSync('fake-file-for-testing-only')); @@ -24,7 +24,7 @@ mock.restore(); }); - it('provides direct access to the internal filesystem object', function() { + it('provides direct access to the internal filesystem object', function () { mock(); const root = mock.getMockRoot(); assert.notDeepEqual(root, {}); @@ -32,7 +32,7 @@ assert.deepEqual(mock.getMockRoot(), {}); }); - it('creates process.cwd() and os.tmpdir() by default', function() { + it('creates process.cwd() and os.tmpdir() by default', function () { mock(); assert.isTrue(fs.statSync(process.cwd()).isDirectory()); @@ -49,7 +49,7 @@ mock.restore(); }); - it('passes the createCwd option to the FileSystem constructor', function() { + it('passes the createCwd option to the FileSystem constructor', function () { mock({}, {createCwd: false}); assert.isFalse(fs.existsSync(process.cwd())); @@ -57,7 +57,7 @@ mock.restore(); }); - it('passes the createTmp option to the FileSystem constructor', function() { + it('passes the createTmp option to the FileSystem constructor', function () { mock({}, {createTmp: false}); let tmp; @@ -73,7 +73,7 @@ mock.restore(); }); - xit('uses the real fs module in require() calls', function() { + xit('uses the real fs module in require() calls', function () { mock({foo: 'bar'}); const pkg = require('../../package.json'); @@ -83,10 +83,10 @@ }); }); - describe('mock.restore()', function() { - it('restores bindings for the real file system', function() { + describe('mock.restore()', function () { + it('restores bindings for the real file system', function () { mock({ - 'fake-file-for-testing-only': 'file content' + 'fake-file-for-testing-only': 'file content', }); assert.isTrue(fs.existsSync('fake-file-for-testing-only')); @@ -96,19 +96,19 @@ }); }); - describe('mock.file()', function() { + describe('mock.file()', function () { afterEach(mock.restore); - it('lets you create files with additional properties', function(done) { + it('lets you create files with additional properties', function (done) { mock({ 'path/to/file.txt': mock.file({ content: 'file content', mtime: new Date(8675309), - mode: parseInt('0644', 8) - }) + mode: parseInt('0644', 8), + }), }); - fs.stat('path/to/file.txt', function(err, stats) { + fs.stat('path/to/file.txt', function (err, stats) { if (err) { return done(err); } @@ -121,18 +121,18 @@ }); }); - describe('mock.directory()', function() { + describe('mock.directory()', function () { afterEach(mock.restore); - it('lets you create directories with more properties', function(done) { + it('lets you create directories with more properties', function (done) { mock({ 'path/to/dir': mock.directory({ mtime: new Date(8675309), - mode: parseInt('0644', 8) - }) + mode: parseInt('0644', 8), + }), }); - fs.stat('path/to/dir', function(err, stats) { + fs.stat('path/to/dir', function (err, stats) { if (err) { return done(err); } @@ -144,24 +144,24 @@ }); }); - it('works with a trailing slash', function() { + it('works with a trailing slash', function () { mock({ 'path/to/dir/': mock.directory({ mtime: new Date(8675309), - mode: parseInt('0644', 8) - }) + mode: parseInt('0644', 8), + }), }); assert.isTrue(fs.statSync('path/to/dir').isDirectory()); assert.isTrue(fs.statSync('path/to/dir/').isDirectory()); }); - it('works without a trailing slash', function() { + it('works without a trailing slash', function () { mock({ 'path/to/dir': mock.directory({ mtime: new Date(8675309), - mode: parseInt('0644', 8) - }) + mode: parseInt('0644', 8), + }), }); assert.isTrue(fs.statSync('path/to/dir').isDirectory()); @@ -169,13 +169,13 @@ }); }); - describe('mock.symlink()', function() { + describe('mock.symlink()', function () { afterEach(mock.restore); - it('lets you create symbolic links', function() { + it('lets you create symbolic links', function () { mock({ 'path/to/file': 'content', - 'path/to/link': mock.symlink({path: './file'}) + 'path/to/link': mock.symlink({path: './file'}), }); const stats = fs.statSync('path/to/link'); @@ -192,9 +192,9 @@ 'gid', 'uid', 'mtime', - 'mode' + 'mode', ]; - const filterStats = stats => { + const filterStats = (stats) => { const res = {}; for (const key of statsCompareKeys) { const k = @@ -272,7 +272,7 @@ it('lazy=false loads file content', () => { const file = mock.load(path.join(assetsPath, 'file1.txt'), { - lazy: false + lazy: false, })(); assert.equal( @@ -343,26 +343,26 @@ }); }); - xdescribe('mock.fs()', function() { - it('generates a mock fs module with a mock file system', function(done) { + xdescribe('mock.fs()', function () { + it('generates a mock fs module with a mock file system', function (done) { const mockFs = mock.fs({ - 'path/to/file.txt': 'file content' + 'path/to/file.txt': 'file content', }); - mockFs.exists('path/to/file.txt', function(exists) { + mockFs.exists('path/to/file.txt', function (exists) { assert.isTrue(exists); done(); }); }); - it('passes options to the FileSystem constructor', function() { + it('passes options to the FileSystem constructor', function () { const mockFs = mock.fs( { - '/path/to/file.txt': 'file content' + '/path/to/file.txt': 'file content', }, { createCwd: false, - createTmp: false + createTmp: false, } ); @@ -370,14 +370,14 @@ assert.deepEqual(mockFs.readdirSync('/'), ['path']); }); - it('accepts an arbitrary nesting of files and directories', function() { + it('accepts an arbitrary nesting of files and directories', function () { const mockFs = mock.fs({ 'dir-one': { 'dir-two': { - 'some-file.txt': 'file content here' - } + 'some-file.txt': 'file content here', + }, }, - 'empty-dir': {} + 'empty-dir': {}, }); assert.isTrue(mockFs.existsSync('dir-one/dir-two/some-file.txt')); @@ -388,10 +388,10 @@ }); }); -describe('process.cwd()', function() { +describe('process.cwd()', function () { afterEach(mock.restore); - it('maintains current working directory', function() { + it('maintains current working directory', function () { const originalCwd = process.cwd(); mock(); @@ -399,10 +399,10 @@ assert.equal(cwd, originalCwd); }); - it('allows changing directory', function() { + it('allows changing directory', function () { const originalCwd = process.cwd(); mock({ - dir: {} + dir: {}, }); process.chdir('dir'); @@ -410,7 +410,7 @@ assert.equal(cwd, path.join(originalCwd, 'dir')); }); - it('prevents changing directory to non-existent path', function() { + it('prevents changing directory to non-existent path', function () { mock(); let err; @@ -423,9 +423,9 @@ assert.equal(err.code, 'ENOENT'); }); - it('prevents changing directory to non-directory path', function() { + it('prevents changing directory to non-directory path', function () { mock({ - file: '' + file: '', }); let err; @@ -438,7 +438,7 @@ assert.equal(err.code, 'ENOTDIR'); }); - it('restores original methods on restore', function() { + it('restores original methods on restore', function () { const originalCwd = process.cwd; const originalChdir = process.chdir; mock(); @@ -448,10 +448,10 @@ assert.equal(process.chdir, originalChdir); }); - it('restores original working directory on restore', function() { + it('restores original working directory on restore', function () { const originalCwd = process.cwd(); mock({ - dir: {} + dir: {}, }); process.chdir('dir'); @@ -463,19 +463,19 @@ }); if (process.getuid && process.getgid) { - describe('security', function() { + describe('security', function () { afterEach(mock.restore); - it('denies dir listing without execute on parent', function() { + it('denies dir listing without execute on parent', function () { mock({ secure: mock.directory({ mode: parseInt('0666', 8), items: { insecure: { - file: 'file content' - } - } - }) + file: 'file content', + }, + }, + }), }); let err; @@ -488,16 +488,16 @@ assert.equal(err.code, 'EACCES'); }); - it('denies file read without execute on parent', function() { + it('denies file read without execute on parent', function () { mock({ secure: mock.directory({ mode: parseInt('0666', 8), items: { insecure: { - file: 'file content' - } - } - }) + file: 'file content', + }, + }, + }), }); let err; @@ -510,14 +510,14 @@ assert.equal(err.code, 'EACCES'); }); - it('denies file read without read on file', function() { + it('denies file read without read on file', function () { mock({ insecure: { 'write-only': mock.file({ mode: parseInt('0222', 8), - content: 'write only' - }) - } + content: 'write only', + }), + }, }); let err; @@ -530,14 +530,14 @@ assert.equal(err.code, 'EACCES'); }); - it('denies file write without write on file', function() { + it('denies file write without write on file', function () { mock({ insecure: { 'read-only': mock.file({ mode: parseInt('0444', 8), - content: 'read only' - }) - } + content: 'read only', + }), + }, }); let err; diff -Nru node-mock-fs-5.1.2/test/lib/item.spec.js node-mock-fs-5.1.4/test/lib/item.spec.js --- node-mock-fs-5.1.2/test/lib/item.spec.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/item.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -1,18 +1,18 @@ 'use strict'; -const Item = require('../../lib/item'); -const assert = require('../helper').assert; +const Item = require('../../lib/item.js'); +const assert = require('../helper.js').assert; -describe('Item', function() { - describe('constructor', function() { - it('creates a new instance', function() { +describe('Item', function () { + describe('constructor', function () { + it('creates a new instance', function () { const item = new Item(); assert.instanceOf(item, Item); }); }); - describe('#getATime()', function() { - it('returns a date', function() { + describe('#getATime()', function () { + it('returns a date', function () { const item = new Item(); const date = item.getATime(); assert.instanceOf(date, Date); @@ -20,8 +20,8 @@ }); }); - describe('#setATime()', function() { - it('sets the atime', function() { + describe('#setATime()', function () { + it('sets the atime', function () { const item = new Item(); const date = new Date(); item.setATime(date); @@ -29,8 +29,8 @@ }); }); - describe('#getCTime()', function() { - it('returns a date', function() { + describe('#getCTime()', function () { + it('returns a date', function () { const item = new Item(); const date = item.getCTime(); assert.instanceOf(date, Date); @@ -38,8 +38,8 @@ }); }); - describe('#setCTime()', function() { - it('sets the ctime', function() { + describe('#setCTime()', function () { + it('sets the ctime', function () { const item = new Item(); const date = new Date(); item.setCTime(date); @@ -47,8 +47,8 @@ }); }); - describe('#getBirthtime()', function() { - it('returns a date', function() { + describe('#getBirthtime()', function () { + it('returns a date', function () { const item = new Item(); const date = item.getBirthtime(); assert.instanceOf(date, Date); @@ -56,8 +56,8 @@ }); }); - describe('#setBirthtime()', function() { - it('sets the birthtime', function() { + describe('#setBirthtime()', function () { + it('sets the birthtime', function () { const item = new Item(); const date = new Date(); item.setBirthtime(date); @@ -65,8 +65,8 @@ }); }); - describe('#getMTime()', function() { - it('returns a date', function() { + describe('#getMTime()', function () { + it('returns a date', function () { const item = new Item(); const date = item.getMTime(); assert.instanceOf(date, Date); @@ -74,8 +74,8 @@ }); }); - describe('#setMTime()', function() { - it('sets the mtime', function() { + describe('#setMTime()', function () { + it('sets the mtime', function () { const item = new Item(); const date = new Date(); item.setMTime(date); @@ -83,21 +83,21 @@ }); }); - describe('#getMode()', function() { - it('returns a number', function() { + describe('#getMode()', function () { + it('returns a number', function () { const item = new Item(); assert.isNumber(item.getMode()); }); }); - describe('#setMode()', function() { - it('sets the mode', function() { + describe('#setMode()', function () { + it('sets the mode', function () { const item = new Item(); item.setMode(parseInt('0644', 8)); assert.equal(item.getMode(), parseInt('0644', 8)); }); - it('updates the ctime', function() { + it('updates the ctime', function () { const item = new Item(); const original = new Date(1); item.setCTime(original); @@ -106,14 +106,14 @@ }); }); - describe('#setUid()', function() { - it('sets the uid', function() { + describe('#setUid()', function () { + it('sets the uid', function () { const item = new Item(); item.setUid(42); assert.equal(item.getUid(), 42); }); - it('updates the ctime', function() { + it('updates the ctime', function () { const item = new Item(); const original = new Date(1); item.setCTime(original); @@ -122,14 +122,14 @@ }); }); - describe('#setGid()', function() { - it('sets the gid', function() { + describe('#setGid()', function () { + it('sets the gid', function () { const item = new Item(); item.setGid(42); assert.equal(item.getGid(), 42); }); - it('updates the ctime', function() { + it('updates the ctime', function () { const item = new Item(); const original = new Date(1); item.setCTime(original); @@ -143,78 +143,78 @@ const gid = process.getgid(); let item; - beforeEach(function() { + beforeEach(function () { item = new Item(); }); - describe('#canRead()', function() { - it('returns true if owner and 0700', function() { + describe('#canRead()', function () { + it('returns true if owner and 0700', function () { item.setMode(parseInt('0700', 8)); assert.isTrue(item.canRead()); }); - it('returns true if owner and 0600', function() { + it('returns true if owner and 0600', function () { item.setMode(parseInt('0600', 8)); assert.isTrue(item.canRead()); }); - it('returns true if owner and 0500', function() { + it('returns true if owner and 0500', function () { item.setMode(parseInt('0500', 8)); assert.isTrue(item.canRead()); }); - it('returns true if owner and 0400', function() { + it('returns true if owner and 0400', function () { item.setMode(parseInt('0400', 8)); assert.isTrue(item.canRead()); }); - it('returns false if owner and 0300', function() { + it('returns false if owner and 0300', function () { item.setMode(parseInt('0300', 8)); assert.isFalse(item.canRead()); }); - it('returns false if owner and 0200', function() { + it('returns false if owner and 0200', function () { item.setMode(parseInt('0200', 8)); assert.isFalse(item.canRead()); }); - it('returns false if owner and 0100', function() { + it('returns false if owner and 0100', function () { item.setMode(parseInt('0100', 8)); assert.isFalse(item.canRead()); }); - it('returns false if not owner and 0700 (different user)', function() { + it('returns false if not owner and 0700 (different user)', function () { item.setUid(uid + 1); item.setMode(parseInt('0700', 8)); assert.isFalse(item.canRead()); }); - it('returns false if not owner and 0700 (different group)', function() { + it('returns false if not owner and 0700 (different group)', function () { item.setUid(uid + 1); item.setGid(gid + 1); item.setMode(parseInt('0700', 8)); assert.isFalse(item.canRead()); }); - it('returns false if owner and 0170', function() { + it('returns false if owner and 0170', function () { item.setMode(parseInt('0170', 8)); assert.isFalse(item.canRead()); }); - it('returns true if in group and 0170', function() { + it('returns true if in group and 0170', function () { item.setUid(uid + 1); item.setMode(parseInt('0170', 8)); assert.isTrue(item.canRead()); }); - it('returns false if not in group and 0770', function() { + it('returns false if not in group and 0770', function () { item.setUid(uid + 1); item.setGid(gid + 1); item.setMode(parseInt('0770', 8)); assert.isFalse(item.canRead()); }); - it('returns true if not in group and 0777', function() { + it('returns true if not in group and 0777', function () { item.setUid(uid + 1); item.setGid(gid + 1); item.setMode(parseInt('0777', 8)); @@ -222,74 +222,74 @@ }); }); - describe('#canWrite()', function() { - it('returns true if owner and 0700', function() { + describe('#canWrite()', function () { + it('returns true if owner and 0700', function () { item.setMode(parseInt('0700', 8)); assert.isTrue(item.canWrite()); }); - it('returns true if owner and 0600', function() { + it('returns true if owner and 0600', function () { item.setMode(parseInt('0600', 8)); assert.isTrue(item.canWrite()); }); - it('returns false if owner and 0500', function() { + it('returns false if owner and 0500', function () { item.setMode(parseInt('0500', 8)); assert.isFalse(item.canWrite()); }); - it('returns false if owner and 0400', function() { + it('returns false if owner and 0400', function () { item.setMode(parseInt('0400', 8)); assert.isFalse(item.canWrite()); }); - it('returns true if owner and 0300', function() { + it('returns true if owner and 0300', function () { item.setMode(parseInt('0300', 8)); assert.isTrue(item.canWrite()); }); - it('returns true if owner and 0200', function() { + it('returns true if owner and 0200', function () { item.setMode(parseInt('0200', 8)); assert.isTrue(item.canWrite()); }); - it('returns false if owner and 0100', function() { + it('returns false if owner and 0100', function () { item.setMode(parseInt('0100', 8)); assert.isFalse(item.canWrite()); }); - it('returns false if not owner and 0700 (different user)', function() { + it('returns false if not owner and 0700 (different user)', function () { item.setUid(uid + 1); item.setMode(parseInt('0700', 8)); assert.isFalse(item.canWrite()); }); - it('returns false if not owner and 0700 (different group)', function() { + it('returns false if not owner and 0700 (different group)', function () { item.setUid(uid + 1); item.setGid(gid + 1); item.setMode(parseInt('0700', 8)); assert.isFalse(item.canWrite()); }); - it('returns false if owner and 0170', function() { + it('returns false if owner and 0170', function () { item.setMode(parseInt('0170', 8)); assert.isFalse(item.canWrite()); }); - it('returns true if in group and 0170', function() { + it('returns true if in group and 0170', function () { item.setUid(uid + 1); item.setMode(parseInt('0170', 8)); assert.isTrue(item.canWrite()); }); - it('returns false if not in group and 0770', function() { + it('returns false if not in group and 0770', function () { item.setUid(uid + 1); item.setGid(gid + 1); item.setMode(parseInt('0770', 8)); assert.isFalse(item.canWrite()); }); - it('returns true if not in group and 0777', function() { + it('returns true if not in group and 0777', function () { item.setUid(uid + 1); item.setGid(gid + 1); item.setMode(parseInt('0777', 8)); @@ -297,74 +297,74 @@ }); }); - describe('#canExecute()', function() { - it('returns true if owner and 0700', function() { + describe('#canExecute()', function () { + it('returns true if owner and 0700', function () { item.setMode(parseInt('0700', 8)); assert.isTrue(item.canExecute()); }); - it('returns false if owner and 0600', function() { + it('returns false if owner and 0600', function () { item.setMode(parseInt('0600', 8)); assert.isFalse(item.canExecute()); }); - it('returns true if owner and 0500', function() { + it('returns true if owner and 0500', function () { item.setMode(parseInt('0500', 8)); assert.isTrue(item.canExecute()); }); - it('returns false if owner and 0400', function() { + it('returns false if owner and 0400', function () { item.setMode(parseInt('0400', 8)); assert.isFalse(item.canExecute()); }); - it('returns true if owner and 0300', function() { + it('returns true if owner and 0300', function () { item.setMode(parseInt('0300', 8)); assert.isTrue(item.canExecute()); }); - it('returns false if owner and 0200', function() { + it('returns false if owner and 0200', function () { item.setMode(parseInt('0200', 8)); assert.isFalse(item.canExecute()); }); - it('returns true if owner and 0100', function() { + it('returns true if owner and 0100', function () { item.setMode(parseInt('0100', 8)); assert.isTrue(item.canExecute()); }); - it('returns false if not owner and 0700 (different user)', function() { + it('returns false if not owner and 0700 (different user)', function () { item.setUid(uid + 1); item.setMode(parseInt('0700', 8)); assert.isFalse(item.canExecute()); }); - it('returns false if not owner and 0700 (different group)', function() { + it('returns false if not owner and 0700 (different group)', function () { item.setUid(uid + 1); item.setGid(gid + 1); item.setMode(parseInt('0700', 8)); assert.isFalse(item.canExecute()); }); - it('returns false if owner and 0270', function() { + it('returns false if owner and 0270', function () { item.setMode(parseInt('0270', 8)); assert.isFalse(item.canExecute()); }); - it('returns true if in group and 0270', function() { + it('returns true if in group and 0270', function () { item.setUid(uid + 1); item.setMode(parseInt('0270', 8)); assert.isTrue(item.canExecute()); }); - it('returns false if not in group and 0770', function() { + it('returns false if not in group and 0770', function () { item.setUid(uid + 1); item.setGid(gid + 1); item.setMode(parseInt('0770', 8)); assert.isFalse(item.canExecute()); }); - it('returns true if not in group and 0777', function() { + it('returns true if not in group and 0777', function () { item.setUid(uid + 1); item.setGid(gid + 1); item.setMode(parseInt('0777', 8)); diff -Nru node-mock-fs-5.1.2/test/lib/readfilecontext.js node-mock-fs-5.1.4/test/lib/readfilecontext.js --- node-mock-fs-5.1.2/test/lib/readfilecontext.js 2021-11-08 20:09:32.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/readfilecontext.js 1970-01-01 00:00:00.000000000 +0000 @@ -1,174 +0,0 @@ -'use strict'; - -const constants = require('constants'); -const helper = require('../helper'); -const fs = require('fs'); -const mock = require('../../lib/index'); -const { - patchReadFileContext, - getReadFileContextPrototype -} = require('../../lib/readfilecontext'); - -const assert = helper.assert; -const inVersion = helper.inVersion; - -describe('getReadFileContextPrototype', function() { - it('provides access to the internal ReadFileContext', function() { - const proto = getReadFileContextPrototype(); - assert.equal(proto.constructor.name, 'ReadFileContext'); - assert.equal(typeof proto.read, 'function'); - assert.equal(typeof proto.close, 'function'); - }); -}); - -describe('patchReadFileContext', function() { - it('patch forwards calls to mocked binding when available', function() { - const calls = { - read: 0, - close: 0, - mockedRead: 0, - mockedClose: 0 - }; - - const proto = { - read: function() { - calls.read++; - }, - close: function() { - calls.close++; - } - }; - - const mockedBinding = { - read: function() { - assert.strictEqual(this, mockedBinding); - calls.mockedRead++; - }, - close: function() { - assert.strictEqual(this, mockedBinding); - calls.mockedClose++; - } - }; - - patchReadFileContext(proto); - - const target = Object.create(proto); - - assert.deepEqual(calls, { - read: 0, - close: 0, - mockedRead: 0, - mockedClose: 0 - }); - - target.read(); - assert.deepEqual(calls, { - read: 1, - close: 0, - mockedRead: 0, - mockedClose: 0 - }); - target.close(); - assert.deepEqual(calls, { - read: 1, - close: 1, - mockedRead: 0, - mockedClose: 0 - }); - - proto._mockedBinding = mockedBinding; - target.read(); - assert.deepEqual(calls, { - read: 1, - close: 1, - mockedRead: 1, - mockedClose: 0 - }); - target.close(); - assert.deepEqual(calls, { - read: 1, - close: 1, - mockedRead: 1, - mockedClose: 1 - }); - - delete proto._mockedBinding; - target.read(); - assert.deepEqual(calls, { - read: 2, - close: 1, - mockedRead: 1, - mockedClose: 1 - }); - target.close(); - assert.deepEqual(calls, { - read: 2, - close: 2, - mockedRead: 1, - mockedClose: 1 - }); - }); -}); - -describe('fs.readFile() with ReadFileContext', function() { - // fs.readFile() is already tested elsewhere, here we just make sure we have - // coverage of the mocked ReadFileContext implementation. - - beforeEach(function() { - mock({ - 'path/to/file.txt': 'file content', - 1: 'fd content' - }); - }); - afterEach(mock.restore); - - inVersion('>=15.0.0').it('allows file reads to be aborted', function(done) { - const controller = new AbortController(); - const {signal} = controller; - - fs.readFile('path/to/file.txt', {signal}, function(err) { - assert.instanceOf(err, Error); - assert.equal(err.name, 'AbortError'); - assert.equal(err.code, 'ABORT_ERR'); - done(); - }); - - // By aborting after the call it will be handled by the context rather than readFile() - controller.abort(); - }); - - it('allows file reads with a numeric descriptor', function(done) { - // This isn't actually supported by mock-fs, but let's make sure the call goes through - // It also covers the case of reading an empty file and reading with encoding - fs.readFile(1, 'utf-8', function(err, data) { - assert.isNull(err); - assert.equal(data, ''); - done(); - }); - }); - - it('allows file reads with unknown size', function(done) { - mock({ - 'unknown-size.txt': function() { - const file = mock.file({ - content: Buffer.from('unknown size') - })(); - - // Override getStats to drop the S_IFREG flag - const origGetStats = file.getStats; - file.getStats = function() { - const stats = origGetStats.apply(this, arguments); - stats[1] ^= constants.S_IFREG; - return stats; - }; - return file; - } - }); - - fs.readFile('unknown-size.txt', 'utf-8', function(err, data) { - assert.isNull(err); - assert.equal(data, 'unknown size'); - done(); - }); - }); -}); diff -Nru node-mock-fs-5.1.2/test/lib/readfilecontext.spec.js node-mock-fs-5.1.4/test/lib/readfilecontext.spec.js --- node-mock-fs-5.1.2/test/lib/readfilecontext.spec.js 1970-01-01 00:00:00.000000000 +0000 +++ node-mock-fs-5.1.4/test/lib/readfilecontext.spec.js 2022-08-04 03:14:53.000000000 +0000 @@ -0,0 +1,174 @@ +'use strict'; + +const constants = require('constants'); +const helper = require('../helper.js'); +const fs = require('fs'); +const mock = require('../../lib/index.js'); +const { + patchReadFileContext, + getReadFileContextPrototype, +} = require('../../lib/readfilecontext.js'); + +const assert = helper.assert; +const inVersion = helper.inVersion; + +describe('getReadFileContextPrototype', function () { + it('provides access to the internal ReadFileContext', function () { + const proto = getReadFileContextPrototype(); + assert.equal(proto.constructor.name, 'ReadFileContext'); + assert.equal(typeof proto.read, 'function'); + assert.equal(typeof proto.close, 'function'); + }); +}); + +describe('patchReadFileContext', function () { + it('patch forwards calls to mocked binding when available', function () { + const calls = { + read: 0, + close: 0, + mockedRead: 0, + mockedClose: 0, + }; + + const proto = { + read: function () { + calls.read++; + }, + close: function () { + calls.close++; + }, + }; + + const mockedBinding = { + read: function () { + assert.strictEqual(this, mockedBinding); + calls.mockedRead++; + }, + close: function () { + assert.strictEqual(this, mockedBinding); + calls.mockedClose++; + }, + }; + + patchReadFileContext(proto); + + const target = Object.create(proto); + + assert.deepEqual(calls, { + read: 0, + close: 0, + mockedRead: 0, + mockedClose: 0, + }); + + target.read(); + assert.deepEqual(calls, { + read: 1, + close: 0, + mockedRead: 0, + mockedClose: 0, + }); + target.close(); + assert.deepEqual(calls, { + read: 1, + close: 1, + mockedRead: 0, + mockedClose: 0, + }); + + proto._mockedBinding = mockedBinding; + target.read(); + assert.deepEqual(calls, { + read: 1, + close: 1, + mockedRead: 1, + mockedClose: 0, + }); + target.close(); + assert.deepEqual(calls, { + read: 1, + close: 1, + mockedRead: 1, + mockedClose: 1, + }); + + delete proto._mockedBinding; + target.read(); + assert.deepEqual(calls, { + read: 2, + close: 1, + mockedRead: 1, + mockedClose: 1, + }); + target.close(); + assert.deepEqual(calls, { + read: 2, + close: 2, + mockedRead: 1, + mockedClose: 1, + }); + }); +}); + +describe('fs.readFile() with ReadFileContext', function () { + // fs.readFile() is already tested elsewhere, here we just make sure we have + // coverage of the mocked ReadFileContext implementation. + + beforeEach(function () { + mock({ + 'path/to/file.txt': 'file content', + 1: 'fd content', + }); + }); + afterEach(mock.restore); + + inVersion('>=15.0.0').it('allows file reads to be aborted', function (done) { + const controller = new AbortController(); + const {signal} = controller; + + fs.readFile('path/to/file.txt', {signal}, function (err) { + assert.instanceOf(err, Error); + assert.equal(err.name, 'AbortError'); + assert.equal(err.code, 'ABORT_ERR'); + done(); + }); + + // By aborting after the call it will be handled by the context rather than readFile() + controller.abort(); + }); + + it('allows file reads with a numeric descriptor', function (done) { + // This isn't actually supported by mock-fs, but let's make sure the call goes through + // It also covers the case of reading an empty file and reading with encoding + fs.readFile(1, 'utf-8', function (err, data) { + assert.isNull(err); + assert.equal(data, ''); + done(); + }); + }); + + it('allows file reads with unknown size', function (done) { + mock({ + 'unknown-size.txt': function () { + const file = mock.file({ + content: Buffer.from('unknown size'), + })(); + + // Override getStats to drop the S_IFREG flag + const origGetStats = file.getStats; + file.getStats = function () { + const stats = origGetStats.apply(this, arguments); + stats[1] ^= constants.S_IFREG; + return stats; + }; + return file; + }, + }); + + fs.readFile('unknown-size.txt', 'utf-8', function (err, data) { + assert.isNull(err); + assert.equal(data, 'unknown size'); + done(); + }); + }); +});