From ca5e10455370a9523e05b2c787ba7e4aeb21b90d Mon Sep 17 00:00:00 2001 From: tsctx <91457664+tsctx@users.noreply.github.com> Date: Sun, 3 Dec 2023 10:57:41 +0900 Subject: [PATCH] chore: fix typo --- benchmarks/benchmark-https.js | 2 +- benchmarks/benchmark.js | 2 +- docs/api/BalancedPool.md | 2 +- lib/client.js | 8 ++++---- lib/fetch/dataURL.js | 2 +- lib/fetch/index.js | 4 ++-- lib/handler/RedirectHandler.js | 4 ++-- test/balanced-pool.js | 2 +- test/http2.js | 8 ++++---- test/pool.js | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/benchmarks/benchmark-https.js b/benchmarks/benchmark-https.js index b42b01d0329..b2ec951ddbc 100644 --- a/benchmarks/benchmark-https.js +++ b/benchmarks/benchmark-https.js @@ -14,7 +14,7 @@ const ca = readFileSync(path.join(__dirname, '..', 'test', 'fixtures', 'ca.pem') const servername = 'agent1' const iterations = (parseInt(process.env.SAMPLES, 10) || 10) + 1 -const errorThreshold = parseInt(process.env.ERROR_TRESHOLD, 10) || 3 +const errorThreshold = parseInt(process.env.ERROR_THRESHOLD, 10) || 3 const connections = parseInt(process.env.CONNECTIONS, 10) || 50 const pipelining = parseInt(process.env.PIPELINING, 10) || 10 const parallelRequests = parseInt(process.env.PARALLEL, 10) || 100 diff --git a/benchmarks/benchmark.js b/benchmarks/benchmark.js index 95e301771c7..94ac1b45a81 100644 --- a/benchmarks/benchmark.js +++ b/benchmarks/benchmark.js @@ -10,7 +10,7 @@ const { isMainThread } = require('worker_threads') const { Pool, Client, fetch, Agent, setGlobalDispatcher } = require('..') const iterations = (parseInt(process.env.SAMPLES, 10) || 10) + 1 -const errorThreshold = parseInt(process.env.ERROR_TRESHOLD, 10) || 3 +const errorThreshold = parseInt(process.env.ERROR_THRESHOLD, 10) || 3 const connections = parseInt(process.env.CONNECTIONS, 10) || 50 const pipelining = parseInt(process.env.PIPELINING, 10) || 10 const parallelRequests = parseInt(process.env.PARALLEL, 10) || 100 diff --git a/docs/api/BalancedPool.md b/docs/api/BalancedPool.md index 290c734c022..183ef523185 100644 --- a/docs/api/BalancedPool.md +++ b/docs/api/BalancedPool.md @@ -50,7 +50,7 @@ Arguments: ### `BalancedPool.removeUpstream(upstream)` -Removes an upstream that was previously addded. +Removes an upstream that was previously added. ### `BalancedPool.close([callback])` diff --git a/lib/client.js b/lib/client.js index 22cb39039da..af16fd16d3e 100644 --- a/lib/client.js +++ b/lib/client.js @@ -249,7 +249,7 @@ class Client extends DispatcherBase { } if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) { - throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0') + throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0') } if (typeof connect !== 'function') { @@ -296,7 +296,7 @@ class Client extends DispatcherBase { ? null : { // streams: null, // Fixed queue of streams - For future support of `push` - openStreams: 0, // Keep track of them to decide wether or not unref the session + openStreams: 0, // Keep track of them to decide whether or not unref the session maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server } this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}` @@ -1706,7 +1706,7 @@ function writeH2 (client, session, request) { } // https://tools.ietf.org/html/rfc7540#section-8.3 - // :path and :scheme headers must be omited when sending CONNECT + // :path and :scheme headers must be omitted when sending CONNECT headers[HTTP2_HEADER_PATH] = path headers[HTTP2_HEADER_SCHEME] = 'https' @@ -1833,7 +1833,7 @@ function writeH2 (client, session, request) { // }) // stream.on('push', headers => { - // // TODO(HTTP/2): Suppor push + // // TODO(HTTP/2): Support push // }) // stream.on('trailers', headers => { diff --git a/lib/fetch/dataURL.js b/lib/fetch/dataURL.js index 5c1a1760dd0..5d6b3940526 100644 --- a/lib/fetch/dataURL.js +++ b/lib/fetch/dataURL.js @@ -549,7 +549,7 @@ function serializeAMimeType (mimeType) { // 4. If value does not solely contain HTTP token code // points or value is the empty string, then: if (!HTTP_TOKEN_CODEPOINTS.test(value)) { - // 1. Precede each occurence of U+0022 (") or + // 1. Precede each occurrence of U+0022 (") or // U+005C (\) in value with U+005C (\). value = value.replace(/(\\|")/g, '\\$1') diff --git a/lib/fetch/index.js b/lib/fetch/index.js index 01db3aeb65f..fd46bdbfec4 100644 --- a/lib/fetch/index.js +++ b/lib/fetch/index.js @@ -403,9 +403,9 @@ function fetching ({ // 5. Let timingInfo be a new fetch timing info whose start time and // post-redirect start time are the coarsened shared current time given // crossOriginIsolatedCapability. - const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability) + const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability) const timingInfo = createOpaqueTimingInfo({ - startTime: currenTime + startTime: currentTime }) // 6. Let fetchParams be a new fetch params whose diff --git a/lib/handler/RedirectHandler.js b/lib/handler/RedirectHandler.js index baca27ed147..34bba185d96 100644 --- a/lib/handler/RedirectHandler.js +++ b/lib/handler/RedirectHandler.js @@ -135,7 +135,7 @@ class RedirectHandler { For status 300, which is "Multiple Choices", the spec mentions both generating a Location response header AND a response body with the other possible location to follow. - Since the spec explicitily chooses not to specify a format for such body and leave it to + Since the spec explicitly chooses not to specify a format for such body and leave it to servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it. */ } else { @@ -151,7 +151,7 @@ class RedirectHandler { TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections and neither are useful if present. - See comment on onData method above for more detailed informations. + See comment on onData method above for more detailed information. */ this.location = null diff --git a/test/balanced-pool.js b/test/balanced-pool.js index d20f926e931..7806652d95b 100644 --- a/test/balanced-pool.js +++ b/test/balanced-pool.js @@ -482,7 +482,7 @@ const cases = [ for (const [index, { config, expected, expectedRatios, iterations = 9, expectedConnectionRefusedErrors = 0, expectedSocketErrors = 0, maxWeightPerServer, errorPenalty = 10, only = false, skip = false }] of cases.entries()) { test(`weighted round robin - case ${index}`, { only, skip }, async (t) => { - // cerate an array to store succesfull reqeusts + // create an array to store successful requests const requestLog = [] // create instances of the test servers according to the config diff --git a/test/http2.js b/test/http2.js index 71b77493255..06c79cda8e9 100644 --- a/test/http2.js +++ b/test/http2.js @@ -282,7 +282,7 @@ test('Should support H2 GOAWAY (server-side)', async t => { t.equal(err.message, 'HTTP/2: "GOAWAY" frame received with code 204') }) -test('Should throw if bad allowH2 has been pased', async t => { +test('Should throw if bad allowH2 has been passed', async t => { try { // eslint-disable-next-line new Client('https://localhost:1000', { @@ -294,7 +294,7 @@ test('Should throw if bad allowH2 has been pased', async t => { } }) -test('Should throw if bad maxConcurrentStreams has been pased', async t => { +test('Should throw if bad maxConcurrentStreams has been passed', async t => { try { // eslint-disable-next-line new Client('https://localhost:1000', { @@ -305,7 +305,7 @@ test('Should throw if bad maxConcurrentStreams has been pased', async t => { } catch (error) { t.equal( error.message, - 'maxConcurrentStreams must be a possitive integer, greater than 0' + 'maxConcurrentStreams must be a positive integer, greater than 0' ) } @@ -319,7 +319,7 @@ test('Should throw if bad maxConcurrentStreams has been pased', async t => { } catch (error) { t.equal( error.message, - 'maxConcurrentStreams must be a possitive integer, greater than 0' + 'maxConcurrentStreams must be a positive integer, greater than 0' ) } }) diff --git a/test/pool.js b/test/pool.js index 8cf7195bb21..816bc5e2d31 100644 --- a/test/pool.js +++ b/test/pool.js @@ -24,7 +24,7 @@ const { errors } = require('..') -test('throws when connection is inifinite', (t) => { +test('throws when connection is infinite', (t) => { t.plan(2) try {