From 0b7b999bec9e7e001c472345479e2d9cb955cbca Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Tue, 25 Apr 2023 21:24:10 -0700 Subject: [PATCH] Version 5 refactor (#31) Changes include: ### Major, breaking changes * _Callback signature has been removed._ Only Promise based interface now. * _No more default export._ Only named export `getUri()` is available now. * Minimum Node.js version is now 14.x. * The `ftp://` protocol has been switched from `ftp` to [`basic-ftp`](https://www.npmjs.com/package/basic-ftp) module. * Closes #16 * Closes #18 ### Minor changes * Proper options typings are now inferred based on the protocol of the URI provided to `getUri()`. For example: `getUri('ftp://...')` will have `FtpOptions` as the second parameter implicitly. * A `URL` instance can now be provided as the first argument to `getUri()`. ### Misc * Use pnpm for GH Actions. * Use Jest for tests. * Refactor tests to TypeScript. --- .github/workflows/test.yml | 32 +- README.md | 75 +- jest.config.js | 6 + package.json | 33 +- pnpm-lock.yaml | 2513 ++++++++++++++++++++++++++++++++++++ src/data.ts | 17 +- src/file.ts | 33 +- src/ftp.ts | 98 +- src/http-error.ts | 5 +- src/http.ts | 55 +- src/https.ts | 16 +- src/index.ts | 124 +- src/notfound.ts | 1 - src/notmodified.ts | 1 - test/data.js | 49 - test/data.test.ts | 31 + test/file.js | 61 - test/file.test.ts | 33 + test/ftp.js | 91 -- test/ftp.test.ts | 77 ++ test/http.js | 70 - test/http.test.ts | 56 + test/https.js | 77 -- test/https.test.ts | 67 + test/redirect.js | 110 -- test/redirect.test.ts | 80 ++ test/test.js | 24 - test/test.test.ts | 23 + test/tsconfig.json | 4 + test/util.ts | 9 + tsconfig.json | 2 +- 31 files changed, 3097 insertions(+), 776 deletions(-) create mode 100644 jest.config.js create mode 100644 pnpm-lock.yaml delete mode 100644 test/data.js create mode 100644 test/data.test.ts delete mode 100644 test/file.js create mode 100644 test/file.test.ts delete mode 100644 test/ftp.js create mode 100644 test/ftp.test.ts delete mode 100644 test/http.js create mode 100644 test/http.test.ts delete mode 100644 test/https.js create mode 100644 test/https.test.ts delete mode 100644 test/redirect.js create mode 100644 test/redirect.test.ts delete mode 100644 test/test.js create mode 100644 test/test.test.ts create mode 100644 test/tsconfig.json create mode 100644 test/util.ts diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5d3a6e0..ec0fe6d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,32 +9,20 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - node-version: [8.x, 10.x, 12.x, 14.x] + node-version: [14.x, 16.x, 18.x, 20.x] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v1 - + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + with: + version: 7.32.2 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - - name: Print Node.js Version - run: node --version - - - name: Install Dependencies - run: npm install - env: - CI: true - - - name: Run "build" step - run: npm run build --if-present - env: - CI: true - - - name: Run tests - run: npm test - env: - CI: true + cache: 'pnpm' + - run: pnpm install --frozen-lockfile + - run: pnpm build + - run: pnpm test diff --git a/README.md b/README.md index f7011ca..69e29bb 100644 --- a/README.md +++ b/README.md @@ -31,14 +31,12 @@ Example To simply get a `stream.Readable` instance from a `file:` URI, try something like: -``` js -var getUri = require('get-uri'); +```ts +import { getUri } from 'get-uri'; // `file:` maps to a `fs.ReadStream` instance… -getUri('file:///Users/nrajlich/wat.json', function (err, rs) { - if (err) throw err; - rs.pipe(process.stdout); -}); +const stream = await getUri('file:///Users/nrajlich/wat.json'); +stream.pipe(process.stdout); ``` @@ -50,19 +48,17 @@ destination server, then a `NotFoundError` will be returned. The `code` of the error instance is set to `"ENOTFOUND"`, so you can special-case that in your code to detect when a bad filename is requested: -``` js -getUri('http://example.com/resource.json', function (err, rs) { - if (err) { - if ('ENOTFOUND' == err.code) { - // bad file path requested - } else { - // something else bad happened... - throw err; - } +```ts +try { + await getUri('http://example.com/resource.json'); +} catch (err) { + if (err.code === 'ENOTFOUND') { + // bad file path requested + } else { + // something else bad happened... + throw err; } - - // your app code… -}); +} ``` @@ -83,47 +79,40 @@ When the `"ENOTMODIFIED"` error occurs, then you can safely re-use the results from the previous `getUri()` call for that same URI: ``` js -// maps to a `fs.ReadStream` instance -getUri('http://example.com/resource.json', function (err, rs) { - if (err) throw err; +// First time fetches for real +const stream = await getUri('http://example.com/resource.json'); +try { // … some time later, if you need to get this same URI again, pass in the // previous `stream.Readable` instance as `cache` option to potentially - // receive an "ENOTMODIFIED" response: - var opts = { cache: rs }; - getUri('http://example.com/resource.json', opts, function (err, rs2) { - if (err) { - if ('ENOTFOUND' == err.code) { - // bad file path requested - } else if ('ENOTMODIFIED' == err.code) { - // source file has not been modified since last time it was requested, - // so `rs2` is undefined and you are expected to re-use results from - // a previous call to `getUri()` - } else { - // something else bad happened... - throw err; - } - } - }); -}); + // have an "ENOTMODIFIED" error thrown: + await getUri('http://example.com/resource.json', { cache: stream }); +} catch (err) { + if (err.code === 'ENOTMODIFIED') { + // source file has not been modified since last time it was requested, + // so you are expected to re-use results from a previous call to `getUri()` + } else { + // something else bad happened... + throw err; + } +} ``` API --- -### getUri(String uri[, Object options,] Function callback) +### getUri(uri: string | URL, options?: Object]): Promise -A `uri` String is required. An optional `options` object may be passed in: +A `uri` is required. An optional `options` object may be passed in: - - `cache` - A `stream.Readable` instance from a previous call to `getUri()` with the same URI. If this option is passed in, and the destination endpoint has not been modified, then an `ENOTMODIFIED` error is returned + - `cache` - A `stream.Readable` instance from a previous call to `getUri()` with the same URI. If this option is passed in, and the destination endpoint has not been modified, then an `ENOTMODIFIED` error is thrown Any other options passed in to the `options` object will be passed through to the low-level connection creation functions (`http.get()`, `ftp.connect()`, etc). -Invokes the given `callback` function with a `stream.Readable` instance to -read the resource at the given `uri`. +Returns a `stream.Readable` instance to read the resource at the given `uri`. License ------- diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..454633f --- /dev/null +++ b/jest.config.js @@ -0,0 +1,6 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', +}; + diff --git a/package.json b/package.json index 908e7ce..73d20d2 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "scripts": { "prebuild": "rimraf dist", "build": "tsc", - "test": "mocha --reporter spec", + "test": "jest", "prepublishOnly": "npm run build" }, "repository": { @@ -37,26 +37,27 @@ "url": "https://github.com/TooTallNate/node-get-uri/issues" }, "devDependencies": { - "@types/debug": "4", - "@types/fs-extra": "^8.0.1", - "@types/ftp": "^0.3.30", - "@types/node": "^12.12.11", + "@types/debug": "^4.1.7", + "@types/fs-extra": "^8.1.2", + "@types/ftpd": "^0.2.35", + "@types/jest": "^29.5.1", + "@types/node": "^14.18.43", + "async-listen": "^2.1.0", "ftpd": "https://files-jg1s1zt9l.n8.io/ftpd-v0.2.14.tgz", - "mocha": "^6.2.2", - "rimraf": "^3.0.0", + "jest": "^29.5.0", + "rimraf": "^3.0.2", "st": "^1.2.2", - "stream-to-array": "2", - "typescript": "^4.4.3" + "ts-jest": "^29.1.0", + "typescript": "^4.9.5" }, "dependencies": { - "@tootallnate/once": "2", - "data-uri-to-buffer": "3", - "debug": "4", - "file-uri-to-path": "2", - "fs-extra": "^8.1.0", - "ftp": "^0.3.10" + "@tootallnate/once": "^2.0.0", + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^3.0.1", + "debug": "^4.3.4", + "fs-extra": "^8.1.0" }, "engines": { - "node": ">= 8" + "node": ">= 14" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..ad20793 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,2513 @@ +lockfileVersion: '6.0' + +dependencies: + '@tootallnate/once': + specifier: ^2.0.0 + version: 2.0.0 + basic-ftp: + specifier: ^5.0.2 + version: 5.0.2 + data-uri-to-buffer: + specifier: ^3.0.1 + version: 3.0.1 + debug: + specifier: ^4.3.4 + version: 4.3.4 + fs-extra: + specifier: ^8.1.0 + version: 8.1.0 + +devDependencies: + '@types/debug': + specifier: ^4.1.7 + version: 4.1.7 + '@types/fs-extra': + specifier: ^8.1.2 + version: 8.1.2 + '@types/ftpd': + specifier: ^0.2.35 + version: 0.2.35 + '@types/jest': + specifier: ^29.5.1 + version: 29.5.1 + '@types/node': + specifier: ^14.18.43 + version: 14.18.43 + async-listen: + specifier: ^2.1.0 + version: 2.1.0 + ftpd: + specifier: https://files-jg1s1zt9l.n8.io/ftpd-v0.2.14.tgz + version: '@files-jg1s1zt9l.n8.io/ftpd-v0.2.14.tgz' + jest: + specifier: ^29.5.0 + version: 29.5.0(@types/node@14.18.43) + rimraf: + specifier: ^3.0.2 + version: 3.0.2 + st: + specifier: ^1.2.2 + version: 1.2.2 + ts-jest: + specifier: ^29.1.0 + version: 29.1.0(@babel/core@7.21.4)(jest@29.5.0)(typescript@4.9.5) + typescript: + specifier: ^4.9.5 + version: 4.9.5 + +packages: + + /@ampproject/remapping@2.2.1: + resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.18 + dev: true + + /@babel/code-frame@7.21.4: + resolution: {integrity: sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.18.6 + dev: true + + /@babel/compat-data@7.21.4: + resolution: {integrity: sha512-/DYyDpeCfaVinT40FPGdkkb+lYSKvsVuMjDAG7jPOWWiM1ibOaB9CXJAlc4d1QpP/U2q2P9jbrSlClKSErd55g==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/core@7.21.4: + resolution: {integrity: sha512-qt/YV149Jman/6AfmlxJ04LMIu8bMoyl3RB91yTFrxQmgbrSvQMy7cI8Q62FHx1t8wJ8B5fu0UDoLwHAhUo1QA==} + engines: {node: '>=6.9.0'} + dependencies: + '@ampproject/remapping': 2.2.1 + '@babel/code-frame': 7.21.4 + '@babel/generator': 7.21.4 + '@babel/helper-compilation-targets': 7.21.4(@babel/core@7.21.4) + '@babel/helper-module-transforms': 7.21.2 + '@babel/helpers': 7.21.0 + '@babel/parser': 7.21.4 + '@babel/template': 7.20.7 + '@babel/traverse': 7.21.4 + '@babel/types': 7.21.4 + convert-source-map: 1.9.0 + debug: 4.3.4 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/generator@7.21.4: + resolution: {integrity: sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.4 + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.18 + jsesc: 2.5.2 + dev: true + + /@babel/helper-compilation-targets@7.21.4(@babel/core@7.21.4): + resolution: {integrity: sha512-Fa0tTuOXZ1iL8IeDFUWCzjZcn+sJGd9RZdH9esYVjEejGmzf+FFYQpMi/kZUk2kPy/q1H3/GPw7np8qar/stfg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/compat-data': 7.21.4 + '@babel/core': 7.21.4 + '@babel/helper-validator-option': 7.21.0 + browserslist: 4.21.5 + lru-cache: 5.1.1 + semver: 6.3.0 + dev: true + + /@babel/helper-environment-visitor@7.18.9: + resolution: {integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-function-name@7.21.0: + resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.20.7 + '@babel/types': 7.21.4 + dev: true + + /@babel/helper-hoist-variables@7.18.6: + resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.4 + dev: true + + /@babel/helper-module-imports@7.21.4: + resolution: {integrity: sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.4 + dev: true + + /@babel/helper-module-transforms@7.21.2: + resolution: {integrity: sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-module-imports': 7.21.4 + '@babel/helper-simple-access': 7.20.2 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 + '@babel/template': 7.20.7 + '@babel/traverse': 7.21.4 + '@babel/types': 7.21.4 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-plugin-utils@7.20.2: + resolution: {integrity: sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-simple-access@7.20.2: + resolution: {integrity: sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.4 + dev: true + + /@babel/helper-split-export-declaration@7.18.6: + resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.21.4 + dev: true + + /@babel/helper-string-parser@7.19.4: + resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-validator-identifier@7.19.1: + resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-validator-option@7.21.0: + resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helpers@7.21.0: + resolution: {integrity: sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.20.7 + '@babel/traverse': 7.21.4 + '@babel/types': 7.21.4 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/highlight@7.18.6: + resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.19.1 + chalk: 2.4.2 + js-tokens: 4.0.0 + dev: true + + /@babel/parser@7.21.4: + resolution: {integrity: sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.21.4 + dev: true + + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.21.4): + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.21.4): + resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.21.4): + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.21.4): + resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.21.4): + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-jsx@7.21.4(@babel/core@7.21.4): + resolution: {integrity: sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.21.4): + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.21.4): + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.21.4): + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.21.4): + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.21.4): + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.21.4): + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.21.4): + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-typescript@7.21.4(@babel/core@7.21.4): + resolution: {integrity: sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.21.4 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/template@7.20.7: + resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.21.4 + '@babel/parser': 7.21.4 + '@babel/types': 7.21.4 + dev: true + + /@babel/traverse@7.21.4: + resolution: {integrity: sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.21.4 + '@babel/generator': 7.21.4 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.21.0 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/parser': 7.21.4 + '@babel/types': 7.21.4 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/types@7.21.4: + resolution: {integrity: sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.19.4 + '@babel/helper-validator-identifier': 7.19.1 + to-fast-properties: 2.0.0 + dev: true + + /@bcoe/v8-coverage@0.2.3: + resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + dev: true + + /@istanbuljs/load-nyc-config@1.1.0: + resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} + engines: {node: '>=8'} + dependencies: + camelcase: 5.3.1 + find-up: 4.1.0 + get-package-type: 0.1.0 + js-yaml: 3.14.1 + resolve-from: 5.0.0 + dev: true + + /@istanbuljs/schema@0.1.3: + resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} + engines: {node: '>=8'} + dev: true + + /@jest/console@29.5.0: + resolution: {integrity: sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.5.0 + '@types/node': 14.18.43 + chalk: 4.1.2 + jest-message-util: 29.5.0 + jest-util: 29.5.0 + slash: 3.0.0 + dev: true + + /@jest/core@29.5.0: + resolution: {integrity: sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/console': 29.5.0 + '@jest/reporters': 29.5.0 + '@jest/test-result': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 14.18.43 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.8.0 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-changed-files: 29.5.0 + jest-config: 29.5.0(@types/node@14.18.43) + jest-haste-map: 29.5.0 + jest-message-util: 29.5.0 + jest-regex-util: 29.4.3 + jest-resolve: 29.5.0 + jest-resolve-dependencies: 29.5.0 + jest-runner: 29.5.0 + jest-runtime: 29.5.0 + jest-snapshot: 29.5.0 + jest-util: 29.5.0 + jest-validate: 29.5.0 + jest-watcher: 29.5.0 + micromatch: 4.0.5 + pretty-format: 29.5.0 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + + /@jest/environment@29.5.0: + resolution: {integrity: sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/fake-timers': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 14.18.43 + jest-mock: 29.5.0 + dev: true + + /@jest/expect-utils@29.5.0: + resolution: {integrity: sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-get-type: 29.4.3 + dev: true + + /@jest/expect@29.5.0: + resolution: {integrity: sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + expect: 29.5.0 + jest-snapshot: 29.5.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@jest/fake-timers@29.5.0: + resolution: {integrity: sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.5.0 + '@sinonjs/fake-timers': 10.0.2 + '@types/node': 14.18.43 + jest-message-util: 29.5.0 + jest-mock: 29.5.0 + jest-util: 29.5.0 + dev: true + + /@jest/globals@29.5.0: + resolution: {integrity: sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.5.0 + '@jest/expect': 29.5.0 + '@jest/types': 29.5.0 + jest-mock: 29.5.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@jest/reporters@29.5.0: + resolution: {integrity: sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@bcoe/v8-coverage': 0.2.3 + '@jest/console': 29.5.0 + '@jest/test-result': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 + '@jridgewell/trace-mapping': 0.3.18 + '@types/node': 14.18.43 + chalk: 4.1.2 + collect-v8-coverage: 1.0.1 + exit: 0.1.2 + glob: 7.2.3 + graceful-fs: 4.2.11 + istanbul-lib-coverage: 3.2.0 + istanbul-lib-instrument: 5.2.1 + istanbul-lib-report: 3.0.0 + istanbul-lib-source-maps: 4.0.1 + istanbul-reports: 3.1.5 + jest-message-util: 29.5.0 + jest-util: 29.5.0 + jest-worker: 29.5.0 + slash: 3.0.0 + string-length: 4.0.2 + strip-ansi: 6.0.1 + v8-to-istanbul: 9.1.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@jest/schemas@29.4.3: + resolution: {integrity: sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@sinclair/typebox': 0.25.24 + dev: true + + /@jest/source-map@29.4.3: + resolution: {integrity: sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jridgewell/trace-mapping': 0.3.18 + callsites: 3.1.0 + graceful-fs: 4.2.11 + dev: true + + /@jest/test-result@29.5.0: + resolution: {integrity: sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/console': 29.5.0 + '@jest/types': 29.5.0 + '@types/istanbul-lib-coverage': 2.0.4 + collect-v8-coverage: 1.0.1 + dev: true + + /@jest/test-sequencer@29.5.0: + resolution: {integrity: sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/test-result': 29.5.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.5.0 + slash: 3.0.0 + dev: true + + /@jest/transform@29.5.0: + resolution: {integrity: sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/core': 7.21.4 + '@jest/types': 29.5.0 + '@jridgewell/trace-mapping': 0.3.18 + babel-plugin-istanbul: 6.1.1 + chalk: 4.1.2 + convert-source-map: 2.0.0 + fast-json-stable-stringify: 2.1.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.5.0 + jest-regex-util: 29.4.3 + jest-util: 29.5.0 + micromatch: 4.0.5 + pirates: 4.0.5 + slash: 3.0.0 + write-file-atomic: 4.0.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@jest/types@29.5.0: + resolution: {integrity: sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.4.3 + '@types/istanbul-lib-coverage': 2.0.4 + '@types/istanbul-reports': 3.0.1 + '@types/node': 14.18.43 + '@types/yargs': 17.0.24 + chalk: 4.1.2 + dev: true + + /@jridgewell/gen-mapping@0.3.3: + resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.18 + dev: true + + /@jridgewell/resolve-uri@3.1.0: + resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/set-array@1.1.2: + resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/sourcemap-codec@1.4.14: + resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + dev: true + + /@jridgewell/sourcemap-codec@1.4.15: + resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + dev: true + + /@jridgewell/trace-mapping@0.3.18: + resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} + dependencies: + '@jridgewell/resolve-uri': 3.1.0 + '@jridgewell/sourcemap-codec': 1.4.14 + dev: true + + /@sinclair/typebox@0.25.24: + resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==} + dev: true + + /@sinonjs/commons@2.0.0: + resolution: {integrity: sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==} + dependencies: + type-detect: 4.0.8 + dev: true + + /@sinonjs/fake-timers@10.0.2: + resolution: {integrity: sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==} + dependencies: + '@sinonjs/commons': 2.0.0 + dev: true + + /@tootallnate/once@2.0.0: + resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} + engines: {node: '>= 10'} + dev: false + + /@types/babel__core@7.20.0: + resolution: {integrity: sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==} + dependencies: + '@babel/parser': 7.21.4 + '@babel/types': 7.21.4 + '@types/babel__generator': 7.6.4 + '@types/babel__template': 7.4.1 + '@types/babel__traverse': 7.18.4 + dev: true + + /@types/babel__generator@7.6.4: + resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} + dependencies: + '@babel/types': 7.21.4 + dev: true + + /@types/babel__template@7.4.1: + resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} + dependencies: + '@babel/parser': 7.21.4 + '@babel/types': 7.21.4 + dev: true + + /@types/babel__traverse@7.18.4: + resolution: {integrity: sha512-TLG7CsGZZmX9aDF78UuJxnNTfQyRUFU0OYIVyIblr0/wd/HvsIo8wmuB90CszeD2MtLLAE9Tt4cWvk+KVkyGIw==} + dependencies: + '@babel/types': 7.21.4 + dev: true + + /@types/debug@4.1.7: + resolution: {integrity: sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==} + dependencies: + '@types/ms': 0.7.31 + dev: true + + /@types/fs-extra@8.1.2: + resolution: {integrity: sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==} + dependencies: + '@types/node': 14.18.43 + dev: true + + /@types/ftpd@0.2.35: + resolution: {integrity: sha512-MeD8k0cx6wsmN84+59ex+2NCa0x5TgspdYWSDr91TWFutR4xITXD3ElExPvWJYmvS+HEvi1qiFc60NI5QKIVFQ==} + dependencies: + '@types/node': 14.18.43 + dev: true + + /@types/graceful-fs@4.1.6: + resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==} + dependencies: + '@types/node': 14.18.43 + dev: true + + /@types/istanbul-lib-coverage@2.0.4: + resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} + dev: true + + /@types/istanbul-lib-report@3.0.0: + resolution: {integrity: sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==} + dependencies: + '@types/istanbul-lib-coverage': 2.0.4 + dev: true + + /@types/istanbul-reports@3.0.1: + resolution: {integrity: sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==} + dependencies: + '@types/istanbul-lib-report': 3.0.0 + dev: true + + /@types/jest@29.5.1: + resolution: {integrity: sha512-tEuVcHrpaixS36w7hpsfLBLpjtMRJUE09/MHXn923LOVojDwyC14cWcfc0rDs0VEfUyYmt/+iX1kxxp+gZMcaQ==} + dependencies: + expect: 29.5.0 + pretty-format: 29.5.0 + dev: true + + /@types/ms@0.7.31: + resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==} + dev: true + + /@types/node@14.18.43: + resolution: {integrity: sha512-n3eFEaoem0WNwLux+k272P0+aq++5o05bA9CfiwKPdYPB5ZambWKdWoeHy7/OJiizMhzg27NLaZ6uzjLTzXceQ==} + dev: true + + /@types/prettier@2.7.2: + resolution: {integrity: sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==} + dev: true + + /@types/stack-utils@2.0.1: + resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} + dev: true + + /@types/yargs-parser@21.0.0: + resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} + dev: true + + /@types/yargs@17.0.24: + resolution: {integrity: sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==} + dependencies: + '@types/yargs-parser': 21.0.0 + dev: true + + /ansi-escapes@4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.21.3 + dev: true + + /ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: true + + /ansi-styles@3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + dependencies: + color-convert: 1.9.3 + dev: true + + /ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + + /ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + dev: true + + /anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + dev: true + + /argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + dependencies: + sprintf-js: 1.0.3 + dev: true + + /async-cache@1.1.0: + resolution: {integrity: sha512-YDQc4vBn5NFhY6g6HhVshyi3Fy9+SQ5ePnE7JLDJn1DoL+i7ER+vMwtTNOYk9leZkYMnOwpBCWqyLDPw8Aig8g==} + deprecated: No longer maintained. Use [lru-cache](http://npm.im/lru-cache) version 7.6 or higher, and provide an asynchronous `fetchMethod` option. + dependencies: + lru-cache: 4.1.5 + dev: true + + /async-listen@2.1.0: + resolution: {integrity: sha512-ckf3odtO729FoKt0KKuNA06VaWrsLQ/x8h2rnehC9mRi+vOvGSSjEnsJwT/Ttfhwe5GUp+Y/vBJhAYFiBN/Bnw==} + engines: {node: '>= 14'} + dev: true + + /babel-jest@29.5.0(@babel/core@7.21.4): + resolution: {integrity: sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.8.0 + dependencies: + '@babel/core': 7.21.4 + '@jest/transform': 29.5.0 + '@types/babel__core': 7.20.0 + babel-plugin-istanbul: 6.1.1 + babel-preset-jest: 29.5.0(@babel/core@7.21.4) + chalk: 4.1.2 + graceful-fs: 4.2.11 + slash: 3.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-istanbul@6.1.1: + resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} + engines: {node: '>=8'} + dependencies: + '@babel/helper-plugin-utils': 7.20.2 + '@istanbuljs/load-nyc-config': 1.1.0 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-instrument: 5.2.1 + test-exclude: 6.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-jest-hoist@29.5.0: + resolution: {integrity: sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/template': 7.20.7 + '@babel/types': 7.21.4 + '@types/babel__core': 7.20.0 + '@types/babel__traverse': 7.18.4 + dev: true + + /babel-preset-current-node-syntax@1.0.1(@babel/core@7.21.4): + resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.21.4 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.21.4) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.21.4) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.21.4) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.21.4) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.21.4) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.21.4) + dev: true + + /babel-preset-jest@29.5.0(@babel/core@7.21.4): + resolution: {integrity: sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.21.4 + babel-plugin-jest-hoist: 29.5.0 + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.21.4) + dev: true + + /balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true + + /basic-ftp@5.0.2: + resolution: {integrity: sha512-NgkBwqp7rkhIUBaxLwL601lvUuBUvShJocrLYdiyTsH1WeP/wofMdooZ4p6hz+4hqiU59PBOj0EkaqELwFJLuQ==} + engines: {node: '>=10.0.0'} + dev: false + + /bl@1.2.3: + resolution: {integrity: sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==} + dependencies: + readable-stream: 2.3.8 + safe-buffer: 5.2.1 + dev: true + + /brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + + /braces@3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: true + + /browserslist@4.21.5: + resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + dependencies: + caniuse-lite: 1.0.30001481 + electron-to-chromium: 1.4.372 + node-releases: 2.0.10 + update-browserslist-db: 1.0.11(browserslist@4.21.5) + dev: true + + /bs-logger@0.2.6: + resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} + engines: {node: '>= 6'} + dependencies: + fast-json-stable-stringify: 2.1.0 + dev: true + + /bser@2.1.1: + resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} + dependencies: + node-int64: 0.4.0 + dev: true + + /buffer-from@1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + dev: true + + /callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + dev: true + + /camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + dev: true + + /camelcase@6.3.0: + resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} + engines: {node: '>=10'} + dev: true + + /caniuse-lite@1.0.30001481: + resolution: {integrity: sha512-KCqHwRnaa1InZBtqXzP98LPg0ajCVujMKjqKDhZEthIpAsJl/YEIa3YvXjGXPVqzZVguccuu7ga9KOE1J9rKPQ==} + dev: true + + /chalk@2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + dev: true + + /chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + + /char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + dev: true + + /ci-info@3.8.0: + resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==} + engines: {node: '>=8'} + dev: true + + /cjs-module-lexer@1.2.2: + resolution: {integrity: sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==} + dev: true + + /cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + + /co@4.6.0: + resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} + engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + dev: true + + /collect-v8-coverage@1.0.1: + resolution: {integrity: sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==} + dev: true + + /color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + dependencies: + color-name: 1.1.3 + dev: true + + /color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + + /color-name@1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + dev: true + + /color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + + /concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true + + /convert-source-map@1.9.0: + resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} + dev: true + + /convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + dev: true + + /core-util-is@1.0.3: + resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + dev: true + + /cross-spawn@7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + + /data-uri-to-buffer@3.0.1: + resolution: {integrity: sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==} + engines: {node: '>= 6'} + dev: false + + /dateformat@1.0.7-1.2.3: + resolution: {integrity: sha512-rzAoghPcnojOgYhvqb9ZYR5Ws9hDM2SGB6xLSUX9pEAKYnbxyexHZypDLgx3+SF3SR+at6waVRCxKDm6q2Z6+g==} + dev: true + + /debug@4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + + /dedent@0.7.0: + resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} + dev: true + + /deepmerge@4.3.1: + resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} + engines: {node: '>=0.10.0'} + dev: true + + /detect-newline@3.1.0: + resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} + engines: {node: '>=8'} + dev: true + + /diff-sequences@29.4.3: + resolution: {integrity: sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + + /electron-to-chromium@1.4.372: + resolution: {integrity: sha512-MrlFq/j+TYHOjeWsWGYfzevc25HNeJdsF6qaLFrqBTRWZQtWkb1myq/Q2veLWezVaa5OcSZ99CFwTT4aF4Mung==} + dev: true + + /emittery@0.13.1: + resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} + engines: {node: '>=12'} + dev: true + + /emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true + + /error-ex@1.3.2: + resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + dependencies: + is-arrayish: 0.2.1 + dev: true + + /escalade@3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + engines: {node: '>=6'} + dev: true + + /escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + dev: true + + /escape-string-regexp@2.0.0: + resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + engines: {node: '>=8'} + dev: true + + /esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /execa@5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + dev: true + + /exit@0.1.2: + resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} + engines: {node: '>= 0.8.0'} + dev: true + + /expect@29.5.0: + resolution: {integrity: sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/expect-utils': 29.5.0 + jest-get-type: 29.4.3 + jest-matcher-utils: 29.5.0 + jest-message-util: 29.5.0 + jest-util: 29.5.0 + dev: true + + /fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + dev: true + + /fb-watchman@2.0.2: + resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + dependencies: + bser: 2.1.1 + dev: true + + /fd@0.0.3: + resolution: {integrity: sha512-iAHrIslQb3U68OcMSP0kkNWabp7sSN6d2TBSb2JO3gcLJVDd4owr/hKM4SFJovFOUeeXeItjYgouEDTMWiVAnA==} + dev: true + + /fill-range@7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true + + /find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + dev: true + + /fs-extra@8.1.0: + resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} + engines: {node: '>=6 <7 || >=8'} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + dev: false + + /fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true + + /fsevents@2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /function-bind@1.1.1: + resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: true + + /gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + dev: true + + /get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: true + + /get-package-type@0.1.0: + resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} + engines: {node: '>=8.0.0'} + dev: true + + /get-stream@6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + dev: true + + /glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /globals@11.12.0: + resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} + engines: {node: '>=4'} + dev: true + + /graceful-fs@4.1.15: + resolution: {integrity: sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==} + requiresBuild: true + dev: true + optional: true + + /graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + + /has-flag@3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + dev: true + + /has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: true + + /has@1.0.3: + resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} + engines: {node: '>= 0.4.0'} + dependencies: + function-bind: 1.1.1 + dev: true + + /html-escaper@2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + dev: true + + /human-signals@2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + dev: true + + /import-local@3.1.0: + resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} + engines: {node: '>=8'} + hasBin: true + dependencies: + pkg-dir: 4.2.0 + resolve-cwd: 3.0.0 + dev: true + + /imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + dev: true + + /inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + + /inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: true + + /is-arrayish@0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + dev: true + + /is-core-module@2.12.0: + resolution: {integrity: sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==} + dependencies: + has: 1.0.3 + dev: true + + /is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: true + + /is-generator-fn@2.1.0: + resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} + engines: {node: '>=6'} + dev: true + + /is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: true + + /is-stream@2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + dev: true + + /isarray@1.0.0: + resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} + dev: true + + /isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true + + /istanbul-lib-coverage@3.2.0: + resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} + engines: {node: '>=8'} + dev: true + + /istanbul-lib-instrument@5.2.1: + resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} + engines: {node: '>=8'} + dependencies: + '@babel/core': 7.21.4 + '@babel/parser': 7.21.4 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-coverage: 3.2.0 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /istanbul-lib-report@3.0.0: + resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==} + engines: {node: '>=8'} + dependencies: + istanbul-lib-coverage: 3.2.0 + make-dir: 3.1.0 + supports-color: 7.2.0 + dev: true + + /istanbul-lib-source-maps@4.0.1: + resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} + engines: {node: '>=10'} + dependencies: + debug: 4.3.4 + istanbul-lib-coverage: 3.2.0 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color + dev: true + + /istanbul-reports@3.1.5: + resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==} + engines: {node: '>=8'} + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.0 + dev: true + + /jest-changed-files@29.5.0: + resolution: {integrity: sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + execa: 5.1.1 + p-limit: 3.1.0 + dev: true + + /jest-circus@29.5.0: + resolution: {integrity: sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.5.0 + '@jest/expect': 29.5.0 + '@jest/test-result': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 14.18.43 + chalk: 4.1.2 + co: 4.6.0 + dedent: 0.7.0 + is-generator-fn: 2.1.0 + jest-each: 29.5.0 + jest-matcher-utils: 29.5.0 + jest-message-util: 29.5.0 + jest-runtime: 29.5.0 + jest-snapshot: 29.5.0 + jest-util: 29.5.0 + p-limit: 3.1.0 + pretty-format: 29.5.0 + pure-rand: 6.0.2 + slash: 3.0.0 + stack-utils: 2.0.6 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-cli@29.5.0(@types/node@14.18.43): + resolution: {integrity: sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 29.5.0 + '@jest/test-result': 29.5.0 + '@jest/types': 29.5.0 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + import-local: 3.1.0 + jest-config: 29.5.0(@types/node@14.18.43) + jest-util: 29.5.0 + jest-validate: 29.5.0 + prompts: 2.4.2 + yargs: 17.7.1 + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + + /jest-config@29.5.0(@types/node@14.18.43): + resolution: {integrity: sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + dependencies: + '@babel/core': 7.21.4 + '@jest/test-sequencer': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 14.18.43 + babel-jest: 29.5.0(@babel/core@7.21.4) + chalk: 4.1.2 + ci-info: 3.8.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.5.0 + jest-environment-node: 29.5.0 + jest-get-type: 29.4.3 + jest-regex-util: 29.4.3 + jest-resolve: 29.5.0 + jest-runner: 29.5.0 + jest-util: 29.5.0 + jest-validate: 29.5.0 + micromatch: 4.0.5 + parse-json: 5.2.0 + pretty-format: 29.5.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-diff@29.5.0: + resolution: {integrity: sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + diff-sequences: 29.4.3 + jest-get-type: 29.4.3 + pretty-format: 29.5.0 + dev: true + + /jest-docblock@29.4.3: + resolution: {integrity: sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + detect-newline: 3.1.0 + dev: true + + /jest-each@29.5.0: + resolution: {integrity: sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.5.0 + chalk: 4.1.2 + jest-get-type: 29.4.3 + jest-util: 29.5.0 + pretty-format: 29.5.0 + dev: true + + /jest-environment-node@29.5.0: + resolution: {integrity: sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.5.0 + '@jest/fake-timers': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 14.18.43 + jest-mock: 29.5.0 + jest-util: 29.5.0 + dev: true + + /jest-get-type@29.4.3: + resolution: {integrity: sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + + /jest-haste-map@29.5.0: + resolution: {integrity: sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.5.0 + '@types/graceful-fs': 4.1.6 + '@types/node': 14.18.43 + anymatch: 3.1.3 + fb-watchman: 2.0.2 + graceful-fs: 4.2.11 + jest-regex-util: 29.4.3 + jest-util: 29.5.0 + jest-worker: 29.5.0 + micromatch: 4.0.5 + walker: 1.0.8 + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /jest-leak-detector@29.5.0: + resolution: {integrity: sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-get-type: 29.4.3 + pretty-format: 29.5.0 + dev: true + + /jest-matcher-utils@29.5.0: + resolution: {integrity: sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + jest-diff: 29.5.0 + jest-get-type: 29.4.3 + pretty-format: 29.5.0 + dev: true + + /jest-message-util@29.5.0: + resolution: {integrity: sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/code-frame': 7.21.4 + '@jest/types': 29.5.0 + '@types/stack-utils': 2.0.1 + chalk: 4.1.2 + graceful-fs: 4.2.11 + micromatch: 4.0.5 + pretty-format: 29.5.0 + slash: 3.0.0 + stack-utils: 2.0.6 + dev: true + + /jest-mock@29.5.0: + resolution: {integrity: sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.5.0 + '@types/node': 14.18.43 + jest-util: 29.5.0 + dev: true + + /jest-pnp-resolver@1.2.3(jest-resolve@29.5.0): + resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} + engines: {node: '>=6'} + peerDependencies: + jest-resolve: '*' + peerDependenciesMeta: + jest-resolve: + optional: true + dependencies: + jest-resolve: 29.5.0 + dev: true + + /jest-regex-util@29.4.3: + resolution: {integrity: sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + + /jest-resolve-dependencies@29.5.0: + resolution: {integrity: sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-regex-util: 29.4.3 + jest-snapshot: 29.5.0 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-resolve@29.5.0: + resolution: {integrity: sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + graceful-fs: 4.2.11 + jest-haste-map: 29.5.0 + jest-pnp-resolver: 1.2.3(jest-resolve@29.5.0) + jest-util: 29.5.0 + jest-validate: 29.5.0 + resolve: 1.22.2 + resolve.exports: 2.0.2 + slash: 3.0.0 + dev: true + + /jest-runner@29.5.0: + resolution: {integrity: sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/console': 29.5.0 + '@jest/environment': 29.5.0 + '@jest/test-result': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 14.18.43 + chalk: 4.1.2 + emittery: 0.13.1 + graceful-fs: 4.2.11 + jest-docblock: 29.4.3 + jest-environment-node: 29.5.0 + jest-haste-map: 29.5.0 + jest-leak-detector: 29.5.0 + jest-message-util: 29.5.0 + jest-resolve: 29.5.0 + jest-runtime: 29.5.0 + jest-util: 29.5.0 + jest-watcher: 29.5.0 + jest-worker: 29.5.0 + p-limit: 3.1.0 + source-map-support: 0.5.13 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-runtime@29.5.0: + resolution: {integrity: sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.5.0 + '@jest/fake-timers': 29.5.0 + '@jest/globals': 29.5.0 + '@jest/source-map': 29.4.3 + '@jest/test-result': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 14.18.43 + chalk: 4.1.2 + cjs-module-lexer: 1.2.2 + collect-v8-coverage: 1.0.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-haste-map: 29.5.0 + jest-message-util: 29.5.0 + jest-mock: 29.5.0 + jest-regex-util: 29.4.3 + jest-resolve: 29.5.0 + jest-snapshot: 29.5.0 + jest-util: 29.5.0 + slash: 3.0.0 + strip-bom: 4.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-snapshot@29.5.0: + resolution: {integrity: sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/core': 7.21.4 + '@babel/generator': 7.21.4 + '@babel/plugin-syntax-jsx': 7.21.4(@babel/core@7.21.4) + '@babel/plugin-syntax-typescript': 7.21.4(@babel/core@7.21.4) + '@babel/traverse': 7.21.4 + '@babel/types': 7.21.4 + '@jest/expect-utils': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 + '@types/babel__traverse': 7.18.4 + '@types/prettier': 2.7.2 + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.21.4) + chalk: 4.1.2 + expect: 29.5.0 + graceful-fs: 4.2.11 + jest-diff: 29.5.0 + jest-get-type: 29.4.3 + jest-matcher-utils: 29.5.0 + jest-message-util: 29.5.0 + jest-util: 29.5.0 + natural-compare: 1.4.0 + pretty-format: 29.5.0 + semver: 7.5.0 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-util@29.5.0: + resolution: {integrity: sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.5.0 + '@types/node': 14.18.43 + chalk: 4.1.2 + ci-info: 3.8.0 + graceful-fs: 4.2.11 + picomatch: 2.3.1 + dev: true + + /jest-validate@29.5.0: + resolution: {integrity: sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.5.0 + camelcase: 6.3.0 + chalk: 4.1.2 + jest-get-type: 29.4.3 + leven: 3.1.0 + pretty-format: 29.5.0 + dev: true + + /jest-watcher@29.5.0: + resolution: {integrity: sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/test-result': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 14.18.43 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + emittery: 0.13.1 + jest-util: 29.5.0 + string-length: 4.0.2 + dev: true + + /jest-worker@29.5.0: + resolution: {integrity: sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@types/node': 14.18.43 + jest-util: 29.5.0 + merge-stream: 2.0.0 + supports-color: 8.1.1 + dev: true + + /jest@29.5.0(@types/node@14.18.43): + resolution: {integrity: sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 29.5.0 + '@jest/types': 29.5.0 + import-local: 3.1.0 + jest-cli: 29.5.0(@types/node@14.18.43) + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + + /js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + dev: true + + /js-yaml@3.14.1: + resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} + hasBin: true + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + dev: true + + /jsesc@2.5.2: + resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /json-parse-even-better-errors@2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + dev: true + + /json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + dev: true + + /jsonfile@4.0.0: + resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} + optionalDependencies: + graceful-fs: 4.2.11 + dev: false + + /kleur@3.0.3: + resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} + engines: {node: '>=6'} + dev: true + + /leven@3.1.0: + resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} + engines: {node: '>=6'} + dev: true + + /lines-and-columns@1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + dev: true + + /locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + dependencies: + p-locate: 4.1.0 + dev: true + + /lodash.memoize@4.1.2: + resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} + dev: true + + /lru-cache@4.1.5: + resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} + dependencies: + pseudomap: 1.0.2 + yallist: 2.1.2 + dev: true + + /lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + dependencies: + yallist: 3.1.1 + dev: true + + /lru-cache@6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + dependencies: + yallist: 4.0.0 + dev: true + + /make-dir@3.1.0: + resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} + engines: {node: '>=8'} + dependencies: + semver: 6.3.0 + dev: true + + /make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + dev: true + + /makeerror@1.0.12: + resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} + dependencies: + tmpl: 1.0.5 + dev: true + + /merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + dev: true + + /micromatch@4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: true + + /mime@1.4.1: + resolution: {integrity: sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==} + hasBin: true + dev: true + + /mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + dev: true + + /minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: true + + /ms@2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + + /natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + dev: true + + /negotiator@0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + dev: true + + /node-int64@0.4.0: + resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} + dev: true + + /node-releases@2.0.10: + resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==} + dev: true + + /normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + dev: true + + /npm-run-path@4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + dependencies: + path-key: 3.1.1 + dev: true + + /once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + dev: true + + /onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + dependencies: + mimic-fn: 2.1.0 + dev: true + + /p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + dependencies: + p-try: 2.2.0 + dev: true + + /p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + dependencies: + yocto-queue: 0.1.0 + dev: true + + /p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + dependencies: + p-limit: 2.3.0 + dev: true + + /p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + dev: true + + /parse-json@5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + dependencies: + '@babel/code-frame': 7.21.4 + error-ex: 1.3.2 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.2.4 + dev: true + + /path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: true + + /path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: true + + /path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + dev: true + + /path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + + /picocolors@1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: true + + /picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: true + + /pirates@4.0.5: + resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==} + engines: {node: '>= 6'} + dev: true + + /pkg-dir@4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} + dependencies: + find-up: 4.1.0 + dev: true + + /pretty-format@29.5.0: + resolution: {integrity: sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.4.3 + ansi-styles: 5.2.0 + react-is: 18.2.0 + dev: true + + /process-nextick-args@2.0.1: + resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + dev: true + + /prompts@2.4.2: + resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} + engines: {node: '>= 6'} + dependencies: + kleur: 3.0.3 + sisteransi: 1.0.5 + dev: true + + /pseudomap@1.0.2: + resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} + dev: true + + /pure-rand@6.0.2: + resolution: {integrity: sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==} + dev: true + + /react-is@18.2.0: + resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + dev: true + + /readable-stream@2.3.8: + resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 2.0.1 + safe-buffer: 5.1.2 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + dev: true + + /require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: true + + /resolve-cwd@3.0.0: + resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} + engines: {node: '>=8'} + dependencies: + resolve-from: 5.0.0 + dev: true + + /resolve-from@5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + dev: true + + /resolve.exports@2.0.2: + resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} + engines: {node: '>=10'} + dev: true + + /resolve@1.22.2: + resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} + hasBin: true + dependencies: + is-core-module: 2.12.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /rimraf@3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.2.3 + dev: true + + /safe-buffer@5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + dev: true + + /safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + dev: true + + /semver@6.3.0: + resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} + hasBin: true + dev: true + + /semver@7.5.0: + resolution: {integrity: sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + + /shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + dev: true + + /shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: true + + /signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + dev: true + + /sisteransi@1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + dev: true + + /slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + dev: true + + /source-map-support@0.5.13: + resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + dev: true + + /source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + dev: true + + /sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + dev: true + + /st@1.2.2: + resolution: {integrity: sha512-goKkumvz0BMLs6KjjPf5Fub/3T34tRVQxInUI5lqtbaKD+s4HcRlJYP2GPJ8RgAmrsnYOPGmOFEP6ho0KJ+E8g==} + hasBin: true + dependencies: + async-cache: 1.1.0 + bl: 1.2.3 + fd: 0.0.3 + mime: 1.4.1 + negotiator: 0.6.3 + optionalDependencies: + graceful-fs: 4.1.15 + dev: true + + /stack-utils@2.0.6: + resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} + engines: {node: '>=10'} + dependencies: + escape-string-regexp: 2.0.0 + dev: true + + /stat-mode@0.2.2: + resolution: {integrity: sha512-o+7DC0OM5Jt3+gratXXqfXf62V/CBoqQbT7Kp7jCxTYW2PLOB2/ZSGIfm9T5/QZe1Vw1MCbu6DoB6JnhVtxcJw==} + dev: true + + /string-length@4.0.2: + resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} + engines: {node: '>=10'} + dependencies: + char-regex: 1.0.2 + strip-ansi: 6.0.1 + dev: true + + /string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: true + + /string_decoder@1.1.1: + resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} + dependencies: + safe-buffer: 5.1.2 + dev: true + + /strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + dev: true + + /strip-bom@4.0.0: + resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} + engines: {node: '>=8'} + dev: true + + /strip-final-newline@2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + dev: true + + /strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + dev: true + + /supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + dependencies: + has-flag: 3.0.0 + dev: true + + /supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-color@8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true + + /test-exclude@6.0.0: + resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} + engines: {node: '>=8'} + dependencies: + '@istanbuljs/schema': 0.1.3 + glob: 7.2.3 + minimatch: 3.1.2 + dev: true + + /tmpl@1.0.5: + resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} + dev: true + + /to-fast-properties@2.0.0: + resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} + engines: {node: '>=4'} + dev: true + + /to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: true + + /ts-jest@29.1.0(@babel/core@7.21.4)(jest@29.5.0)(typescript@4.9.5): + resolution: {integrity: sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/types': ^29.0.0 + babel-jest: ^29.0.0 + esbuild: '*' + jest: ^29.0.0 + typescript: '>=4.3 <6' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + dependencies: + '@babel/core': 7.21.4 + bs-logger: 0.2.6 + fast-json-stable-stringify: 2.1.0 + jest: 29.5.0(@types/node@14.18.43) + jest-util: 29.5.0 + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.5.0 + typescript: 4.9.5 + yargs-parser: 21.1.1 + dev: true + + /type-detect@4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + dev: true + + /type-fest@0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + dev: true + + /typescript@4.9.5: + resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + + /universalify@0.1.2: + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} + engines: {node: '>= 4.0.0'} + dev: false + + /update-browserslist-db@1.0.11(browserslist@4.21.5): + resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.21.5 + escalade: 3.1.1 + picocolors: 1.0.0 + dev: true + + /util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + dev: true + + /v8-to-istanbul@9.1.0: + resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} + engines: {node: '>=10.12.0'} + dependencies: + '@jridgewell/trace-mapping': 0.3.18 + '@types/istanbul-lib-coverage': 2.0.4 + convert-source-map: 1.9.0 + dev: true + + /walker@1.0.8: + resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + dependencies: + makeerror: 1.0.12 + dev: true + + /which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true + + /write-file-atomic@4.0.2: + resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + imurmurhash: 0.1.4 + signal-exit: 3.0.7 + dev: true + + /y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true + + /yallist@2.1.2: + resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} + dev: true + + /yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + dev: true + + /yallist@4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + dev: true + + /yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: true + + /yargs@17.7.1: + resolution: {integrity: sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==} + engines: {node: '>=12'} + dependencies: + cliui: 8.0.1 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + dev: true + + /yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true + + '@files-jg1s1zt9l.n8.io/ftpd-v0.2.14.tgz': + resolution: {tarball: https://files-jg1s1zt9l.n8.io/ftpd-v0.2.14.tgz} + name: ftpd + version: 0.2.14 + engines: {node: '>=0.10.0'} + dependencies: + dateformat: 1.0.7-1.2.3 + stat-mode: 0.2.2 + dev: true diff --git a/src/data.ts b/src/data.ts index f88dafe..f4dbf1a 100644 --- a/src/data.ts +++ b/src/data.ts @@ -1,9 +1,8 @@ import createDebug from 'debug'; import { Readable } from 'stream'; import { createHash } from 'crypto'; -import { UrlWithStringQuery } from 'url'; import dataUriToBuffer from 'data-uri-to-buffer'; -import { GetUriOptions } from '.'; +import { GetUriProtocol } from './'; import NotModifiedError from './notmodified'; const debug = createDebug('get-uri:data'); @@ -19,17 +18,17 @@ class DataReadable extends Readable { } } -interface DataOptions extends GetUriOptions { +export interface DataOptions { cache?: DataReadable; } /** * Returns a Readable stream from a "data:" URI. */ -export default async function get( - { href: uri }: UrlWithStringQuery, - { cache }: DataOptions -): Promise { +export const data: GetUriProtocol = async ( + { href: uri }, + { cache } = {} +) => { // need to create a SHA1 hash of the URI string, for cacheability checks // in future `getUri()` calls with the same data URI passed in. const shasum = createHash('sha1'); @@ -38,7 +37,7 @@ export default async function get( debug('generated SHA1 hash for "data:" URI: %o', hash); // check if the cache is the same "data:" URI that was previously passed in. - if (cache && cache.hash === hash) { + if (cache?.hash === hash) { debug('got matching cache SHA1 hash: %o', hash); throw new NotModifiedError(); } else { @@ -46,4 +45,4 @@ export default async function get( const buf = dataUriToBuffer(uri); return new DataReadable(hash, buf); } -} +}; diff --git a/src/file.ts b/src/file.ts index 39e532c..4d6013f 100644 --- a/src/file.ts +++ b/src/file.ts @@ -1,46 +1,43 @@ import { Readable } from 'stream'; -import { UrlWithStringQuery } from 'url'; import createDebug from 'debug'; import { Stats, createReadStream } from 'fs'; import { fstat, open } from 'fs-extra'; -import uri2path from 'file-uri-to-path'; -import { GetUriOptions } from '.'; +import { GetUriProtocol } from './'; import NotFoundError from './notfound'; import NotModifiedError from './notmodified'; +import { fileURLToPath } from 'url'; const debug = createDebug('get-uri:file'); -type ReadStreamOptions = Exclude< - Parameters[1], - string +type ReadStreamOptions = NonNullable< + Exclude[1], string> >; interface FileReadable extends Readable { stat?: Stats; } -type FileOptions = GetUriOptions & - ReadStreamOptions & { - cache?: FileReadable; - }; +export interface FileOptions extends ReadStreamOptions { + cache?: FileReadable; +} /** * Returns a `fs.ReadStream` instance from a "file:" URI. */ -export default async function get( - { href: uri }: UrlWithStringQuery, - opts: FileOptions -): Promise { +export const file: GetUriProtocol = async ( + { href: uri }, + opts = {} +) => { const { cache, flags = 'r', - mode = 438 // =0666 + mode = 438, // =0666 } = opts; try { // Convert URI → Path - const filepath = uri2path(uri); + const filepath = fileURLToPath(uri); debug('Normalized pathname: %o', filepath); // `open()` first to get a file descriptor and ensure that the file @@ -62,7 +59,7 @@ export default async function get( const rs = createReadStream(null, { autoClose: true, ...opts, - fd + fd, }) as FileReadable; rs.stat = stat; return rs; @@ -72,7 +69,7 @@ export default async function get( } throw err; } -} +}; // returns `true` if the `mtime` of the 2 stat objects are equal function isNotModified(prev: Stats, curr: Stats): boolean { diff --git a/src/ftp.ts b/src/ftp.ts index ffd71db..2cda22a 100644 --- a/src/ftp.ts +++ b/src/ftp.ts @@ -1,72 +1,53 @@ -import once from '@tootallnate/once'; -import FTP, { ListingElement, Options } from 'ftp'; -import { Readable } from 'stream'; +import { Client, AccessOptions } from 'basic-ftp'; +import { PassThrough, Readable } from 'stream'; import { basename, dirname } from 'path'; -import { UrlWithStringQuery } from 'url'; import createDebug from 'debug'; -import { GetUriOptions } from '.'; import NotFoundError from './notfound'; import NotModifiedError from './notmodified'; +import { GetUriProtocol } from '.'; const debug = createDebug('get-uri:ftp'); -interface FTPReadable extends Readable { +export interface FTPReadable extends Readable { lastModified?: Date; } -interface FTPOptions extends GetUriOptions, Options { +export interface FTPOptions extends AccessOptions { cache?: FTPReadable; - debug?: (s: string) => void; } /** * Returns a Readable stream from an "ftp:" URI. */ -export default async function get( - parsed: UrlWithStringQuery, - opts: FTPOptions -): Promise { +export const ftp: GetUriProtocol = async (url, opts = {}) => { const { cache } = opts; - const filepath = parsed.pathname; - let lastModified: Date | null = null; + const filepath = url.pathname; + let lastModified: Date | undefined; if (!filepath) { throw new TypeError('No "pathname"!'); } - const client = new FTP(); - client.once('greeting', (greeting: string) => { - debug('FTP greeting: %o', greeting); - }); - - function onend() { - // close the FTP client socket connection - client.end(); - } + const client = new Client(); try { - opts.host = parsed.hostname || parsed.host || 'localhost'; - opts.port = parseInt(parsed.port || '0', 10) || 21; - opts.debug = debug; - - if (parsed.auth) { - const [user, password] = parsed.auth.split(':'); - opts.user = user; - opts.password = password; - } - - const readyPromise = once(client, 'ready'); - client.connect(opts); - await readyPromise; + const host = url.hostname || url.host || 'localhost'; + const port = parseInt(url.port || '0', 10) || 21; + const user = url.username || undefined; + const password = url.password || undefined; + + await client.access({ + host, + port, + user, + password, + ...opts, + }); // first we have to figure out the Last Modified date. // try the MDTM command first, which is an optional extension command. try { - lastModified = await new Promise((resolve, reject) => { - client.lastMod(filepath, (err, res) => { - return err ? reject(err) : resolve(res); - }); - }); + lastModified = await client.lastMod(filepath); } catch (err: any) { // handle the "file not found" error code if (err.code === 550) { @@ -77,19 +58,13 @@ export default async function get( if (!lastModified) { // Try to get the last modified date via the LIST command (uses // more bandwidth, but is more compatible with older FTP servers - const list = await new Promise( - (resolve, reject) => { - client.list(dirname(filepath), (err, res) => { - return err ? reject(err) : resolve(res); - }); - } - ); + const list = await client.list(dirname(filepath)); // attempt to find the "entry" with a matching "name" const name = basename(filepath); - const entry = list.find(e => e.name === name); + const entry = list.find((e) => e.name === name); if (entry) { - lastModified = entry.date; + lastModified = entry.modifiedAt; } } @@ -101,29 +76,24 @@ export default async function get( throw new NotFoundError(); } - // XXX: a small timeout seemed necessary otherwise FTP servers - // were returning empty sockets for the file occasionally - // setTimeout(client.get.bind(client, filepath, onfile), 10); - const rs = (await new Promise( - (resolve, reject) => { - client.get(filepath, (err, res) => { - return err ? reject(err) : resolve(res); - }); - } - )) as FTPReadable; - rs.once('end', onend); + const stream = new PassThrough(); + const rs = stream as FTPReadable; + client.downloadTo(stream, filepath).then((result) => { + debug(result.message); + client.close(); + }); rs.lastModified = lastModified; return rs; } catch (err) { - client.destroy(); + client.close(); throw err; } // called when `lastModified` is set, and a "cache" stream was provided function isNotModified(): boolean { - if (cache && cache.lastModified && lastModified) { + if (cache?.lastModified && lastModified) { return +cache.lastModified === +lastModified; } return false; } -} +}; diff --git a/src/http-error.ts b/src/http-error.ts index 55eea96..34fb235 100644 --- a/src/http-error.ts +++ b/src/http-error.ts @@ -9,10 +9,7 @@ export default class HTTPError extends Error { constructor(statusCode: number, message = STATUS_CODES[statusCode]) { super(message); - Object.setPrototypeOf(this, new.target.prototype); this.statusCode = statusCode; - this.code = `E${String(message) - .toUpperCase() - .replace(/\s+/g, '')}`; + this.code = `E${String(message).toUpperCase().replace(/\s+/g, '')}`; } } diff --git a/src/http.ts b/src/http.ts index 03260cd..ecfb2ed 100644 --- a/src/http.ts +++ b/src/http.ts @@ -1,31 +1,30 @@ -import http from 'http'; +import http_ from 'http'; import https from 'https'; import once from '@tootallnate/once'; import createDebug from 'debug'; import { Readable } from 'stream'; -import { UrlWithStringQuery, parse, resolve } from 'url'; -import { GetUriOptions } from '.'; +import { GetUriProtocol } from '.'; import HTTPError from './http-error'; import NotFoundError from './notfound'; import NotModifiedError from './notmodified'; const debug = createDebug('get-uri:http'); -type HttpOrHttpsModule = typeof http | typeof https; +type HttpOrHttpsModule = typeof http_ | typeof https; export interface HttpReadableProps { date?: number; - parsed?: UrlWithStringQuery; + parsed?: URL; redirects?: HttpReadable[]; } export interface HttpReadable extends Readable, HttpReadableProps {} export interface HttpIncomingMessage - extends http.IncomingMessage, + extends http_.IncomingMessage, HttpReadableProps {} -export interface HttpOptions extends GetUriOptions, https.RequestOptions { +export interface HttpOptions extends https.RequestOptions { cache?: HttpReadable; http?: HttpOrHttpsModule; redirects?: HttpReadable[]; @@ -35,13 +34,10 @@ export interface HttpOptions extends GetUriOptions, https.RequestOptions { /** * Returns a Readable stream from an "http:" URI. */ -export default async function get( - parsed: UrlWithStringQuery, - opts: HttpOptions -): Promise { - debug('GET %o', parsed.href); +export const http: GetUriProtocol = async (url, opts = {}) => { + debug('GET %o', url.href); - const cache = getCache(parsed, opts.cache); + const cache = getCache(url, opts.cache); // first check the previous Expires and/or Cache-Control headers // of a previous response if a `cache` was provided @@ -68,11 +64,11 @@ export default async function get( mod = opts.http; debug('using secure `https` core module'); } else { - mod = http; + mod = http_; debug('using `http` core module'); } - const options = { ...opts, ...parsed }; + const options = { ...opts }; // add "cache validation" headers if a `cache` was provided if (cache) { @@ -93,13 +89,13 @@ export default async function get( } } - const req = mod.get(options); + const req = mod.get(url, options); const [res]: [HttpIncomingMessage] = await once(req, 'response'); const code = res.statusCode || 0; // assign a Date to this response for the "Cache-Control" delta calculation res.date = Date.now(); - res.parsed = parsed; + res.parsed = url; debug('got %o response status code', code); @@ -121,19 +117,18 @@ export default async function get( // hang on to this Response object for the "redirects" Array redirects.push(res); - let newUri = resolve(parsed.href, location); - debug('resolved redirect URL: %o', newUri); + let newUri = new URL(location, url.href); + debug('resolved redirect URL: %o', newUri.href); let left = maxRedirects - redirects.length; debug('%o more redirects allowed after this one', left); // check if redirecting to a different protocol - let parsedUrl = parse(newUri); - if (parsedUrl.protocol !== parsed.protocol) { - opts.http = parsedUrl.protocol === 'https:' ? https : undefined; + if (newUri.protocol !== url.protocol) { + opts.http = newUri.protocol === 'https:' ? https : undefined; } - return get(parsedUrl, opts); + return http(newUri, opts); } } @@ -156,7 +151,7 @@ export default async function get( } return res; -} +}; /** * Returns `true` if the provided cache's "freshness" is valid. That is, either @@ -183,7 +178,8 @@ function isFresh(cache: HttpIncomingMessage): boolean { const name = subparts[0]; switch (name) { case 'max-age': - expires = (cache.date || 0) + parseInt(subparts[1], 10) * 1000; + expires = + (cache.date || 0) + parseInt(subparts[1], 10) * 1000; fresh = Date.now() < expires; if (fresh) { debug( @@ -227,17 +223,14 @@ function isFresh(cache: HttpIncomingMessage): boolean { * @api private */ -function getCache( - parsed: UrlWithStringQuery, - cache?: HttpReadable -): HttpIncomingMessage | null { +function getCache(url: URL, cache?: HttpReadable): HttpIncomingMessage | null { if (cache) { - if (cache.parsed && cache.parsed.href === parsed.href) { + if (cache.parsed && cache.parsed.href === url.href) { return cache as HttpIncomingMessage; } if (cache.redirects) { for (let i = 0; i < cache.redirects.length; i++) { - const c = getCache(parsed, cache.redirects[i]); + const c = getCache(url, cache.redirects[i]); if (c) { return c as HttpIncomingMessage; } diff --git a/src/https.ts b/src/https.ts index e2b0e0c..21e56ea 100644 --- a/src/https.ts +++ b/src/https.ts @@ -1,14 +1,10 @@ -import https from 'https'; -import { Readable } from 'stream'; -import { UrlWithStringQuery } from 'url'; -import http, { HttpOptions } from './http'; +import https_ from 'https'; +import { http, HttpOptions } from './http'; +import type { GetUriProtocol } from '.'; /** * Returns a Readable stream from an "https:" URI. */ -export default function get( - parsed: UrlWithStringQuery, - opts: HttpOptions -): Promise { - return http(parsed, { ...opts, http: https }); -} +export const https: GetUriProtocol = (url, opts) => { + return http(url, { ...opts, http: https_ }); +}; diff --git a/src/index.ts b/src/index.ts index a1599bd..3957452 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,19 +1,44 @@ import createDebug from 'debug'; import { Readable } from 'stream'; -import { UrlWithStringQuery, parse } from 'url'; // Built-in protocols -import data from './data'; -import file from './file'; -import ftp from './ftp'; -import http from './http'; -import https from './https'; +import { data } from './data'; +import { file } from './file'; +import { ftp } from './ftp'; +import { http } from './http'; +import { https } from './https'; const debug = createDebug('get-uri'); +type Protocol = T extends `${infer Protocol}:${infer _}` ? Protocol : never; + +export type GetUriProtocol = (parsed: URL, opts?: T) => Promise; + +export const protocols = { + data, + file, + ftp, + http, + https, +}; + +type Protocols = typeof protocols; + +type ProtocolOpts = { + [P in keyof Protocols]: Protocol extends P + ? Parameters[1] + : never; +}[keyof Protocols]; + +const VALID_PROTOCOLS = new Set(Object.keys(protocols)); + +export function isValidProtocol(p: string): p is keyof Protocols { + return VALID_PROTOCOLS.has(p); +} + /** - * Async function that returns a `stream.Readable` instance to the - * callback function that will output the contents of the given URI. + * Async function that returns a `stream.Readable` instance that will output + * the contents of the given URI. * * For caching purposes, you can pass in a `stream` instance from a previous * `getUri()` call as a `cache: stream` option, and if the destination has @@ -24,77 +49,28 @@ const debug = createDebug('get-uri'); * * @param {String} uri URI to retrieve * @param {Object} opts optional "options" object - * @param {Function} fn callback function * @api public */ -function getUri(uri: string, fn: getUri.GetUriCallback): void; -function getUri( - uri: string, - opts: getUri.GetUriOptions, - fn: getUri.GetUriCallback -): void; -function getUri(uri: string, opts?: getUri.GetUriOptions): Promise; -function getUri( - uri: string, - opts?: getUri.GetUriOptions | getUri.GetUriCallback, - fn?: getUri.GetUriCallback -): Promise | void { - const p = new Promise((resolve, reject) => { - debug('getUri(%o)', uri); - - if (typeof opts === 'function') { - fn = opts; - opts = undefined; - } +export async function getUri( + uri: Uri | URL, + opts?: ProtocolOpts +): Promise { + debug('getUri(%o)', uri); - if (!uri) { - reject(new TypeError('Must pass in a URI to "get"')); - return; - } - - const parsed = parse(uri); - - // Strip trailing `:` - const protocol = (parsed.protocol || '').replace(/:$/, ''); - if (!protocol) { - reject(new TypeError(`URI does not contain a protocol: ${uri}`)); - return; - } - - const getter = getUri.protocols[protocol]; - - if (typeof getter !== 'function') { - throw new TypeError( - `Unsupported protocol "${protocol}" specified in URI: ${uri}` - ); - } + if (!uri) { + throw new TypeError('Must pass in a URI to "getUri()"'); + } - resolve(getter(parsed, opts || {})); - }); + const url = typeof uri === 'string' ? new URL(uri) : uri; - if (typeof fn === 'function') { - p.then(rtn => fn!(null, rtn), err => fn!(err)); - } else { - return p; + // Strip trailing `:` + const protocol = url.protocol.replace(/:$/, ''); + if (!isValidProtocol(protocol)) { + throw new TypeError( + `Unsupported protocol "${protocol}" specified in URI: "${uri}"` + ); } -} -namespace getUri { - export interface GetUriOptions { - cache?: Readable; - } - export type GetUriCallback = (err?: Error | null, res?: Readable) => void; - export type GetUriProtocol = ( - parsed: UrlWithStringQuery, - opts: getUri.GetUriOptions - ) => Promise; - export const protocols: { [key: string]: getUri.GetUriProtocol } = { - data, - file, - ftp, - http, - https - }; + const getter = protocols[protocol]; + return getter(url, opts as any); } - -export = getUri; diff --git a/src/notfound.ts b/src/notfound.ts index 8caf989..a853a12 100644 --- a/src/notfound.ts +++ b/src/notfound.ts @@ -10,6 +10,5 @@ export default class NotFoundError extends Error { constructor(message?: string) { super(message || 'File does not exist at the specified endpoint'); - Object.setPrototypeOf(this, new.target.prototype); } } diff --git a/src/notmodified.ts b/src/notmodified.ts index c6191e5..264f63e 100644 --- a/src/notmodified.ts +++ b/src/notmodified.ts @@ -12,6 +12,5 @@ export default class NotModifiedError extends Error { message || 'Source has not been modified since the provied "cache", re-use previous results' ); - Object.setPrototypeOf(this, new.target.prototype); } } diff --git a/test/data.js b/test/data.js deleted file mode 100644 index 1e8b09e..0000000 --- a/test/data.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Module dependencies. - */ - -let assert = require('assert'); -let streamToArray = require('stream-to-array'); -let getUri = require('../'); - -describe('get-uri', function() { - describe('"data:" protocol', function() { - let cache; - - it('should work for URL-encoded data', function(done) { - getUri('data:,Hello%2C%20World!', function(err, rs) { - if (err) return done(err); - cache = rs; - streamToArray(rs, function(err, array) { - if (err) return done(err); - let buf = Buffer.concat(array); - assert.equal('Hello, World!', buf.toString()); - done(); - }); - }); - }); - - it('should work for base64-encoded data', function(done) { - getUri('data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D', function( - err, - rs - ) { - if (err) return done(err); - streamToArray(rs, function(err, array) { - if (err) return done(err); - let buf = Buffer.concat(array); - assert.equal('Hello, World!', buf.toString()); - done(); - }); - }); - }); - - it('should return ENOTMODIFIED for the same URI with `cache`', function(done) { - getUri('data:,Hello%2C%20World!', { cache }, function(err, rs) { - assert(err); - assert.equal('ENOTMODIFIED', err.code); - done(); - }); - }); - }); -}); diff --git a/test/data.test.ts b/test/data.test.ts new file mode 100644 index 0000000..3ea4fdc --- /dev/null +++ b/test/data.test.ts @@ -0,0 +1,31 @@ +/** + * Module dependencies. + */ + +import { getUri } from '../src'; +import { toBuffer } from './util'; + +describe('get-uri', () => { + describe('"data:" protocol', () => { + it('should work for URL-encoded data', async () => { + const stream = await getUri('data:,Hello%2C%20World!'); + const buf = await toBuffer(stream); + expect(buf.toString()).toEqual('Hello, World!'); + }); + + it('should work for base64-encoded data', async () => { + const stream = await getUri( + 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D' + ); + const buf = await toBuffer(stream); + expect(buf.toString()).toEqual('Hello, World!'); + }); + + it('should return ENOTMODIFIED for the same URI with `cache`', async () => { + const cache = await getUri('data:,Hello%2C%20World!'); + await expect( + getUri('data:,Hello%2C%20World!', { cache }) + ).rejects.toHaveProperty('code', 'ENOTMODIFIED'); + }); + }); +}); diff --git a/test/file.js b/test/file.js deleted file mode 100644 index 9980db5..0000000 --- a/test/file.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Module dependencies. - */ - -let fs = require('fs'); -let assert = require('assert'); -let streamToArray = require('stream-to-array'); -let getUri = require('../'); - -describe('get-uri', function() { - describe('"file:" protocol', function() { - let cache; - let sep = require('path').sep || '/'; - - // TODO: move this out into a more full-featured module some day… - // i.e. the inverse of https://github.com/TooTallNate/file-path-to-uri - function path2uri(p) { - if (sep == '\\') { - // windows - return `file:///${p}`; - } - // unix - return `file://${p}`; - } - - it('should work for local files', function(done) { - let uri = path2uri(__filename); - fs.readFile(__filename, 'utf8', function(err, real) { - if (err) return done(err); - getUri(uri, function(err, rs) { - if (err) return done(err); - cache = rs; - streamToArray(rs, function(err, array) { - if (err) return done(err); - let str = Buffer.concat(array).toString('utf8'); - assert.equal(str, real); - done(); - }); - }); - }); - }); - - it('should return ENOTFOUND for bad filenames', function(done) { - let uri = path2uri(`${__filename}does-not-exist`); - getUri(uri, function(err, rs) { - assert(err); - assert.equal('ENOTFOUND', err.code); - done(); - }); - }); - - it('should return ENOTMODIFIED for the same URI with `cache`', function(done) { - let uri = path2uri(__filename); - getUri(uri, { cache }, function(err, rs) { - assert(err); - assert.equal('ENOTMODIFIED', err.code); - done(); - }); - }); - }); -}); diff --git a/test/file.test.ts b/test/file.test.ts new file mode 100644 index 0000000..f5c9dd5 --- /dev/null +++ b/test/file.test.ts @@ -0,0 +1,33 @@ +import { pathToFileURL } from 'url'; +import { readFile } from 'fs-extra'; +import { getUri } from '../src'; +import { toBuffer } from './util'; + +describe('get-uri', () => { + describe('"file:" protocol', () => { + it('should work for local files', async () => { + const actual = await readFile(__filename, 'utf8'); + const uri = pathToFileURL(__filename); + const stream = await getUri(uri); + const buf = await toBuffer(stream); + expect(buf.toString()).toEqual(actual); + }); + + it('should return ENOTFOUND for bad filenames', async () => { + const uri = pathToFileURL(`${__filename}does-not-exist`); + await expect(getUri(uri)).rejects.toHaveProperty( + 'code', + 'ENOTFOUND' + ); + }); + + it('should return ENOTMODIFIED for the same URI with `cache`', async () => { + const uri = pathToFileURL(__filename); + const cache = await getUri(uri); + await expect(getUri(uri, { cache })).rejects.toHaveProperty( + 'code', + 'ENOTMODIFIED' + ); + }); + }); +}); diff --git a/test/ftp.js b/test/ftp.js deleted file mode 100644 index 5cce5f9..0000000 --- a/test/ftp.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Module dependencies. - */ - -let fs = require('fs'); -let ftpd = require('ftpd'); -let path = require('path'); -let assert = require('assert'); -let streamToArray = require('stream-to-array'); -let getUri = require('../'); - -describe('get-uri', function() { - describe('"ftp:" protocol', function() { - let port; - let cache; - let server; - - before(function(done) { - let options = { - logLevel: -1, - getInitialCwd(socket, fn) { - fn(null, '/'); - }, - getRoot(socket) { - return __dirname; - } - }; - - let host = '127.0.0.1'; - server = new ftpd.FtpServer(host, options); - - server.on('client:connected', function(conn) { - let username; - conn.on('command:user', function(user, success, failure) { - username = user; - success(); - }); - conn.on('command:pass', function(pass, success, failure) { - success(username); - }); - }); - - server.listen(0, function() { - port = server.server.address().port; - done(); - }); - }); - - after(function(done) { - server.server.once('close', function() { - done(); - }); - server.server.close(); - }); - - it('should work for ftp endpoints', function(done) { - let uri = `ftp://127.0.0.1:${port}/${path.basename(__filename)}`; - fs.readFile(__filename, 'utf8', function(err, real) { - if (err) return done(err); - getUri(uri, function(err, rs) { - if (err) return done(err); - cache = rs; - streamToArray(rs, function(err, array) { - if (err) return done(err); - let str = Buffer.concat(array).toString('utf8'); - assert.equal(str, real); - done(); - }); - }); - }); - }); - - it('should return ENOTFOUND for bad filenames', function(done) { - let uri = `ftp://127.0.0.1:${port}/does-not-exist`; - getUri(uri, function(err, rs) { - assert(err); - assert.equal('ENOTFOUND', err.code); - done(); - }); - }); - - it('should return ENOTMODIFIED for the same URI with `cache`', function(done) { - let uri = `ftp://127.0.0.1:${port}/${path.basename(__filename)}`; - getUri(uri, { cache }, function(err, rs) { - assert(err); - assert.equal('ENOTMODIFIED', err.code); - done(); - }); - }); - }); -}); diff --git a/test/ftp.test.ts b/test/ftp.test.ts new file mode 100644 index 0000000..971dffd --- /dev/null +++ b/test/ftp.test.ts @@ -0,0 +1,77 @@ +import path from 'path'; +import { FtpServer } from 'ftpd'; +import { getUri } from '../src'; +import { readFile } from 'fs-extra'; +import { toBuffer } from './util'; + +describe('get-uri', () => { + describe('"ftp:" protocol', () => { + let port: number; + let server: FtpServer; + + beforeAll(async () => { + server = new FtpServer('127.0.0.1', { + // @ts-ignore + logLevel: -1, + getInitialCwd(_socket, fn) { + // @ts-expect-error + fn?.(undefined, '/'); + }, + getRoot() { + return __dirname; + }, + }); + + server.on('client:connected', (conn) => { + let username: string; + // @ts-expect-error + conn.on('command:user', (user, success, failure) => { + username = user; + success(); + }); + // @ts-expect-error + conn.on('command:pass', (pass, success, failure) => { + success(username); + }); + }); + + port = await new Promise((r) => + // @ts-expect-error + server.listen(0, () => { + // @ts-expect-error + r(server.server.address().port); + }) + ); + }); + + afterAll(() => { + server.close(); + }); + + it('should work for ftp endpoints', async () => { + const actual = await readFile(__filename, 'utf8'); + const stream = await getUri( + `ftp://127.0.0.1:${port}/${path.basename(__filename)}` + ); + const buf = await toBuffer(stream); + expect(buf.toString()).toEqual(actual); + }); + + it('should return ENOTFOUND for bad filenames', async () => { + await expect( + getUri(`ftp://127.0.0.1:${port}/does-not-exist`) + ).rejects.toHaveProperty('code', 'ENOTFOUND'); + }); + + it('should return ENOTMODIFIED for the same URI with `cache`', async () => { + const cache = await getUri( + `ftp://127.0.0.1:${port}/${path.basename(__filename)}` + ); + await expect( + getUri(`ftp://127.0.0.1:${port}/${path.basename(__filename)}`, { + cache, + }) + ).rejects.toHaveProperty('code', 'ENOTMODIFIED'); + }); + }); +}); diff --git a/test/http.js b/test/http.js deleted file mode 100644 index 64c2c62..0000000 --- a/test/http.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Module dependencies. - */ - -let fs = require('fs'); -let st = require('st'); -let path = require('path'); -let http = require('http'); -let assert = require('assert'); -let streamToArray = require('stream-to-array'); -let getUri = require('../'); - -describe('get-uri', function() { - describe('"http:" protocol', function() { - let port; - let cache; - let server; - - before(function(done) { - // setup target HTTP server - server = http.createServer(st(__dirname)); - server.listen(function() { - port = server.address().port; - done(); - }); - }); - - after(function(done) { - server.once('close', function() { - done(); - }); - server.close(); - }); - - it('should work for HTTP endpoints', function(done) { - let uri = `http://127.0.0.1:${port}/${path.basename(__filename)}`; - fs.readFile(__filename, 'utf8', function(err, real) { - if (err) return done(err); - getUri(uri, function(err, rs) { - if (err) return done(err); - cache = rs; - streamToArray(rs, function(err, array) { - if (err) return done(err); - let str = Buffer.concat(array).toString('utf8'); - assert.equal(str, real); - done(); - }); - }); - }); - }); - - it('should return ENOTFOUND for bad filenames', function(done) { - let uri = `http://127.0.0.1:${port}/does-not-exist`; - getUri(uri, function(err, rs) { - assert(err); - assert.equal('ENOTFOUND', err.code); - done(); - }); - }); - - it('should return ENOTMODIFIED for the same URI with `cache`', function(done) { - let uri = `http://127.0.0.1:${port}/${path.basename(__filename)}`; - getUri(uri, { cache }, function(err, rs) { - assert(err); - assert.equal('ENOTMODIFIED', err.code); - done(); - }); - }); - }); -}); diff --git a/test/http.test.ts b/test/http.test.ts new file mode 100644 index 0000000..a8810f2 --- /dev/null +++ b/test/http.test.ts @@ -0,0 +1,56 @@ +// @ts-expect-error no `@types/st` +import st from 'st'; +import path from 'path'; +import http from 'http'; +import { listen } from 'async-listen'; +import { readFile } from 'fs-extra'; +import { getUri } from '../src'; +import { toBuffer } from './util'; + +describe('get-uri', () => { + describe('"http:" protocol', () => { + let port: number; + let server: http.Server; + + beforeAll(async () => { + // setup target HTTP server + server = http.createServer(st(__dirname)); + await listen(server); + // @ts-expect-error + port = server.address().port; + }); + + afterAll(() => { + server.close(); + }); + + it('should work for HTTP endpoints', async () => { + const actual = await readFile(__filename, 'utf8'); + const stream = await getUri( + `http://127.0.0.1:${port}/${path.basename(__filename)}` + ); + const buf = await toBuffer(stream); + expect(buf.toString()).toEqual(actual); + }); + + it('should return ENOTFOUND for bad filenames', async () => { + await expect( + getUri(`http://127.0.0.1:${port}/does-not-exist`) + ).rejects.toHaveProperty('code', 'ENOTFOUND'); + }); + + it('should return ENOTMODIFIED for the same URI with `cache`', async () => { + const cache = await getUri( + `http://127.0.0.1:${port}/${path.basename(__filename)}` + ); + await expect( + getUri( + `http://127.0.0.1:${port}/${path.basename(__filename)}`, + { + cache, + } + ) + ).rejects.toHaveProperty('code', 'ENOTMODIFIED'); + }); + }); +}); diff --git a/test/https.js b/test/https.js deleted file mode 100644 index ab7121b..0000000 --- a/test/https.js +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Module dependencies. - */ - -let fs = require('fs'); -let st = require('st'); -let path = require('path'); -let https = require('https'); -let assert = require('assert'); -let streamToArray = require('stream-to-array'); -let getUri = require('../'); - -describe('get-uri', function() { - describe('"https:" protocol', function() { - let port; - let cache; - let server; - - before(function(done) { - // setup target HTTPS server - let options = { - key: fs.readFileSync(`${__dirname}/server.key`), - cert: fs.readFileSync(`${__dirname}/server.crt`) - }; - server = https.createServer(options, st(__dirname)); - server.listen(function() { - port = server.address().port; - done(); - }); - }); - - after(function(done) { - server.once('close', function() { - done(); - }); - server.close(); - }); - - it('should work for HTTPS endpoints', function(done) { - let uri = `https://127.0.0.1:${port}/${path.basename(__filename)}`; - fs.readFile(__filename, 'utf8', function(err, real) { - if (err) return done(err); - getUri(uri, { rejectUnauthorized: false }, function(err, rs) { - if (err) return done(err); - cache = rs; - streamToArray(rs, function(err, array) { - if (err) return done(err); - let str = Buffer.concat(array).toString('utf8'); - assert.equal(str, real); - done(); - }); - }); - }); - }); - - it('should return ENOTFOUND for bad filenames', function(done) { - let uri = `https://127.0.0.1:${port}/does-not-exist`; - getUri(uri, { rejectUnauthorized: false }, function(err, rs) { - assert(err); - assert.equal('ENOTFOUND', err.code); - done(); - }); - }); - - it('should return ENOTMODIFIED for the same URI with `cache`', function(done) { - let uri = `https://127.0.0.1:${port}/${path.basename(__filename)}`; - getUri(uri, { cache, rejectUnauthorized: false }, function( - err, - rs - ) { - assert(err); - assert.equal('ENOTMODIFIED', err.code); - done(); - }); - }); - }); -}); diff --git a/test/https.test.ts b/test/https.test.ts new file mode 100644 index 0000000..e2c5db5 --- /dev/null +++ b/test/https.test.ts @@ -0,0 +1,67 @@ +import { readFile, readFileSync } from 'fs-extra'; +// @ts-expect-error no `@types/st` +import st from 'st'; +import path from 'path'; +import https from 'https'; +import { listen } from 'async-listen'; +import { getUri } from '../src'; +import { toBuffer } from './util'; + +describe('get-uri', () => { + describe('"https:" protocol', () => { + let port: number; + let server: https.Server; + + beforeAll(async () => { + // setup target HTTPS server + let options = { + key: readFileSync(`${__dirname}/server.key`), + cert: readFileSync(`${__dirname}/server.crt`), + }; + server = https.createServer(options, st(__dirname)); + await listen(server); + // @ts-expect-error + port = server.address().port; + }); + + afterAll(() => { + server.close(); + }); + + it('should work for HTTPS endpoints', async () => { + const actual = await readFile(__filename, 'utf8'); + const stream = await getUri( + `https://127.0.0.1:${port}/${path.basename(__filename)}`, + { headers: { connection: 'close' }, rejectUnauthorized: false } + ); + const buf = await toBuffer(stream); + expect(buf.toString()).toEqual(actual); + }); + + it('should return ENOTFOUND for bad filenames', async () => { + await expect( + getUri(`https://127.0.0.1:${port}/does-not-exist`, { + headers: { connection: 'close' }, + rejectUnauthorized: false, + }) + ).rejects.toHaveProperty('code', 'ENOTFOUND'); + }); + + it('should return ENOTMODIFIED for the same URI with `cache`', async () => { + const cache = await getUri( + `https://127.0.0.1:${port}/${path.basename(__filename)}`, + { headers: { connection: 'close' }, rejectUnauthorized: false } + ); + await expect( + getUri( + `https://127.0.0.1:${port}/${path.basename(__filename)}`, + { + cache, + headers: { connection: 'close' }, + rejectUnauthorized: false, + } + ) + ).rejects.toHaveProperty('code', 'ENOTMODIFIED'); + }); + }); +}); diff --git a/test/redirect.js b/test/redirect.js deleted file mode 100644 index d68e44d..0000000 --- a/test/redirect.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Module dependencies. - */ - -let fs = require('fs'); -let st = require('st'); -let path = require('path'); -let http = require('http'); -let https = require('https'); -let assert = require('assert'); -let streamToArray = require('stream-to-array'); -let getUri = require('../'); - -describe('get-uri', function() { - describe('http/https redirects', function() { - let httpServer; - let httpsServer; - let httpPort; - let httpsPort; - - before(function(done) { - httpServer = http.createServer(); - httpServer.listen(function() { - httpPort = httpServer.address().port; - done(); - }); - }); - - before(function(done) { - let options = { - key: fs.readFileSync(`${__dirname}/server.key`), - cert: fs.readFileSync(`${__dirname}/server.crt`) - }; - httpsServer = https.createServer(options); - httpsServer.listen(function() { - httpsPort = httpsServer.address().port; - done(); - }); - }); - - after(function(done) { - httpsServer.once('close', function() { - done(); - }); - httpsServer.close(); - }); - - after(function(done) { - httpServer.once('close', function() { - done(); - }); - httpServer.close(); - }); - - it('should handle http -> https redirect', function(done) { - httpsServer.once('request', st(__dirname)); - httpServer.once('request', function(req, res) { - res.writeHead(301, { - Location: `https://127.0.0.1:${httpsPort}/${path.basename( - __filename - )}` - }); - res.end('Moved'); - }); - let uri = `http://127.0.0.1:${httpPort}/${path.basename( - __filename - )}`; - fs.readFile(__filename, 'utf8', function(err, real) { - if (err) return done(err); - getUri(uri, { rejectUnauthorized: false }, function(err, rs) { - if (err) return done(err); - streamToArray(rs, function(err, array) { - if (err) return done(err); - let str = Buffer.concat(array).toString('utf8'); - assert.equal(str, real); - done(); - }); - }); - }); - }); - - it('should handle https -> http redirect', function(done) { - httpServer.once('request', st(__dirname)); - httpsServer.once('request', function(req, res) { - res.writeHead(301, { - Location: `http://127.0.0.1:${httpPort}/${path.basename( - __filename - )}` - }); - res.end('Moved'); - }); - - let uri = `http://127.0.0.1:${httpPort}/${path.basename( - __filename - )}`; - fs.readFile(__filename, 'utf8', function(err, real) { - if (err) return done(err); - getUri(uri, function(err, rs) { - if (err) return done(err); - streamToArray(rs, function(err, array) { - if (err) return done(err); - let str = Buffer.concat(array).toString('utf8'); - assert.equal(str, real); - done(); - }); - }); - }); - }); - }); -}); diff --git a/test/redirect.test.ts b/test/redirect.test.ts new file mode 100644 index 0000000..a134a54 --- /dev/null +++ b/test/redirect.test.ts @@ -0,0 +1,80 @@ +// @ts-expect-error no `@types/st` +import st from 'st'; +import path from 'path'; +import http from 'http'; +import https from 'https'; +import { listen } from 'async-listen'; +import { readFile, readFileSync } from 'fs-extra'; +import { getUri } from '../src'; +import { toBuffer } from './util'; + +describe('get-uri', () => { + describe('http/https redirects', () => { + let httpServer: http.Server; + let httpsServer: https.Server; + let httpPort: number; + let httpsPort: number; + + beforeAll(async () => { + httpServer = http.createServer(); + await listen(httpServer); + // @ts-expect-error `port` is definitely a number + httpPort = httpServer.address().port; + }); + + beforeAll(async () => { + httpsServer = https.createServer({ + key: readFileSync(`${__dirname}/server.key`), + cert: readFileSync(`${__dirname}/server.crt`), + }); + await listen(httpsServer); + // @ts-expect-error `port` is definitely a number + httpsPort = httpsServer.address().port; + }); + + afterAll(() => { + httpsServer.close(); + httpServer.close(); + }); + + it('should handle http -> https redirect', async () => { + const dest = `https://127.0.0.1:${httpsPort}/${path.basename( + __filename + )}`; + httpsServer.once('request', st(__dirname)); + httpServer.once('request', (_req, res) => { + res.statusCode = 301; + res.setHeader('location', dest); + res.end('Moved'); + }); + + const actual = await readFile(__filename, 'utf8'); + const stream = await getUri( + `http://127.0.0.1:${httpPort}/${path.basename(__filename)}`, + { headers: { connection: 'close' }, rejectUnauthorized: false } + ); + const buf = await toBuffer(stream); + expect(buf.toString()).toEqual(actual); + }); + + it('should handle https -> http redirect', async () => { + const dest = `http://127.0.0.1:${httpPort}/${path.basename( + __filename + )}`; + httpServer.once('request', st(__dirname)); + httpsServer.once('request', (_req, res) => { + res.statusCode = 301; + res.setHeader('location', dest); + res.end('Moved'); + }); + + const actual = await readFile(__filename, 'utf8'); + const stream = await getUri( + `https://127.0.0.1:${httpsPort}/${path.basename(__filename)}`, + { headers: { connection: 'close' }, rejectUnauthorized: false } + ); + const buf = await toBuffer(stream); + expect(buf.toString()).toEqual(actual); + }); + }); +}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 36ef87b..0000000 --- a/test/test.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Module dependencies. - */ - -let assert = require('assert'); -let getUri = require('../'); - -describe('get-uri', function() { - it('should return promise when no callback function is given', function(done) { - const p = getUri(); - assert.equal(typeof p.then, 'function'); - p.catch(err => { - assert.equal(err.name, 'TypeError'); - done(); - }); - }); - - it('should return a TypeError when no URI is given', function(done) { - getUri(null, function(err) { - assert.equal(err.name, 'TypeError'); - done(); - }); - }); -}); diff --git a/test/test.test.ts b/test/test.test.ts new file mode 100644 index 0000000..69811ea --- /dev/null +++ b/test/test.test.ts @@ -0,0 +1,23 @@ +/** + * Module dependencies. + */ + +import { getUri } from '../src'; + +describe('get-uri', () => { + it('should throw a TypeError when no URI is given', async () => { + await expect(getUri('')).rejects.toThrow( + 'Must pass in a URI to "getUri()"' + ); + }); + + it('should throw a TypeError when no protocol is specified', async () => { + await expect(getUri('://bad')).rejects.toThrow('Invalid URL'); + }); + + it('should throw a TypeError when an unsupported protocol is specified', async () => { + await expect(getUri('bad://bad')).rejects.toThrow( + 'Unsupported protocol "bad" specified in URI: "bad://bad"' + ); + }); +}); diff --git a/test/tsconfig.json b/test/tsconfig.json new file mode 100644 index 0000000..e516b7f --- /dev/null +++ b/test/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../tsconfig.json", + "include": ["**/*.ts"] +} diff --git a/test/util.ts b/test/util.ts new file mode 100644 index 0000000..ac97bc7 --- /dev/null +++ b/test/util.ts @@ -0,0 +1,9 @@ +import { Readable } from 'stream'; + +export async function toBuffer(stream: Readable): Promise { + const chunks: Buffer[] = []; + for await (const chunk of stream) { + chunks.push(chunk); + } + return Buffer.concat(chunks); +} diff --git a/tsconfig.json b/tsconfig.json index 8b06494..d43bf6a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "strict": true, "module": "CommonJS", - "target": "es2018", + "target": "es2020", "esModuleInterop": true, "lib": ["esnext"], "outDir": "dist",