diff --git a/README.md b/README.md index bf5dfd0a2..62c5068b6 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@

- Maintenance of this project is made possible by all the contributors and sponsors. If you'd like to sponsor this project and have your avatar or company logo appear below click here. 💖 +Maintenance of this project is made possible by all the contributors and sponsors. If you'd like to sponsor this project and have your avatar or company logo appear below click here. 💖

@@ -47,7 +47,7 @@

-Chooksta69  robjtede  hadley  kevinchalet  sckott  provinzkraut   +Chooksta69  robjtede  hadley  kevinchalet  sckott  

## Getting Started :airplane: diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md index d41c4d4a4..c55be700d 100755 --- a/node_modules/@types/node/README.md +++ b/node_modules/@types/node/README.md @@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/). Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. ### Additional Details - * Last updated: Thu, 25 May 2023 20:34:26 GMT + * Last updated: Fri, 07 Jul 2023 23:02:42 GMT * Dependencies: none * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone` diff --git a/node_modules/@types/node/buffer.d.ts b/node_modules/@types/node/buffer.d.ts index bf537b8a1..179a82564 100755 --- a/node_modules/@types/node/buffer.d.ts +++ b/node_modules/@types/node/buffer.d.ts @@ -299,6 +299,10 @@ declare module 'buffer' { * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); * ``` * + * If `array` is an `Array`\-like object (that is, one with a `length` property of + * type `number`), it is treated as if it is an array, unless it is a `Buffer` or + * a `Uint8Array`. This means all other `TypedArray` variants get treated as an`Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`. + * * A `TypeError` will be thrown if `array` is not an `Array` or another type * appropriate for `Buffer.from()` variants. * @@ -526,7 +530,7 @@ declare module 'buffer' { * @param [fill=0] A value to pre-fill the new `Buffer` with. * @param [encoding='utf8'] If `fill` is a string, this is its encoding. */ - alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; + alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer; /** * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. * @@ -550,9 +554,8 @@ declare module 'buffer' { * A `TypeError` will be thrown if `size` is not a number. * * The `Buffer` module pre-allocates an internal `Buffer` instance of - * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the - * deprecated`new Buffer(size)` constructor only when `size` is less than or equal - * to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). + * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, + * and `Buffer.concat()` only when `size` is less than or equal to`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). * * Use of this pre-allocated internal memory pool is a key difference between * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. diff --git a/node_modules/@types/node/cluster.d.ts b/node_modules/@types/node/cluster.d.ts index 6ee517720..4fa9aef12 100755 --- a/node_modules/@types/node/cluster.d.ts +++ b/node_modules/@types/node/cluster.d.ts @@ -56,6 +56,7 @@ declare module 'cluster' { import * as child from 'node:child_process'; import EventEmitter = require('node:events'); import * as net from 'node:net'; + type SerializationType = 'json' | 'advanced'; export interface ClusterSettings { execArgv?: string[] | undefined; // default: process.execArgv exec?: string | undefined; @@ -65,6 +66,9 @@ declare module 'cluster' { uid?: number | undefined; gid?: number | undefined; inspectPort?: number | (() => number) | undefined; + serialization?: SerializationType | undefined; + cwd?: string | undefined; + windowsHide?: boolean | undefined; } export interface Address { address: string; diff --git a/node_modules/@types/node/crypto.d.ts b/node_modules/@types/node/crypto.d.ts index 9d5a27266..901846413 100755 --- a/node_modules/@types/node/crypto.d.ts +++ b/node_modules/@types/node/crypto.d.ts @@ -21,14 +21,14 @@ declare module 'crypto' { import { PeerCertificate } from 'node:tls'; /** * SPKAC is a Certificate Signing Request mechanism originally implemented by - * Netscape and was specified formally as part of [HTML5's `keygen` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen). + * Netscape and was specified formally as part of HTML5's `keygen` element. * * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects * should not use this element anymore. * * The `node:crypto` module provides the `Certificate` class for working with SPKAC * data. The most common usage is handling output generated by the HTML5`` element. Node.js uses [OpenSSL's SPKAC - * implementation](https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html) internally. + * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally. * @since v0.11.8 */ class Certificate { @@ -223,7 +223,9 @@ declare module 'crypto' { * display the available digest algorithms. * * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is - * a `KeyObject`, its type must be `secret`. + * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was + * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not + * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256). * * Example: generating the sha256 HMAC of a file * @@ -683,13 +685,13 @@ declare module 'crypto' { * **GCM, or CCM).** * * The implementation of `crypto.createCipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one + * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one * iteration, and no salt. The lack of salt allows dictionary attacks as the same * password always creates the same key. The low iteration count and * non-cryptographically secure hash algorithm allow passwords to be tested very * rapidly. * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that + * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that * developers derive a key and IV on * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when @@ -944,13 +946,13 @@ declare module 'crypto' { * **GCM, or CCM).** * * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one + * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one * iteration, and no salt. The lack of salt allows dictionary attacks as the same * password always creates the same key. The low iteration count and * non-cryptographically secure hash algorithm allow passwords to be tested very * rapidly. * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that + * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that * developers derive a key and IV on * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object. * @since v0.1.94 @@ -1195,11 +1197,14 @@ declare module 'crypto' { * generateKey, * } = await import('node:crypto'); * - * generateKey('hmac', { length: 64 }, (err, key) => { + * generateKey('hmac', { length: 512 }, (err, key) => { * if (err) throw err; * console.log(key.export().toString('hex')); // 46e..........620 * }); * ``` + * + * The size of a generated HMAC key should not exceed the block size of the + * underlying hash function. See {@link createHmac} for more information. * @since v15.0.0 * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. */ @@ -1218,9 +1223,12 @@ declare module 'crypto' { * generateKeySync, * } = await import('node:crypto'); * - * const key = generateKeySync('hmac', { length: 64 }); + * const key = generateKeySync('hmac', { length: 512 }); * console.log(key.export().toString('hex')); // e89..........41e * ``` + * + * The size of a generated HMAC key should not exceed the block size of the + * underlying hash function. See {@link createHmac} for more information. * @since v15.0.0 * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. */ @@ -1508,10 +1516,15 @@ declare module 'crypto' { class DiffieHellman { private constructor(); /** - * Generates private and public Diffie-Hellman key values, and returns + * Generates private and public Diffie-Hellman key values unless they have been + * generated or computed already, and returns * the public key in the specified `encoding`. This key should be * transferred to the other party. * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. + * + * This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular, + * once a private key has been generated or set, calling this function only updates + * the public key but does not generate a new private key. * @since v0.5.0 * @param encoding The `encoding` of the return value. */ @@ -1583,6 +1596,9 @@ declare module 'crypto' { * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected * to be a string. If no `encoding` is provided, `privateKey` is expected * to be a `Buffer`, `TypedArray`, or `DataView`. + * + * This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be + * used to manually provide the public key or to automatically derive it. * @since v0.5.0 * @param encoding The `encoding` of the `privateKey` string. */ diff --git a/node_modules/@types/node/fs.d.ts b/node_modules/@types/node/fs.d.ts index 9ede55db9..00f1cf34e 100755 --- a/node_modules/@types/node/fs.d.ts +++ b/node_modules/@types/node/fs.d.ts @@ -1632,18 +1632,19 @@ declare module 'fs' { * * The callback is given a possible exception and, if `recursive` is `true`, the * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was - * created. + * created (for instance, if it was previously created). * * The optional `options` argument can be an integer specifying `mode` (permission * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that * exists results in an error only - * when `recursive` is false. + * when `recursive` is false. If `recursive` is false and the directory exists, + * an `EEXIST` error occurs. * * ```js * import { mkdir } from 'node:fs'; * - * // Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist. - * mkdir('/tmp/a/apple', { recursive: true }, (err) => { + * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist. + * mkdir('./tmp/a/apple', { recursive: true }, (err) => { * if (err) throw err; * }); * ``` @@ -3088,7 +3089,7 @@ declare module 'fs' { recursive?: boolean | undefined; } export type WatchEventType = 'rename' | 'change'; - export type WatchListener = (event: WatchEventType, filename: T) => void; + export type WatchListener = (event: WatchEventType, filename: T | null) => void; export type StatsListener = (curr: Stats, prev: Stats) => void; export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void; /** diff --git a/node_modules/@types/node/fs/promises.d.ts b/node_modules/@types/node/fs/promises.d.ts index 70560a95b..f5f158351 100755 --- a/node_modules/@types/node/fs/promises.d.ts +++ b/node_modules/@types/node/fs/promises.d.ts @@ -43,7 +43,7 @@ declare module 'fs/promises' { import { Interface as ReadlineInterface } from 'node:readline'; interface FileChangeInfo { eventType: WatchEventType; - filename: T; + filename: T | null; } interface FlagAndOpenMode { mode?: Mode | undefined; diff --git a/node_modules/@types/node/index.d.ts b/node_modules/@types/node/index.d.ts index 97cb955b6..40d2d5341 100755 --- a/node_modules/@types/node/index.d.ts +++ b/node_modules/@types/node/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for non-npm package Node.js 20.2 +// Type definitions for non-npm package Node.js 20.4 // Project: https://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped diff --git a/node_modules/@types/node/module.d.ts b/node_modules/@types/node/module.d.ts index e884f32cc..201576eb8 100755 --- a/node_modules/@types/node/module.d.ts +++ b/node_modules/@types/node/module.d.ts @@ -73,11 +73,24 @@ declare module 'module' { readonly payload: SourceMapPayload; constructor(payload: SourceMapPayload); /** - * Given a line number and column number in the generated source file, returns - * an object representing the position in the original file. The object returned - * consists of the following keys: + * Given a line offset and column offset in the generated source + * file, returns an object representing the SourceMap range in the + * original file if found, or an empty object if not. + * + * The object returned contains the following keys: + * + * The returned value represents the raw range as it appears in the + * SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and + * column numbers as they appear in Error messages and CallSite + * objects. + * + * To get the corresponding 1-indexed line and column numbers from a + * lineNumber and columnNumber as they are reported by Error stacks + * and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)` + * @param lineOffset The zero-indexed line number offset in the generated source + * @param columnOffset The zero-indexed column number offset in the generated source */ - findEntry(line: number, column: number): SourceMapping; + findEntry(lineOffset: number, columnOffset: number): SourceMapping; } } interface Module extends NodeModule {} diff --git a/node_modules/@types/node/net.d.ts b/node_modules/@types/node/net.d.ts index d180fa076..485a97195 100755 --- a/node_modules/@types/node/net.d.ts +++ b/node_modules/@types/node/net.d.ts @@ -310,12 +310,14 @@ declare module 'net' { */ readonly remoteAddress?: string | undefined; /** - * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. + * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). * @since v0.11.14 */ readonly remoteFamily?: string | undefined; /** - * The numeric representation of the remote port. For example, `80` or `21`. + * The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). * @since v0.5.10 */ readonly remotePort?: number | undefined; @@ -744,8 +746,8 @@ declare module 'net' { * * Test this by using `telnet`: * - * ```console - * $ telnet localhost 8124 + * ```bash + * telnet localhost 8124 * ``` * * To listen on the socket `/tmp/echo.sock`: @@ -758,8 +760,8 @@ declare module 'net' { * * Use `nc` to connect to a Unix domain socket server: * - * ```console - * $ nc -U /tmp/echo.sock + * ```bash + * nc -U /tmp/echo.sock * ``` * @since v0.5.0 * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json index 13e578dc7..96fe64817 100755 --- a/node_modules/@types/node/package.json +++ b/node_modules/@types/node/package.json @@ -1,6 +1,6 @@ { "name": "@types/node", - "version": "20.2.4", + "version": "20.4.1", "description": "TypeScript definitions for Node.js", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", "license": "MIT", @@ -232,6 +232,6 @@ }, "scripts": {}, "dependencies": {}, - "typesPublisherContentHash": "2e3b2377433bb56f46cc48c2ae626cac278d92bddb803373733d72c8da681f19", + "typesPublisherContentHash": "cd0e2c7a0a92527e46fbda5fc12bd264c97c2b44ff53770b6b8c6a71e3f2b1dd", "typeScriptVersion": "4.3" } \ No newline at end of file diff --git a/node_modules/@types/node/process.d.ts b/node_modules/@types/node/process.d.ts index 8f093ee91..f122546e7 100755 --- a/node_modules/@types/node/process.d.ts +++ b/node_modules/@types/node/process.d.ts @@ -307,8 +307,8 @@ declare module 'process' { * * Launching the Node.js process as: * - * ```console - * $ node process-args.js one two=three four + * ```bash + * node process-args.js one two=three four * ``` * * Would generate the output: @@ -344,8 +344,8 @@ declare module 'process' { * the script name. These options are useful in order to spawn child processes with * the same execution environment as the parent. * - * ```console - * $ node --harmony script.js --version + * ```bash + * node --harmony script.js --version * ``` * * Results in `process.execArgv`: @@ -492,8 +492,8 @@ declare module 'process' { * to other `Worker` threads. * In other words, the following example would not work: * - * ```console - * $ node -e 'process.env.foo = "bar"' && echo $foo + * ```bash + * node -e 'process.env.foo = "bar"' && echo $foo * ``` * * While the following will: @@ -898,21 +898,30 @@ declare module 'process' { * Will generate an object similar to: * * ```console - * { node: '11.13.0', - * v8: '7.0.276.38-node.18', - * uv: '1.27.0', - * zlib: '1.2.11', - * brotli: '1.0.7', - * ares: '1.15.0', - * modules: '67', - * nghttp2: '1.34.0', - * napi: '4', - * llhttp: '1.1.1', - * openssl: '1.1.1b', - * cldr: '34.0', - * icu: '63.1', - * tz: '2018e', - * unicode: '11.0' } + * { node: '20.2.0', + * acorn: '8.8.2', + * ada: '2.4.0', + * ares: '1.19.0', + * base64: '0.5.0', + * brotli: '1.0.9', + * cjs_module_lexer: '1.2.2', + * cldr: '43.0', + * icu: '73.1', + * llhttp: '8.1.0', + * modules: '115', + * napi: '8', + * nghttp2: '1.52.0', + * nghttp3: '0.7.0', + * ngtcp2: '0.8.1', + * openssl: '3.0.8+quic', + * simdutf: '3.2.9', + * tz: '2023c', + * undici: '5.22.0', + * unicode: '15.0', + * uv: '1.44.2', + * uvwasi: '0.0.16', + * v8: '11.3.244.8-node.9', + * zlib: '1.2.13' } * ``` * @since v0.2.0 */ diff --git a/node_modules/@types/node/test.d.ts b/node_modules/@types/node/test.d.ts index 520245445..5980c053d 100755 --- a/node_modules/@types/node/test.d.ts +++ b/node_modules/@types/node/test.d.ts @@ -159,35 +159,35 @@ declare module 'node:test' { * @param [name='The name'] The name of the suite, which is displayed when reporting test results. * @param options Configuration options for the suite. supports the same options as `test([name][, options][, fn])`. * @param [fn='A no-op function'] The function under suite declaring all subtests and subsuites. The first argument to this function is a {@link SuiteContext} object. - * @return `undefined`. + * @return Immediately fulfilled with `undefined`. */ - function describe(name?: string, options?: TestOptions, fn?: SuiteFn): void; - function describe(name?: string, fn?: SuiteFn): void; - function describe(options?: TestOptions, fn?: SuiteFn): void; - function describe(fn?: SuiteFn): void; + function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function describe(name?: string, fn?: SuiteFn): Promise; + function describe(options?: TestOptions, fn?: SuiteFn): Promise; + function describe(fn?: SuiteFn): Promise; namespace describe { /** * Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`. */ - function skip(name?: string, options?: TestOptions, fn?: SuiteFn): void; - function skip(name?: string, fn?: SuiteFn): void; - function skip(options?: TestOptions, fn?: SuiteFn): void; - function skip(fn?: SuiteFn): void; + function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function skip(name?: string, fn?: SuiteFn): Promise; + function skip(options?: TestOptions, fn?: SuiteFn): Promise; + function skip(fn?: SuiteFn): Promise; /** * Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`. */ - function todo(name?: string, options?: TestOptions, fn?: SuiteFn): void; - function todo(name?: string, fn?: SuiteFn): void; - function todo(options?: TestOptions, fn?: SuiteFn): void; - function todo(fn?: SuiteFn): void; + function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function todo(name?: string, fn?: SuiteFn): Promise; + function todo(options?: TestOptions, fn?: SuiteFn): Promise; + function todo(fn?: SuiteFn): Promise; /** * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`. * @since v18.15.0 */ - function only(name?: string, options?: TestOptions, fn?: SuiteFn): void; - function only(name?: string, fn?: SuiteFn): void; - function only(options?: TestOptions, fn?: SuiteFn): void; - function only(fn?: SuiteFn): void; + function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function only(name?: string, fn?: SuiteFn): Promise; + function only(options?: TestOptions, fn?: SuiteFn): Promise; + function only(fn?: SuiteFn): Promise; } /** * Shorthand for `test()`. @@ -195,69 +195,69 @@ declare module 'node:test' { * The `it()` function is imported from the `node:test` module. * @since v18.6.0, v16.17.0 */ - function it(name?: string, options?: TestOptions, fn?: TestFn): void; - function it(name?: string, fn?: TestFn): void; - function it(options?: TestOptions, fn?: TestFn): void; - function it(fn?: TestFn): void; + function it(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function it(name?: string, fn?: TestFn): Promise; + function it(options?: TestOptions, fn?: TestFn): Promise; + function it(fn?: TestFn): Promise; namespace it { /** * Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`. */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): void; - function skip(name?: string, fn?: TestFn): void; - function skip(options?: TestOptions, fn?: TestFn): void; - function skip(fn?: TestFn): void; + function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function skip(name?: string, fn?: TestFn): Promise; + function skip(options?: TestOptions, fn?: TestFn): Promise; + function skip(fn?: TestFn): Promise; /** * Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`. */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): void; - function todo(name?: string, fn?: TestFn): void; - function todo(options?: TestOptions, fn?: TestFn): void; - function todo(fn?: TestFn): void; + function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function todo(name?: string, fn?: TestFn): Promise; + function todo(options?: TestOptions, fn?: TestFn): Promise; + function todo(fn?: TestFn): Promise; /** * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`. * @since v18.15.0 */ - function only(name?: string, options?: TestOptions, fn?: TestFn): void; - function only(name?: string, fn?: TestFn): void; - function only(options?: TestOptions, fn?: TestFn): void; - function only(fn?: TestFn): void; + function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function only(name?: string, fn?: TestFn): Promise; + function only(options?: TestOptions, fn?: TestFn): Promise; + function only(fn?: TestFn): Promise; } /** * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`. * @since v20.2.0 */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): void; - function skip(name?: string, fn?: TestFn): void; - function skip(options?: TestOptions, fn?: TestFn): void; - function skip(fn?: TestFn): void; + function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function skip(name?: string, fn?: TestFn): Promise; + function skip(options?: TestOptions, fn?: TestFn): Promise; + function skip(fn?: TestFn): Promise; /** * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`. * @since v20.2.0 */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): void; - function todo(name?: string, fn?: TestFn): void; - function todo(options?: TestOptions, fn?: TestFn): void; - function todo(fn?: TestFn): void; + function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function todo(name?: string, fn?: TestFn): Promise; + function todo(options?: TestOptions, fn?: TestFn): Promise; + function todo(fn?: TestFn): Promise; /** * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`. * @since v20.2.0 */ - function only(name?: string, options?: TestOptions, fn?: TestFn): void; - function only(name?: string, fn?: TestFn): void; - function only(options?: TestOptions, fn?: TestFn): void; - function only(fn?: TestFn): void; + function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function only(name?: string, fn?: TestFn): Promise; + function only(options?: TestOptions, fn?: TestFn): Promise; + function only(fn?: TestFn): Promise; /** * The type of a function under test. The first argument to this function is a * {@link TestContext} object. If the test uses callbacks, the callback function is passed as * the second argument. */ - type TestFn = (t: TestContext, done: (result?: any) => void) => any; + type TestFn = (t: TestContext, done: (result?: any) => void) => void | Promise; /** * The type of a function under Suite. * If the test uses callbacks, the callback function is passed as an argument */ - type SuiteFn = (done: (result?: any) => void) => void; + type SuiteFn = (s: SuiteContext) => void | Promise; interface RunOptions { /** * If a number is provided, then that many files would run in parallel. @@ -307,134 +307,50 @@ declare module 'node:test' { addListener(event: 'test:pass', listener: (data: TestPass) => void): this; addListener(event: 'test:plan', listener: (data: TestPlan) => void): this; addListener(event: 'test:start', listener: (data: TestStart) => void): this; + addListener(event: 'test:stderr', listener: (data: TestStderr) => void): this; + addListener(event: 'test:stdout', listener: (data: TestStdout) => void): this; addListener(event: string, listener: (...args: any[]) => void): this; emit(event: 'test:diagnostic', data: DiagnosticData): boolean; emit(event: 'test:fail', data: TestFail): boolean; emit(event: 'test:pass', data: TestPass): boolean; emit(event: 'test:plan', data: TestPlan): boolean; emit(event: 'test:start', data: TestStart): boolean; + emit(event: 'test:stderr', data: TestStderr): boolean; + emit(event: 'test:stdout', data: TestStdout): boolean; emit(event: string | symbol, ...args: any[]): boolean; on(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; on(event: 'test:fail', listener: (data: TestFail) => void): this; on(event: 'test:pass', listener: (data: TestPass) => void): this; on(event: 'test:plan', listener: (data: TestPlan) => void): this; on(event: 'test:start', listener: (data: TestStart) => void): this; + on(event: 'test:stderr', listener: (data: TestStderr) => void): this; + on(event: 'test:stdout', listener: (data: TestStdout) => void): this; on(event: string, listener: (...args: any[]) => void): this; once(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; once(event: 'test:fail', listener: (data: TestFail) => void): this; once(event: 'test:pass', listener: (data: TestPass) => void): this; once(event: 'test:plan', listener: (data: TestPlan) => void): this; once(event: 'test:start', listener: (data: TestStart) => void): this; + once(event: 'test:stderr', listener: (data: TestStderr) => void): this; + once(event: 'test:stdout', listener: (data: TestStdout) => void): this; once(event: string, listener: (...args: any[]) => void): this; prependListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; prependListener(event: 'test:fail', listener: (data: TestFail) => void): this; prependListener(event: 'test:pass', listener: (data: TestPass) => void): this; prependListener(event: 'test:plan', listener: (data: TestPlan) => void): this; prependListener(event: 'test:start', listener: (data: TestStart) => void): this; + prependListener(event: 'test:stderr', listener: (data: TestStderr) => void): this; + prependListener(event: 'test:stdout', listener: (data: TestStdout) => void): this; prependListener(event: string, listener: (...args: any[]) => void): this; prependOnceListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this; prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this; prependOnceListener(event: 'test:plan', listener: (data: TestPlan) => void): this; prependOnceListener(event: 'test:start', listener: (data: TestStart) => void): this; + prependOnceListener(event: 'test:stderr', listener: (data: TestStderr) => void): this; + prependOnceListener(event: 'test:stdout', listener: (data: TestStdout) => void): this; prependOnceListener(event: string, listener: (...args: any[]) => void): this; } - interface DiagnosticData { - /** - * The diagnostic message. - */ - message: string; - /** - * The nesting level of the test. - */ - nesting: number; - } - interface TestFail { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration: number; - /** - * The error thrown by the test. - */ - error: Error; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; - } - interface TestPass { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration: number; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; - } - interface TestPlan { - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The number of subtests that have ran. - */ - count: number; - } - interface TestStart { - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - } /** * An instance of `TestContext` is passed to each test function in order to * interact with the test runner. However, the `TestContext` constructor is not @@ -570,6 +486,24 @@ declare module 'node:test' { */ readonly mock: MockTracker; } + /** + * An instance of `SuiteContext` is passed to each suite function in order to + * interact with the test runner. However, the `SuiteContext` constructor is not + * exposed as part of the API. + * @since v18.7.0, v16.17.0 + */ + class SuiteContext { + /** + * The name of the suite. + * @since v18.8.0, v16.18.0 + */ + readonly name: string; + /** + * Can be used to abort test subtasks when the test has been aborted. + * @since v18.7.0, v16.17.0 + */ + readonly signal: AbortSignal; + } interface TestOptions { /** * If a number is provided, then that many tests would run in parallel. @@ -905,6 +839,7 @@ declare module 'node:test' { * @since v19.1.0, v18.13.0 */ restoreAll(): void; + timers: MockTimers; } const mock: MockTracker; interface MockFunctionCall< @@ -1048,5 +983,401 @@ declare module 'node:test' { */ restore(): void; } + type Timer = 'setInterval' | 'clearInterval' | 'setTimeout' | 'clearTimeout'; + /** + * Mocking timers is a technique commonly used in software testing to simulate and + * control the behavior of timers, such as `setInterval` and `setTimeout`, + * without actually waiting for the specified time intervals. + * + * The `MockTracker` provides a top-level `timers` export + * which is a `MockTimers` instance. + * @since v20.4.0 + * @experimental + */ + class MockTimers { + /** + * Enables timer mocking for the specified timers. + * + * **Note:** When you enable mocking for a specific timer, its associated + * clear function will also be implicitly mocked. + * + * Example usage: + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.enable(['setInterval']); + * ``` + * + * ```js + * const { mock } = require('node:test'); + * mock.timers.enable(['setInterval']); + * ``` + * + * The above example enables mocking for the `setInterval` timer and + * implicitly mocks the `clearInterval` function. Only the `setInterval`and `clearInterval` functions from `node:timers`,`node:timers/promises`, and`globalThis` will be mocked. + * + * Alternatively, if you call `mock.timers.enable()` without any parameters: + * + * All timers (`'setInterval'`, `'clearInterval'`, `'setTimeout'`, and `'clearTimeout'`) + * will be mocked. The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout`functions from `node:timers`, `node:timers/promises`, + * and `globalThis` will be mocked. + * @since v20.4.0 + */ + enable(timers?: Timer[]): void; + /** + * This function restores the default behavior of all mocks that were previously + * created by this `MockTimers` instance and disassociates the mocks + * from the `MockTracker` instance. + * + * **Note:** After each test completes, this function is called on + * the test context's `MockTracker`. + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.reset(); + * ``` + * + * ```js + * const { mock } = require('node:test'); + * mock.timers.reset(); + * ``` + * @since v20.4.0 + */ + reset(): void; + /** + * Advances time for all mocked timers. + * + * **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts + * only positive numbers. In Node.js, `setTimeout` with negative numbers is + * only supported for web compatibility reasons. + * + * The following example mocks a `setTimeout` function and + * by using `.tick` advances in + * time triggering all pending timers. + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * + * context.mock.timers.enable(['setTimeout']); + * + * setTimeout(fn, 9999); + * + * assert.strictEqual(fn.mock.callCount(), 0); + * + * // Advance in time + * context.mock.timers.tick(9999); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * + * ```js + * const assert = require('node:assert'); + * const { test } = require('node:test'); + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * context.mock.timers.enable(['setTimeout']); + * + * setTimeout(fn, 9999); + * assert.strictEqual(fn.mock.callCount(), 0); + * + * // Advance in time + * context.mock.timers.tick(9999); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * + * Alternativelly, the `.tick` function can be called many times + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * context.mock.timers.enable(['setTimeout']); + * const nineSecs = 9000; + * setTimeout(fn, nineSecs); + * + * const twoSeconds = 3000; + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * + * ```js + * const assert = require('node:assert'); + * const { test } = require('node:test'); + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * context.mock.timers.enable(['setTimeout']); + * const nineSecs = 9000; + * setTimeout(fn, nineSecs); + * + * const twoSeconds = 3000; + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * @since v20.4.0 + */ + tick(milliseconds: number): void; + /** + * Triggers all pending mocked timers immediately. + * + * The example below triggers all pending timers immediately, + * causing them to execute without any delay. + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('runAll functions following the given order', (context) => { + * context.mock.timers.enable(['setTimeout']); + * const results = []; + * setTimeout(() => results.push(1), 9999); + * + * // Notice that if both timers have the same timeout, + * // the order of execution is guaranteed + * setTimeout(() => results.push(3), 8888); + * setTimeout(() => results.push(2), 8888); + * + * assert.deepStrictEqual(results, []); + * + * context.mock.timers.runAll(); + * + * assert.deepStrictEqual(results, [3, 2, 1]); + * }); + * ``` + * + * ```js + * const assert = require('node:assert'); + * const { test } = require('node:test'); + * + * test('runAll functions following the given order', (context) => { + * context.mock.timers.enable(['setTimeout']); + * const results = []; + * setTimeout(() => results.push(1), 9999); + * + * // Notice that if both timers have the same timeout, + * // the order of execution is guaranteed + * setTimeout(() => results.push(3), 8888); + * setTimeout(() => results.push(2), 8888); + * + * assert.deepStrictEqual(results, []); + * + * context.mock.timers.runAll(); + * + * assert.deepStrictEqual(results, [3, 2, 1]); + * }); + * ``` + * + * **Note:** The `runAll()` function is specifically designed for + * triggering timers in the context of timer mocking. + * It does not have any effect on real-time system + * clocks or actual timers outside of the mocking environment. + * @since v20.4.0 + */ + runAll(): void; + } export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock, skip, only, todo }; } + +interface DiagnosticData { + /** + * The diagnostic message. + */ + message: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestFail { + /** + * Additional execution metadata. + */ + details: { + /** + * The duration of the test in milliseconds. + */ + duration: number; + /** + * The error thrown by the test. + */ + error: Error; + }; + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The ordinal number of the test. + */ + testNumber: number; + /** + * Present if `context.todo` is called. + */ + todo?: string | boolean; + /** + * Present if `context.skip` is called. + */ + skip?: string | boolean; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestPass { + /** + * Additional execution metadata. + */ + details: { + /** + * The duration of the test in milliseconds. + */ + duration: number; + }; + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The ordinal number of the test. + */ + testNumber: number; + /** + * Present if `context.todo` is called. + */ + todo?: string | boolean; + /** + * Present if `context.skip` is called. + */ + skip?: string | boolean; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestPlan { + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The number of subtests that have ran. + */ + count: number; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestStart { + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestStderr { + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; + /** + * The message written to `stderr` + */ + message: string; +} +interface TestStdout { + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; + /** + * The message written to `stdout` + */ + message: string; +} + +/** + * The `node:test/reporters` module exposes the builtin-reporters for `node:test`. + * To access it: + * + * ```js + * import test from 'node:test/reporters'; + * ``` + * + * This module is only available under the `node:` scheme. The following will not + * work: + * + * ```js + * import test from 'test/reporters'; + * ``` + * @since v19.9.0 + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/test/reporters.js) + */ +declare module 'node:test/reporters' { + import { Transform } from 'node:stream'; + + type TestEvent = + | { type: 'test:diagnostic', data: DiagnosticData } + | { type: 'test:fail', data: TestFail } + | { type: 'test:pass', data: TestPass } + | { type: 'test:plan', data: TestPlan } + | { type: 'test:start', data: TestStart } + | { type: 'test:stderr', data: TestStderr } + | { type: 'test:stdout', data: TestStdout }; + type TestEventGenerator = AsyncGenerator; + + /** + * The `dot` reporter outputs the test results in a compact format, + * where each passing test is represented by a `.`, + * and each failing test is represented by a `X`. + */ + function dot(source: TestEventGenerator): AsyncGenerator<'\n' | '.' | 'X', void>; + /** + * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. + */ + function tap(source: TestEventGenerator): AsyncGenerator; + /** + * The `spec` reporter outputs the test results in a human-readable format. + */ + class Spec extends Transform { + constructor(); + } + export { dot, tap, Spec as spec }; +} diff --git a/node_modules/@types/node/tls.d.ts b/node_modules/@types/node/tls.d.ts index 13ee56353..4992b248e 100755 --- a/node_modules/@types/node/tls.d.ts +++ b/node_modules/@types/node/tls.d.ts @@ -728,6 +728,17 @@ declare module 'tls' { } type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1'; interface SecureContextOptions { + /** + * If set, this will be called when a client opens a connection using the ALPN extension. + * One argument will be passed to the callback: an object containing `servername` and `protocols` fields, + * respectively containing the server name from the SNI extension (if any) and an array of + * ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, + * which will be returned to the client as the selected ALPN protocol, or `undefined`, + * to reject the connection with a fatal alert. If a string is returned that does not match one of + * the client's ALPN protocols, an error will be thrown. + * This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error. + */ + ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined; /** * Optionally override the trusted CA certificates. Default is to trust * the well-known CAs curated by Mozilla. Mozilla's CAs are completely diff --git a/node_modules/@types/node/ts4.8/buffer.d.ts b/node_modules/@types/node/ts4.8/buffer.d.ts index bf537b8a1..86694b065 100755 --- a/node_modules/@types/node/ts4.8/buffer.d.ts +++ b/node_modules/@types/node/ts4.8/buffer.d.ts @@ -299,6 +299,10 @@ declare module 'buffer' { * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); * ``` * + * If `array` is an `Array`\-like object (that is, one with a `length` property of + * type `number`), it is treated as if it is an array, unless it is a `Buffer` or + * a `Uint8Array`. This means all other `TypedArray` variants get treated as an`Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`. + * * A `TypeError` will be thrown if `array` is not an `Array` or another type * appropriate for `Buffer.from()` variants. * @@ -550,9 +554,8 @@ declare module 'buffer' { * A `TypeError` will be thrown if `size` is not a number. * * The `Buffer` module pre-allocates an internal `Buffer` instance of - * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the - * deprecated`new Buffer(size)` constructor only when `size` is less than or equal - * to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). + * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, + * and `Buffer.concat()` only when `size` is less than or equal to`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). * * Use of this pre-allocated internal memory pool is a key difference between * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. diff --git a/node_modules/@types/node/ts4.8/cluster.d.ts b/node_modules/@types/node/ts4.8/cluster.d.ts index 6ee517720..4fa9aef12 100755 --- a/node_modules/@types/node/ts4.8/cluster.d.ts +++ b/node_modules/@types/node/ts4.8/cluster.d.ts @@ -56,6 +56,7 @@ declare module 'cluster' { import * as child from 'node:child_process'; import EventEmitter = require('node:events'); import * as net from 'node:net'; + type SerializationType = 'json' | 'advanced'; export interface ClusterSettings { execArgv?: string[] | undefined; // default: process.execArgv exec?: string | undefined; @@ -65,6 +66,9 @@ declare module 'cluster' { uid?: number | undefined; gid?: number | undefined; inspectPort?: number | (() => number) | undefined; + serialization?: SerializationType | undefined; + cwd?: string | undefined; + windowsHide?: boolean | undefined; } export interface Address { address: string; diff --git a/node_modules/@types/node/ts4.8/crypto.d.ts b/node_modules/@types/node/ts4.8/crypto.d.ts index 036abacfb..5b5121777 100755 --- a/node_modules/@types/node/ts4.8/crypto.d.ts +++ b/node_modules/@types/node/ts4.8/crypto.d.ts @@ -21,14 +21,14 @@ declare module 'crypto' { import { PeerCertificate } from 'node:tls'; /** * SPKAC is a Certificate Signing Request mechanism originally implemented by - * Netscape and was specified formally as part of [HTML5's `keygen` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen). + * Netscape and was specified formally as part of HTML5's `keygen` element. * * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects * should not use this element anymore. * * The `node:crypto` module provides the `Certificate` class for working with SPKAC * data. The most common usage is handling output generated by the HTML5`` element. Node.js uses [OpenSSL's SPKAC - * implementation](https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html) internally. + * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally. * @since v0.11.8 */ class Certificate { @@ -223,7 +223,9 @@ declare module 'crypto' { * display the available digest algorithms. * * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is - * a `KeyObject`, its type must be `secret`. + * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was + * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not + * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256). * * Example: generating the sha256 HMAC of a file * @@ -683,13 +685,13 @@ declare module 'crypto' { * **GCM, or CCM).** * * The implementation of `crypto.createCipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one + * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one * iteration, and no salt. The lack of salt allows dictionary attacks as the same * password always creates the same key. The low iteration count and * non-cryptographically secure hash algorithm allow passwords to be tested very * rapidly. * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that + * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that * developers derive a key and IV on * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when @@ -944,13 +946,13 @@ declare module 'crypto' { * **GCM, or CCM).** * * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one + * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one * iteration, and no salt. The lack of salt allows dictionary attacks as the same * password always creates the same key. The low iteration count and * non-cryptographically secure hash algorithm allow passwords to be tested very * rapidly. * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that + * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that * developers derive a key and IV on * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object. * @since v0.1.94 @@ -1195,11 +1197,14 @@ declare module 'crypto' { * generateKey, * } = await import('node:crypto'); * - * generateKey('hmac', { length: 64 }, (err, key) => { + * generateKey('hmac', { length: 512 }, (err, key) => { * if (err) throw err; * console.log(key.export().toString('hex')); // 46e..........620 * }); * ``` + * + * The size of a generated HMAC key should not exceed the block size of the + * underlying hash function. See {@link createHmac} for more information. * @since v15.0.0 * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. */ @@ -1218,9 +1223,12 @@ declare module 'crypto' { * generateKeySync, * } = await import('node:crypto'); * - * const key = generateKeySync('hmac', { length: 64 }); + * const key = generateKeySync('hmac', { length: 512 }); * console.log(key.export().toString('hex')); // e89..........41e * ``` + * + * The size of a generated HMAC key should not exceed the block size of the + * underlying hash function. See {@link createHmac} for more information. * @since v15.0.0 * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. */ @@ -1508,10 +1516,15 @@ declare module 'crypto' { class DiffieHellman { private constructor(); /** - * Generates private and public Diffie-Hellman key values, and returns + * Generates private and public Diffie-Hellman key values unless they have been + * generated or computed already, and returns * the public key in the specified `encoding`. This key should be * transferred to the other party. * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. + * + * This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular, + * once a private key has been generated or set, calling this function only updates + * the public key but does not generate a new private key. * @since v0.5.0 * @param encoding The `encoding` of the return value. */ @@ -1583,6 +1596,9 @@ declare module 'crypto' { * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected * to be a string. If no `encoding` is provided, `privateKey` is expected * to be a `Buffer`, `TypedArray`, or `DataView`. + * + * This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be + * used to manually provide the public key or to automatically derive it. * @since v0.5.0 * @param encoding The `encoding` of the `privateKey` string. */ diff --git a/node_modules/@types/node/ts4.8/fs.d.ts b/node_modules/@types/node/ts4.8/fs.d.ts index 9ede55db9..00f1cf34e 100755 --- a/node_modules/@types/node/ts4.8/fs.d.ts +++ b/node_modules/@types/node/ts4.8/fs.d.ts @@ -1632,18 +1632,19 @@ declare module 'fs' { * * The callback is given a possible exception and, if `recursive` is `true`, the * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was - * created. + * created (for instance, if it was previously created). * * The optional `options` argument can be an integer specifying `mode` (permission * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that * exists results in an error only - * when `recursive` is false. + * when `recursive` is false. If `recursive` is false and the directory exists, + * an `EEXIST` error occurs. * * ```js * import { mkdir } from 'node:fs'; * - * // Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist. - * mkdir('/tmp/a/apple', { recursive: true }, (err) => { + * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist. + * mkdir('./tmp/a/apple', { recursive: true }, (err) => { * if (err) throw err; * }); * ``` @@ -3088,7 +3089,7 @@ declare module 'fs' { recursive?: boolean | undefined; } export type WatchEventType = 'rename' | 'change'; - export type WatchListener = (event: WatchEventType, filename: T) => void; + export type WatchListener = (event: WatchEventType, filename: T | null) => void; export type StatsListener = (curr: Stats, prev: Stats) => void; export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void; /** diff --git a/node_modules/@types/node/ts4.8/fs/promises.d.ts b/node_modules/@types/node/ts4.8/fs/promises.d.ts index a06968b70..93e705ea4 100755 --- a/node_modules/@types/node/ts4.8/fs/promises.d.ts +++ b/node_modules/@types/node/ts4.8/fs/promises.d.ts @@ -43,7 +43,7 @@ declare module 'fs/promises' { import { Interface as ReadlineInterface } from 'node:readline'; interface FileChangeInfo { eventType: WatchEventType; - filename: T; + filename: T | null; } interface FlagAndOpenMode { mode?: Mode | undefined; diff --git a/node_modules/@types/node/ts4.8/module.d.ts b/node_modules/@types/node/ts4.8/module.d.ts index e884f32cc..201576eb8 100755 --- a/node_modules/@types/node/ts4.8/module.d.ts +++ b/node_modules/@types/node/ts4.8/module.d.ts @@ -73,11 +73,24 @@ declare module 'module' { readonly payload: SourceMapPayload; constructor(payload: SourceMapPayload); /** - * Given a line number and column number in the generated source file, returns - * an object representing the position in the original file. The object returned - * consists of the following keys: + * Given a line offset and column offset in the generated source + * file, returns an object representing the SourceMap range in the + * original file if found, or an empty object if not. + * + * The object returned contains the following keys: + * + * The returned value represents the raw range as it appears in the + * SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and + * column numbers as they appear in Error messages and CallSite + * objects. + * + * To get the corresponding 1-indexed line and column numbers from a + * lineNumber and columnNumber as they are reported by Error stacks + * and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)` + * @param lineOffset The zero-indexed line number offset in the generated source + * @param columnOffset The zero-indexed column number offset in the generated source */ - findEntry(line: number, column: number): SourceMapping; + findEntry(lineOffset: number, columnOffset: number): SourceMapping; } } interface Module extends NodeModule {} diff --git a/node_modules/@types/node/ts4.8/net.d.ts b/node_modules/@types/node/ts4.8/net.d.ts index d180fa076..485a97195 100755 --- a/node_modules/@types/node/ts4.8/net.d.ts +++ b/node_modules/@types/node/ts4.8/net.d.ts @@ -310,12 +310,14 @@ declare module 'net' { */ readonly remoteAddress?: string | undefined; /** - * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. + * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). * @since v0.11.14 */ readonly remoteFamily?: string | undefined; /** - * The numeric representation of the remote port. For example, `80` or `21`. + * The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). * @since v0.5.10 */ readonly remotePort?: number | undefined; @@ -744,8 +746,8 @@ declare module 'net' { * * Test this by using `telnet`: * - * ```console - * $ telnet localhost 8124 + * ```bash + * telnet localhost 8124 * ``` * * To listen on the socket `/tmp/echo.sock`: @@ -758,8 +760,8 @@ declare module 'net' { * * Use `nc` to connect to a Unix domain socket server: * - * ```console - * $ nc -U /tmp/echo.sock + * ```bash + * nc -U /tmp/echo.sock * ``` * @since v0.5.0 * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. diff --git a/node_modules/@types/node/ts4.8/process.d.ts b/node_modules/@types/node/ts4.8/process.d.ts index 8f093ee91..f122546e7 100755 --- a/node_modules/@types/node/ts4.8/process.d.ts +++ b/node_modules/@types/node/ts4.8/process.d.ts @@ -307,8 +307,8 @@ declare module 'process' { * * Launching the Node.js process as: * - * ```console - * $ node process-args.js one two=three four + * ```bash + * node process-args.js one two=three four * ``` * * Would generate the output: @@ -344,8 +344,8 @@ declare module 'process' { * the script name. These options are useful in order to spawn child processes with * the same execution environment as the parent. * - * ```console - * $ node --harmony script.js --version + * ```bash + * node --harmony script.js --version * ``` * * Results in `process.execArgv`: @@ -492,8 +492,8 @@ declare module 'process' { * to other `Worker` threads. * In other words, the following example would not work: * - * ```console - * $ node -e 'process.env.foo = "bar"' && echo $foo + * ```bash + * node -e 'process.env.foo = "bar"' && echo $foo * ``` * * While the following will: @@ -898,21 +898,30 @@ declare module 'process' { * Will generate an object similar to: * * ```console - * { node: '11.13.0', - * v8: '7.0.276.38-node.18', - * uv: '1.27.0', - * zlib: '1.2.11', - * brotli: '1.0.7', - * ares: '1.15.0', - * modules: '67', - * nghttp2: '1.34.0', - * napi: '4', - * llhttp: '1.1.1', - * openssl: '1.1.1b', - * cldr: '34.0', - * icu: '63.1', - * tz: '2018e', - * unicode: '11.0' } + * { node: '20.2.0', + * acorn: '8.8.2', + * ada: '2.4.0', + * ares: '1.19.0', + * base64: '0.5.0', + * brotli: '1.0.9', + * cjs_module_lexer: '1.2.2', + * cldr: '43.0', + * icu: '73.1', + * llhttp: '8.1.0', + * modules: '115', + * napi: '8', + * nghttp2: '1.52.0', + * nghttp3: '0.7.0', + * ngtcp2: '0.8.1', + * openssl: '3.0.8+quic', + * simdutf: '3.2.9', + * tz: '2023c', + * undici: '5.22.0', + * unicode: '15.0', + * uv: '1.44.2', + * uvwasi: '0.0.16', + * v8: '11.3.244.8-node.9', + * zlib: '1.2.13' } * ``` * @since v0.2.0 */ diff --git a/node_modules/@types/node/ts4.8/test.d.ts b/node_modules/@types/node/ts4.8/test.d.ts index 520245445..5ca208ecc 100755 --- a/node_modules/@types/node/ts4.8/test.d.ts +++ b/node_modules/@types/node/ts4.8/test.d.ts @@ -159,7 +159,7 @@ declare module 'node:test' { * @param [name='The name'] The name of the suite, which is displayed when reporting test results. * @param options Configuration options for the suite. supports the same options as `test([name][, options][, fn])`. * @param [fn='A no-op function'] The function under suite declaring all subtests and subsuites. The first argument to this function is a {@link SuiteContext} object. - * @return `undefined`. + * @return Immediately fulfilled with `undefined`. */ function describe(name?: string, options?: TestOptions, fn?: SuiteFn): void; function describe(name?: string, fn?: SuiteFn): void; @@ -307,134 +307,50 @@ declare module 'node:test' { addListener(event: 'test:pass', listener: (data: TestPass) => void): this; addListener(event: 'test:plan', listener: (data: TestPlan) => void): this; addListener(event: 'test:start', listener: (data: TestStart) => void): this; + addListener(event: 'test:stderr', listener: (data: TestStderr) => void): this; + addListener(event: 'test:stdout', listener: (data: TestStdout) => void): this; addListener(event: string, listener: (...args: any[]) => void): this; emit(event: 'test:diagnostic', data: DiagnosticData): boolean; emit(event: 'test:fail', data: TestFail): boolean; emit(event: 'test:pass', data: TestPass): boolean; emit(event: 'test:plan', data: TestPlan): boolean; emit(event: 'test:start', data: TestStart): boolean; + emit(event: 'test:stderr', data: TestStderr): boolean; + emit(event: 'test:stdout', data: TestStdout): boolean; emit(event: string | symbol, ...args: any[]): boolean; on(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; on(event: 'test:fail', listener: (data: TestFail) => void): this; on(event: 'test:pass', listener: (data: TestPass) => void): this; on(event: 'test:plan', listener: (data: TestPlan) => void): this; on(event: 'test:start', listener: (data: TestStart) => void): this; + on(event: 'test:stderr', listener: (data: TestStderr) => void): this; + on(event: 'test:stdout', listener: (data: TestStdout) => void): this; on(event: string, listener: (...args: any[]) => void): this; once(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; once(event: 'test:fail', listener: (data: TestFail) => void): this; once(event: 'test:pass', listener: (data: TestPass) => void): this; once(event: 'test:plan', listener: (data: TestPlan) => void): this; once(event: 'test:start', listener: (data: TestStart) => void): this; + once(event: 'test:stderr', listener: (data: TestStderr) => void): this; + once(event: 'test:stdout', listener: (data: TestStdout) => void): this; once(event: string, listener: (...args: any[]) => void): this; prependListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; prependListener(event: 'test:fail', listener: (data: TestFail) => void): this; prependListener(event: 'test:pass', listener: (data: TestPass) => void): this; prependListener(event: 'test:plan', listener: (data: TestPlan) => void): this; prependListener(event: 'test:start', listener: (data: TestStart) => void): this; + prependListener(event: 'test:stderr', listener: (data: TestStderr) => void): this; + prependListener(event: 'test:stdout', listener: (data: TestStdout) => void): this; prependListener(event: string, listener: (...args: any[]) => void): this; prependOnceListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this; prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this; prependOnceListener(event: 'test:plan', listener: (data: TestPlan) => void): this; prependOnceListener(event: 'test:start', listener: (data: TestStart) => void): this; + prependOnceListener(event: 'test:stderr', listener: (data: TestStderr) => void): this; + prependOnceListener(event: 'test:stdout', listener: (data: TestStdout) => void): this; prependOnceListener(event: string, listener: (...args: any[]) => void): this; } - interface DiagnosticData { - /** - * The diagnostic message. - */ - message: string; - /** - * The nesting level of the test. - */ - nesting: number; - } - interface TestFail { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration: number; - /** - * The error thrown by the test. - */ - error: Error; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; - } - interface TestPass { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration: number; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; - } - interface TestPlan { - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The number of subtests that have ran. - */ - count: number; - } - interface TestStart { - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - } /** * An instance of `TestContext` is passed to each test function in order to * interact with the test runner. However, the `TestContext` constructor is not @@ -905,6 +821,7 @@ declare module 'node:test' { * @since v19.1.0, v18.13.0 */ restoreAll(): void; + timers: MockTimers; } const mock: MockTracker; interface MockFunctionCall< @@ -1048,5 +965,401 @@ declare module 'node:test' { */ restore(): void; } + type Timer = 'setInterval' | 'clearInterval' | 'setTimeout' | 'clearTimeout'; + /** + * Mocking timers is a technique commonly used in software testing to simulate and + * control the behavior of timers, such as `setInterval` and `setTimeout`, + * without actually waiting for the specified time intervals. + * + * The `MockTracker` provides a top-level `timers` export + * which is a `MockTimers` instance. + * @since v20.4.0 + * @experimental + */ + class MockTimers { + /** + * Enables timer mocking for the specified timers. + * + * **Note:** When you enable mocking for a specific timer, its associated + * clear function will also be implicitly mocked. + * + * Example usage: + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.enable(['setInterval']); + * ``` + * + * ```js + * const { mock } = require('node:test'); + * mock.timers.enable(['setInterval']); + * ``` + * + * The above example enables mocking for the `setInterval` timer and + * implicitly mocks the `clearInterval` function. Only the `setInterval`and `clearInterval` functions from `node:timers`,`node:timers/promises`, and`globalThis` will be mocked. + * + * Alternatively, if you call `mock.timers.enable()` without any parameters: + * + * All timers (`'setInterval'`, `'clearInterval'`, `'setTimeout'`, and `'clearTimeout'`) + * will be mocked. The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout`functions from `node:timers`, `node:timers/promises`, + * and `globalThis` will be mocked. + * @since v20.4.0 + */ + enable(timers?: Timer[]): void; + /** + * This function restores the default behavior of all mocks that were previously + * created by this `MockTimers` instance and disassociates the mocks + * from the `MockTracker` instance. + * + * **Note:** After each test completes, this function is called on + * the test context's `MockTracker`. + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.reset(); + * ``` + * + * ```js + * const { mock } = require('node:test'); + * mock.timers.reset(); + * ``` + * @since v20.4.0 + */ + reset(): void; + /** + * Advances time for all mocked timers. + * + * **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts + * only positive numbers. In Node.js, `setTimeout` with negative numbers is + * only supported for web compatibility reasons. + * + * The following example mocks a `setTimeout` function and + * by using `.tick` advances in + * time triggering all pending timers. + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * + * context.mock.timers.enable(['setTimeout']); + * + * setTimeout(fn, 9999); + * + * assert.strictEqual(fn.mock.callCount(), 0); + * + * // Advance in time + * context.mock.timers.tick(9999); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * + * ```js + * const assert = require('node:assert'); + * const { test } = require('node:test'); + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * context.mock.timers.enable(['setTimeout']); + * + * setTimeout(fn, 9999); + * assert.strictEqual(fn.mock.callCount(), 0); + * + * // Advance in time + * context.mock.timers.tick(9999); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * + * Alternativelly, the `.tick` function can be called many times + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * context.mock.timers.enable(['setTimeout']); + * const nineSecs = 9000; + * setTimeout(fn, nineSecs); + * + * const twoSeconds = 3000; + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * + * ```js + * const assert = require('node:assert'); + * const { test } = require('node:test'); + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * context.mock.timers.enable(['setTimeout']); + * const nineSecs = 9000; + * setTimeout(fn, nineSecs); + * + * const twoSeconds = 3000; + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * @since v20.4.0 + */ + tick(milliseconds: number): void; + /** + * Triggers all pending mocked timers immediately. + * + * The example below triggers all pending timers immediately, + * causing them to execute without any delay. + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('runAll functions following the given order', (context) => { + * context.mock.timers.enable(['setTimeout']); + * const results = []; + * setTimeout(() => results.push(1), 9999); + * + * // Notice that if both timers have the same timeout, + * // the order of execution is guaranteed + * setTimeout(() => results.push(3), 8888); + * setTimeout(() => results.push(2), 8888); + * + * assert.deepStrictEqual(results, []); + * + * context.mock.timers.runAll(); + * + * assert.deepStrictEqual(results, [3, 2, 1]); + * }); + * ``` + * + * ```js + * const assert = require('node:assert'); + * const { test } = require('node:test'); + * + * test('runAll functions following the given order', (context) => { + * context.mock.timers.enable(['setTimeout']); + * const results = []; + * setTimeout(() => results.push(1), 9999); + * + * // Notice that if both timers have the same timeout, + * // the order of execution is guaranteed + * setTimeout(() => results.push(3), 8888); + * setTimeout(() => results.push(2), 8888); + * + * assert.deepStrictEqual(results, []); + * + * context.mock.timers.runAll(); + * + * assert.deepStrictEqual(results, [3, 2, 1]); + * }); + * ``` + * + * **Note:** The `runAll()` function is specifically designed for + * triggering timers in the context of timer mocking. + * It does not have any effect on real-time system + * clocks or actual timers outside of the mocking environment. + * @since v20.4.0 + */ + runAll(): void; + } export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock, skip, only, todo }; } + +interface DiagnosticData { + /** + * The diagnostic message. + */ + message: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestFail { + /** + * Additional execution metadata. + */ + details: { + /** + * The duration of the test in milliseconds. + */ + duration: number; + /** + * The error thrown by the test. + */ + error: Error; + }; + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The ordinal number of the test. + */ + testNumber: number; + /** + * Present if `context.todo` is called. + */ + todo?: string | boolean; + /** + * Present if `context.skip` is called. + */ + skip?: string | boolean; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestPass { + /** + * Additional execution metadata. + */ + details: { + /** + * The duration of the test in milliseconds. + */ + duration: number; + }; + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The ordinal number of the test. + */ + testNumber: number; + /** + * Present if `context.todo` is called. + */ + todo?: string | boolean; + /** + * Present if `context.skip` is called. + */ + skip?: string | boolean; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestPlan { + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The number of subtests that have ran. + */ + count: number; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestStart { + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestStderr { + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; + /** + * The message written to `stderr` + */ + message: string; +} +interface TestStdout { + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; + /** + * The message written to `stdout` + */ + message: string; +} + +/** + * The `node:test/reporters` module exposes the builtin-reporters for `node:test`. + * To access it: + * + * ```js + * import test from 'node:test/reporters'; + * ``` + * + * This module is only available under the `node:` scheme. The following will not + * work: + * + * ```js + * import test from 'test/reporters'; + * ``` + * @since v19.9.0 + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/test/reporters.js) + */ +declare module 'node:test/reporters' { + import { Transform } from 'node:stream'; + + type TestEvent = + | { type: 'test:diagnostic', data: DiagnosticData } + | { type: 'test:fail', data: TestFail } + | { type: 'test:pass', data: TestPass } + | { type: 'test:plan', data: TestPlan } + | { type: 'test:start', data: TestStart } + | { type: 'test:stderr', data: TestStderr } + | { type: 'test:stdout', data: TestStdout }; + type TestEventGenerator = AsyncGenerator; + + /** + * The `dot` reporter outputs the test results in a compact format, + * where each passing test is represented by a `.`, + * and each failing test is represented by a `X`. + */ + function dot(source: TestEventGenerator): AsyncGenerator<'\n' | '.' | 'X', void>; + /** + * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. + */ + function tap(source: TestEventGenerator): AsyncGenerator; + /** + * The `spec` reporter outputs the test results in a human-readable format. + */ + class Spec extends Transform { + constructor(); + } + export { dot, tap, Spec as spec }; +} diff --git a/node_modules/@types/node/ts4.8/tls.d.ts b/node_modules/@types/node/ts4.8/tls.d.ts index 13ee56353..4992b248e 100755 --- a/node_modules/@types/node/ts4.8/tls.d.ts +++ b/node_modules/@types/node/ts4.8/tls.d.ts @@ -728,6 +728,17 @@ declare module 'tls' { } type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1'; interface SecureContextOptions { + /** + * If set, this will be called when a client opens a connection using the ALPN extension. + * One argument will be passed to the callback: an object containing `servername` and `protocols` fields, + * respectively containing the server name from the SNI extension (if any) and an array of + * ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, + * which will be returned to the client as the selected ALPN protocol, or `undefined`, + * to reject the connection with a fatal alert. If a string is returned that does not match one of + * the client's ALPN protocols, an error will be thrown. + * This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error. + */ + ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined; /** * Optionally override the trusted CA certificates. Default is to trust * the well-known CAs curated by Mozilla. Mozilla's CAs are completely diff --git a/node_modules/@types/node/ts4.8/tty.d.ts b/node_modules/@types/node/ts4.8/tty.d.ts index ca9ab823f..7653bf802 100755 --- a/node_modules/@types/node/ts4.8/tty.d.ts +++ b/node_modules/@types/node/ts4.8/tty.d.ts @@ -42,7 +42,10 @@ declare module 'tty' { constructor(fd: number, options?: net.SocketConstructorOpts); /** * A `boolean` that is `true` if the TTY is currently configured to operate as a - * raw device. Defaults to `false`. + * raw device. + * + * This flag is always `false` when a process starts, even if the terminal is + * operating in raw mode. Its value will change with subsequent calls to`setRawMode`. * @since v0.7.7 */ isRaw: boolean; diff --git a/node_modules/@types/node/ts4.8/util.d.ts b/node_modules/@types/node/ts4.8/util.d.ts index 228a2c89e..df1fd1210 100755 --- a/node_modules/@types/node/ts4.8/util.d.ts +++ b/node_modules/@types/node/ts4.8/util.d.ts @@ -1460,32 +1460,72 @@ declare module 'util' { /** * Gets and sets the type portion of the MIME. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const myMIME = new MIMEType('text/javascript'); + * console.log(myMIME.type); + * // Prints: text + * myMIME.type = 'application'; + * console.log(myMIME.type); + * // Prints: application + * console.log(String(myMIME)); + * // Prints: application/javascript + * ``` */ type: string; /** * Gets and sets the subtype portion of the MIME. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const myMIME = new MIMEType('text/ecmascript'); + * console.log(myMIME.subtype); + * // Prints: ecmascript + * myMIME.subtype = 'javascript'; + * console.log(myMIME.subtype); + * // Prints: javascript + * console.log(String(myMIME)); + * // Prints: text/javascript + * ``` */ subtype: string; /** - * Gets the essence of the MIME. - * + * Gets the essence of the MIME. This property is read only. * Use `mime.type` or `mime.subtype` to alter the MIME. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const myMIME = new MIMEType('text/javascript;key=value'); + * console.log(myMIME.essence); + * // Prints: text/javascript + * myMIME.type = 'application'; + * console.log(myMIME.essence); + * // Prints: application/javascript + * console.log(String(myMIME)); + * // Prints: application/javascript;key=value + * ``` */ readonly essence: string; /** - * Gets the `MIMEParams` object representing the parameters of the MIME. + * Gets the `MIMEParams` object representing the + * parameters of the MIME. This property is read-only. See `MIMEParams` documentation for details. */ readonly params: MIMEParams; /** - * Returns the serialized MIME. + * The `toString()` method on the `MIMEType` object returns the serialized MIME. * - * Because of the need for standard compliance, this method - * does not allow users to customize the serialization process of the MIME. + * Because of the need for standard compliance, this method does not allow users + * to customize the serialization process of the MIME. */ toString(): string; } /** - * @since v18.13.0 + * The `MIMEParams` API provides read and write access to the parameters of a`MIMEType`. + * @since v19.1.0, v18.13.0 */ export class MIMEParams { /** @@ -1494,11 +1534,14 @@ declare module 'util' { delete(name: string): void; /** * Returns an iterator over each of the name-value pairs in the parameters. + * Each item of the iterator is a JavaScript `Array`. The first item of the array + * is the `name`, the second item of the array is the `value`. */ entries(): IterableIterator<[string, string]>; /** - * Returns the value of the first name-value pair whose name is `name`. - * If there are no such pairs, `null` is returned. + * Returns the value of the first name-value pair whose name is `name`. If there + * are no such pairs, `null` is returned. + * @return or `null` if there is no name-value pair with the given `name`. */ get(name: string): string | null; /** @@ -1507,12 +1550,33 @@ declare module 'util' { has(name: string): boolean; /** * Returns an iterator over the names of each name-value pair. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const { params } = new MIMEType('text/plain;foo=0;bar=1'); + * for (const name of params.keys()) { + * console.log(name); + * } + * // Prints: + * // foo + * // bar + * ``` */ keys(): IterableIterator; /** - * Sets the value in the `MIMEParams` object associated with `name` to `value`. - * If there are any pre-existing name-value pairs whose names are `name`, + * Sets the value in the `MIMEParams` object associated with `name` to`value`. If there are any pre-existing name-value pairs whose names are `name`, * set the first such pair's value to `value`. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const { params } = new MIMEType('text/plain;foo=0;bar=1'); + * params.set('foo', 'def'); + * params.set('baz', 'xyz'); + * console.log(params.toString()); + * // Prints: foo=def&bar=1&baz=xyz + * ``` */ set(name: string, value: string): void; /** diff --git a/node_modules/@types/node/ts4.8/wasi.d.ts b/node_modules/@types/node/ts4.8/wasi.d.ts index 9262e98bd..b430b3a92 100755 --- a/node_modules/@types/node/ts4.8/wasi.d.ts +++ b/node_modules/@types/node/ts4.8/wasi.d.ts @@ -58,8 +58,8 @@ * * Use [wabt](https://github.com/WebAssembly/wabt) to compile `.wat` to `.wasm` * - * ```console - * $ wat2wasm demo.wat + * ```bash + * wat2wasm demo.wat * ``` * @experimental * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/wasi.js) diff --git a/node_modules/@types/node/tty.d.ts b/node_modules/@types/node/tty.d.ts index ca9ab823f..7653bf802 100755 --- a/node_modules/@types/node/tty.d.ts +++ b/node_modules/@types/node/tty.d.ts @@ -42,7 +42,10 @@ declare module 'tty' { constructor(fd: number, options?: net.SocketConstructorOpts); /** * A `boolean` that is `true` if the TTY is currently configured to operate as a - * raw device. Defaults to `false`. + * raw device. + * + * This flag is always `false` when a process starts, even if the terminal is + * operating in raw mode. Its value will change with subsequent calls to`setRawMode`. * @since v0.7.7 */ isRaw: boolean; diff --git a/node_modules/@types/node/util.d.ts b/node_modules/@types/node/util.d.ts index ce46cb7d0..824975f47 100755 --- a/node_modules/@types/node/util.d.ts +++ b/node_modules/@types/node/util.d.ts @@ -1460,32 +1460,72 @@ declare module 'util' { /** * Gets and sets the type portion of the MIME. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const myMIME = new MIMEType('text/javascript'); + * console.log(myMIME.type); + * // Prints: text + * myMIME.type = 'application'; + * console.log(myMIME.type); + * // Prints: application + * console.log(String(myMIME)); + * // Prints: application/javascript + * ``` */ type: string; /** * Gets and sets the subtype portion of the MIME. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const myMIME = new MIMEType('text/ecmascript'); + * console.log(myMIME.subtype); + * // Prints: ecmascript + * myMIME.subtype = 'javascript'; + * console.log(myMIME.subtype); + * // Prints: javascript + * console.log(String(myMIME)); + * // Prints: text/javascript + * ``` */ subtype: string; /** - * Gets the essence of the MIME. - * + * Gets the essence of the MIME. This property is read only. * Use `mime.type` or `mime.subtype` to alter the MIME. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const myMIME = new MIMEType('text/javascript;key=value'); + * console.log(myMIME.essence); + * // Prints: text/javascript + * myMIME.type = 'application'; + * console.log(myMIME.essence); + * // Prints: application/javascript + * console.log(String(myMIME)); + * // Prints: application/javascript;key=value + * ``` */ readonly essence: string; /** - * Gets the `MIMEParams` object representing the parameters of the MIME. + * Gets the `MIMEParams` object representing the + * parameters of the MIME. This property is read-only. See `MIMEParams` documentation for details. */ readonly params: MIMEParams; /** - * Returns the serialized MIME. + * The `toString()` method on the `MIMEType` object returns the serialized MIME. * - * Because of the need for standard compliance, this method - * does not allow users to customize the serialization process of the MIME. + * Because of the need for standard compliance, this method does not allow users + * to customize the serialization process of the MIME. */ toString(): string; } /** - * @since v18.13.0 + * The `MIMEParams` API provides read and write access to the parameters of a`MIMEType`. + * @since v19.1.0, v18.13.0 */ export class MIMEParams { /** @@ -1494,11 +1534,14 @@ declare module 'util' { delete(name: string): void; /** * Returns an iterator over each of the name-value pairs in the parameters. + * Each item of the iterator is a JavaScript `Array`. The first item of the array + * is the `name`, the second item of the array is the `value`. */ entries(): IterableIterator<[name: string, value: string]>; /** - * Returns the value of the first name-value pair whose name is `name`. - * If there are no such pairs, `null` is returned. + * Returns the value of the first name-value pair whose name is `name`. If there + * are no such pairs, `null` is returned. + * @return or `null` if there is no name-value pair with the given `name`. */ get(name: string): string | null; /** @@ -1507,12 +1550,33 @@ declare module 'util' { has(name: string): boolean; /** * Returns an iterator over the names of each name-value pair. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const { params } = new MIMEType('text/plain;foo=0;bar=1'); + * for (const name of params.keys()) { + * console.log(name); + * } + * // Prints: + * // foo + * // bar + * ``` */ keys(): IterableIterator; /** - * Sets the value in the `MIMEParams` object associated with `name` to `value`. - * If there are any pre-existing name-value pairs whose names are `name`, + * Sets the value in the `MIMEParams` object associated with `name` to`value`. If there are any pre-existing name-value pairs whose names are `name`, * set the first such pair's value to `value`. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const { params } = new MIMEType('text/plain;foo=0;bar=1'); + * params.set('foo', 'def'); + * params.set('baz', 'xyz'); + * console.log(params.toString()); + * // Prints: foo=def&bar=1&baz=xyz + * ``` */ set(name: string, value: string): void; /** diff --git a/node_modules/@types/node/wasi.d.ts b/node_modules/@types/node/wasi.d.ts index 9262e98bd..b430b3a92 100755 --- a/node_modules/@types/node/wasi.d.ts +++ b/node_modules/@types/node/wasi.d.ts @@ -58,8 +58,8 @@ * * Use [wabt](https://github.com/WebAssembly/wabt) to compile `.wat` to `.wasm` * - * ```console - * $ wat2wasm demo.wat + * ```bash + * wat2wasm demo.wat * ``` * @experimental * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/wasi.js) diff --git a/node_modules/execa/node_modules/semver/CHANGELOG.md b/node_modules/execa/node_modules/semver/CHANGELOG.md deleted file mode 100644 index 66304fdd2..000000000 --- a/node_modules/execa/node_modules/semver/CHANGELOG.md +++ /dev/null @@ -1,39 +0,0 @@ -# changes log - -## 5.7 - -* Add `minVersion` method - -## 5.6 - -* Move boolean `loose` param to an options object, with - backwards-compatibility protection. -* Add ability to opt out of special prerelease version handling with - the `includePrerelease` option flag. - -## 5.5 - -* Add version coercion capabilities - -## 5.4 - -* Add intersection checking - -## 5.3 - -* Add `minSatisfying` method - -## 5.2 - -* Add `prerelease(v)` that returns prerelease components - -## 5.1 - -* Add Backus-Naur for ranges -* Remove excessively cute inspection methods - -## 5.0 - -* Remove AMD/Browserified build artifacts -* Fix ltr and gtr when using the `*` range -* Fix for range `*` with a prerelease identifier diff --git a/node_modules/execa/node_modules/semver/package.json b/node_modules/execa/node_modules/semver/package.json index 69d2db162..db035e97d 100644 --- a/node_modules/execa/node_modules/semver/package.json +++ b/node_modules/execa/node_modules/semver/package.json @@ -1,19 +1,26 @@ { "name": "semver", - "version": "5.7.1", + "version": "5.7.2", "description": "The semantic version parser used by npm.", "main": "semver.js", "scripts": { - "test": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" + "test": "tap test/ --100 --timeout=30", + "lint": "echo linting disabled", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "snap": "tap test/ --100 --timeout=30", + "posttest": "npm run lint" }, "devDependencies": { - "tap": "^13.0.0-rc.18" + "@npmcli/template-oss": "4.17.0", + "tap": "^12.7.0" }, "license": "ISC", - "repository": "https://github.com/npm/node-semver", + "repository": { + "type": "git", + "url": "https://github.com/npm/node-semver.git" + }, "bin": { "semver": "./bin/semver" }, @@ -22,7 +29,10 @@ "range.bnf", "semver.js" ], - "tap": { - "check-coverage": true + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "content": "./scripts/template-oss", + "version": "4.17.0" } } diff --git a/node_modules/execa/node_modules/semver/semver.js b/node_modules/execa/node_modules/semver/semver.js index d315d5d68..dcb683341 100644 --- a/node_modules/execa/node_modules/semver/semver.js +++ b/node_modules/execa/node_modules/semver/semver.js @@ -26,11 +26,39 @@ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || // Max safe segment length for coercion. var MAX_SAFE_COMPONENT_LENGTH = 16 +var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + // The actual regexps go on exports.re var re = exports.re = [] +var safeRe = exports.safeRe = [] var src = exports.src = [] var R = 0 +var LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +var safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +function makeSafeRe (value) { + for (var i = 0; i < safeRegexReplacements.length; i++) { + var token = safeRegexReplacements[i][0] + var max = safeRegexReplacements[i][1] + value = value + .split(token + '*').join(token + '{0,' + max + '}') + .split(token + '+').join(token + '{1,' + max + '}') + } + return value +} + // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. @@ -40,14 +68,14 @@ var R = 0 var NUMERICIDENTIFIER = R++ src[NUMERICIDENTIFIER] = '0|[1-9]\\d*' var NUMERICIDENTIFIERLOOSE = R++ -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+' +src[NUMERICIDENTIFIERLOOSE] = '\\d+' // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. var NONNUMERICIDENTIFIER = R++ -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*' // ## Main Version // Three dot-separated numeric identifiers. @@ -89,7 +117,7 @@ src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + // Any combination of digits, letters, or hyphens. var BUILDIDENTIFIER = R++ -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+' +src[BUILDIDENTIFIER] = LETTERDASHNUMBER + '+' // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata @@ -174,6 +202,7 @@ src[LONETILDE] = '(?:~>?)' var TILDETRIM = R++ src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+' re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g') +safeRe[TILDETRIM] = new RegExp(makeSafeRe(src[TILDETRIM]), 'g') var tildeTrimReplace = '$1~' var TILDE = R++ @@ -189,6 +218,7 @@ src[LONECARET] = '(?:\\^)' var CARETTRIM = R++ src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+' re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g') +safeRe[CARETTRIM] = new RegExp(makeSafeRe(src[CARETTRIM]), 'g') var caretTrimReplace = '$1^' var CARET = R++ @@ -210,6 +240,7 @@ src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + // this one has to use the /g flag re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g') +safeRe[COMPARATORTRIM] = new RegExp(makeSafeRe(src[COMPARATORTRIM]), 'g') var comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` @@ -238,6 +269,14 @@ for (var i = 0; i < R; i++) { debug(i, src[i]) if (!re[i]) { re[i] = new RegExp(src[i]) + + // Replace all greedy whitespace to prevent regex dos issues. These regex are + // used internally via the safeRe object since all inputs in this library get + // normalized first to trim and collapse all extra whitespace. The original + // regexes are exported for userland consumption and lower level usage. A + // future breaking change could export the safer regex only with a note that + // all input should have extra whitespace removed. + safeRe[i] = new RegExp(makeSafeRe(src[i])) } } @@ -262,7 +301,7 @@ function parse (version, options) { return null } - var r = options.loose ? re[LOOSE] : re[FULL] + var r = options.loose ? safeRe[LOOSE] : safeRe[FULL] if (!r.test(version)) { return null } @@ -317,7 +356,7 @@ function SemVer (version, options) { this.options = options this.loose = !!options.loose - var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]) + var m = version.trim().match(options.loose ? safeRe[LOOSE] : safeRe[FULL]) if (!m) { throw new TypeError('Invalid Version: ' + version) @@ -731,6 +770,7 @@ function Comparator (comp, options) { return new Comparator(comp, options) } + comp = comp.trim().split(/\s+/).join(' ') debug('comparator', comp, options) this.options = options this.loose = !!options.loose @@ -747,7 +787,7 @@ function Comparator (comp, options) { var ANY = {} Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR] + var r = this.options.loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR] var m = comp.match(r) if (!m) { @@ -861,9 +901,16 @@ function Range (range, options) { this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease - // First, split based on boolean or || + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. this.raw = range - this.set = range.split(/\s*\|\|\s*/).map(function (range) { + .trim() + .split(/\s+/) + .join(' ') + + // First, split based on boolean or || + this.set = this.raw.split('||').map(function (range) { return this.parseRange(range.trim()) }, this).filter(function (c) { // throw out any that are not relevant for whatever reason @@ -871,7 +918,7 @@ function Range (range, options) { }) if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range) + throw new TypeError('Invalid SemVer Range: ' + this.raw) } this.format() @@ -890,28 +937,23 @@ Range.prototype.toString = function () { Range.prototype.parseRange = function (range) { var loose = this.options.loose - range = range.trim() // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE] + var hr = loose ? safeRe[HYPHENRANGELOOSE] : safeRe[HYPHENRANGE] range = range.replace(hr, hyphenReplace) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[COMPARATORTRIM]) + range = range.replace(safeRe[COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, safeRe[COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace) + range = range.replace(safeRe[TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace) - - // normalize spaces - range = range.split(/\s+/).join(' ') + range = range.replace(safeRe[CARETTRIM], caretTrimReplace) // At this point, the range is completely trimmed and // ready to be split into comparators. - - var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR] + var compRe = loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR] var set = range.split(' ').map(function (comp) { return parseComparator(comp, this.options) }, this).join(' ').split(/\s+/) @@ -987,7 +1029,7 @@ function replaceTildes (comp, options) { } function replaceTilde (comp, options) { - var r = options.loose ? re[TILDELOOSE] : re[TILDE] + var r = options.loose ? safeRe[TILDELOOSE] : safeRe[TILDE] return comp.replace(r, function (_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr) var ret @@ -1028,7 +1070,7 @@ function replaceCarets (comp, options) { function replaceCaret (comp, options) { debug('caret', comp, options) - var r = options.loose ? re[CARETLOOSE] : re[CARET] + var r = options.loose ? safeRe[CARETLOOSE] : safeRe[CARET] return comp.replace(r, function (_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr) var ret @@ -1087,7 +1129,7 @@ function replaceXRanges (comp, options) { function replaceXRange (comp, options) { comp = comp.trim() - var r = options.loose ? re[XRANGELOOSE] : re[XRANGE] + var r = options.loose ? safeRe[XRANGELOOSE] : safeRe[XRANGE] return comp.replace(r, function (ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr) var xM = isX(M) @@ -1157,10 +1199,10 @@ function replaceXRange (comp, options) { function replaceStars (comp, options) { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[STAR], '') + return comp.trim().replace(safeRe[STAR], '') } -// This function is passed to string.replace(re[HYPHENRANGE]) +// This function is passed to string.replace(safeRe[HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do @@ -1471,7 +1513,7 @@ function coerce (version) { return null } - var match = version.match(re[COERCE]) + var match = version.match(safeRe[COERCE]) if (match == null) { return null diff --git a/package.json b/package.json index e44ab8bce..55fa445f0 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@jamesives/github-pages-deploy-action", "description": "GitHub action for building a project and deploying it to GitHub pages.", "author": "James Ives (https://jamesiv.es)", - "version": "4.4.1", + "version": "4.4.2", "license": "MIT", "main": "lib/lib.js", "types": "lib/lib.d.ts", @@ -42,12 +42,12 @@ }, "devDependencies": { "@types/jest": "27.5.0", - "@types/node": "20.2.4", + "@types/node": "20.4.1", "@typescript-eslint/eslint-plugin": "4.33.0", "@typescript-eslint/parser": "4.33.0", "eslint": "7.32.0", "eslint-config-prettier": "8.8.0", - "eslint-plugin-jest": "27.2.1", + "eslint-plugin-jest": "27.2.2", "eslint-plugin-prettier": "4.2.1", "jest": "26.6.3", "jest-circus": "27.5.1", diff --git a/yarn.lock b/yarn.lock index 190414a02..85e940048 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1277,10 +1277,10 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== -"@types/node@*", "@types/node@20.2.4", "@types/node@>= 8": - version "20.2.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.2.4.tgz#e6c3345f7ed9c6df41fdc288a94e2633167bc15d" - integrity sha512-ni5f8Xlf4PwnT/Z3f0HURc3ZSw8UyrqMqmM3L5ysa7VjHu8c3FOmIo1nKCcLrV/OAmtf3N4kFna/aJqxsfEtnA== +"@types/node@*", "@types/node@20.4.1", "@types/node@>= 8": + version "20.4.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.1.tgz#a6033a8718653c50ac4962977e14d0f984d9527d" + integrity sha512-JIzsAvJeA/5iY6Y/OxZbv1lUcc8dNSE77lb2gnBH+/PJ3lFR1Ccvgwl5JWnHAkNHcRsT0TbpVOsiMKZ1F/yyJg== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -2150,10 +2150,10 @@ eslint-config-prettier@8.8.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348" integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== -eslint-plugin-jest@27.2.1: - version "27.2.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.2.1.tgz#b85b4adf41c682ea29f1f01c8b11ccc39b5c672c" - integrity sha512-l067Uxx7ZT8cO9NJuf+eJHvt6bqJyz2Z29wykyEdz/OtmcELQl2MQGQLX8J94O1cSJWAwUSEvCjwjA7KEK3Hmg== +eslint-plugin-jest@27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.2.2.tgz#be4ded5f91905d9ec89aa8968d39c71f3b072c0c" + integrity sha512-euzbp06F934Z7UDl5ZUaRPLAc9MKjh0rMPERrHT7UhlCEwgb25kBj37TvMgWeHZVkR5I9CayswrpoaqZU1RImw== dependencies: "@typescript-eslint/utils" "^5.10.0" @@ -4163,6 +4163,11 @@ punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" +querystringify@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== + react-is@^17.0.1: version "17.0.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.1.tgz#5b3531bd76a645a4c9fb6e693ed36419e3301339" @@ -4220,6 +4225,11 @@ require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== + resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" @@ -4328,19 +4338,21 @@ saxes@^5.0.1: xmlchars "^2.2.0" "semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== semver@7.x, semver@^7.2.1, semver@^7.3.2, semver@^7.3.5: - version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" semver@^6.0.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== set-blocking@^2.0.0: version "2.0.0" @@ -4656,13 +4668,14 @@ to-regex@^3.0.1, to-regex@^3.0.2: safe-regex "^1.1.0" tough-cookie@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4" - integrity sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg== + version "4.1.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf" + integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== dependencies: psl "^1.1.33" punycode "^2.1.1" - universalify "^0.1.2" + universalify "^0.2.0" + url-parse "^1.5.3" tr46@^2.1.0: version "2.1.0" @@ -4773,10 +4786,10 @@ universal-user-agent@^6.0.0: resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== -universalify@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== +universalify@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" + integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== unset-value@^1.0.0: version "1.0.0" @@ -4795,6 +4808,14 @@ urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" +url-parse@^1.5.3: + version "1.5.10" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" + integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== + dependencies: + querystringify "^2.1.1" + requires-port "^1.0.0" + use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy