From bd9ea5ccee4633a2b37ca4c7471db74ab9930a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Thu, 2 Jan 2025 03:26:05 +0000 Subject: [PATCH] Fix typos --- docs/docs/api/CacheStore.md | 2 +- docs/docs/api/ProxyAgent.md | 2 +- lib/handler/cache-handler.js | 2 +- lib/interceptor/cache.js | 4 ++-- lib/util/cache.js | 2 +- lib/web/fetch/body.js | 2 +- test/interceptors/cache.js | 2 +- test/utils/date.js | 6 +++--- test/websocket/issue-2844.js | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/docs/api/CacheStore.md b/docs/docs/api/CacheStore.md index 7cd19e08786..0ac88f5a1f5 100644 --- a/docs/docs/api/CacheStore.md +++ b/docs/docs/api/CacheStore.md @@ -26,7 +26,7 @@ The `SqliteCacheStore` is only exposed if the `node:sqlite` api is present. - `location` - The location of the SQLite database to use. Default `:memory:`. - `maxCount` - The maximum number of entries to store in the database. Default `Infinity`. -- `maxEntrySize` - The maximum size in bytes that a resposne's body can be. If a response's body is greater than or equal to this, the response will not be cached. Default `Infinity`. +- `maxEntrySize` - The maximum size in bytes that a response's body can be. If a response's body is greater than or equal to this, the response will not be cached. Default `Infinity`. ## Defining a Custom Cache Store diff --git a/docs/docs/api/ProxyAgent.md b/docs/docs/api/ProxyAgent.md index 932716ae795..aac1b7c0a78 100644 --- a/docs/docs/api/ProxyAgent.md +++ b/docs/docs/api/ProxyAgent.md @@ -15,7 +15,7 @@ Returns: `ProxyAgent` ### Parameter: `ProxyAgentOptions` Extends: [`AgentOptions`](/docs/docs/api/Agent.md#parameter-agentoptions) -> It ommits `AgentOptions#connect`. +> It omits `AgentOptions#connect`. * **uri** `string | URL` (required) - The URI of the proxy server. This can be provided as a string, as an instance of the URL class, or as an object with a `uri` property of type string. If the `uri` is provided as a string or `uri` is an object with an `uri` property of type string, then it will be parsed into a `URL` object according to the [WHATWG URL Specification](https://url.spec.whatwg.org). diff --git a/lib/handler/cache-handler.js b/lib/handler/cache-handler.js index e02ff9c9d72..4c702603ab7 100644 --- a/lib/handler/cache-handler.js +++ b/lib/handler/cache-handler.js @@ -119,7 +119,7 @@ class CacheHandler { !heuristicallyCacheable && !this.#cacheByDefault ) { - // Don't have anything to tell us this response is cachable and we're not + // Don't have anything to tell us this response is cacheable and we're not // caching by default return downstreamOnHeaders() } diff --git a/lib/interceptor/cache.js b/lib/interceptor/cache.js index 6d1225680e7..9bda23a9876 100644 --- a/lib/interceptor/cache.js +++ b/lib/interceptor/cache.js @@ -296,11 +296,11 @@ module.exports = (opts = {}) => { assertCacheMethods(methods, 'opts.methods') if (typeof cacheByDefault !== 'undefined' && typeof cacheByDefault !== 'number') { - throw new TypeError(`exepcted opts.cacheByDefault to be number or undefined, got ${typeof cacheByDefault}`) + throw new TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof cacheByDefault}`) } if (typeof type !== 'undefined' && type !== 'shared' && type !== 'private') { - throw new TypeError(`exepcted opts.type to be shared, private, or undefined, got ${typeof type}`) + throw new TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof type}`) } const globalOpts = { diff --git a/lib/util/cache.js b/lib/util/cache.js index 35c53512b2a..55cf50cd215 100644 --- a/lib/util/cache.js +++ b/lib/util/cache.js @@ -280,7 +280,7 @@ function parseVaryHeader (varyHeader, headers) { /** * Note: this deviates from the spec a little. Empty etags ("", W/"") are valid, - * however, including them in cached resposnes serves little to no purpose. + * however, including them in cached responses serves little to no purpose. * * @see https://www.rfc-editor.org/rfc/rfc9110.html#name-etag * diff --git a/lib/web/fetch/body.js b/lib/web/fetch/body.js index b092b3c83db..d476dcf0d70 100644 --- a/lib/web/fetch/body.js +++ b/lib/web/fetch/body.js @@ -120,7 +120,7 @@ function extractBody (object, keepalive = false) { // Set action to this step: run the multipart/form-data // encoding algorithm, with object’s entry list and UTF-8. - // - This ensures that the body is immutable and can't be changed afterwords + // - This ensures that the body is immutable and can't be changed afterwards // - That the content-length is calculated in advance. // - And that all parts are pre-encoded and ready to be sent. diff --git a/test/interceptors/cache.js b/test/interceptors/cache.js index dc120c60b7b..aa11646aefb 100644 --- a/test/interceptors/cache.js +++ b/test/interceptors/cache.js @@ -480,7 +480,7 @@ describe('Cache Interceptor', () => { 'proxy-connection', 'te', 'upgrade', - // Headers we need to specifiy to be stripped + // Headers we need to specify to be stripped 'should-be-stripped' ] diff --git a/test/utils/date.js b/test/utils/date.js index f87f77db5c5..b3d071e4d5b 100644 --- a/test/utils/date.js +++ b/test/utils/date.js @@ -10,7 +10,7 @@ describe('parseHttpDate', () => { 'Sun, 06 Nov 1994 08:49:37 GMT': new Date(Date.UTC(1994, 10, 6, 8, 49, 37)), 'Thu, 18 Aug 1950 02:01:18 GMT': new Date(Date.UTC(1950, 7, 18, 2, 1, 18)), 'Wed, 11 Dec 2024 23:20:57 GMT': new Date(Date.UTC(2024, 11, 11, 23, 20, 57)), - 'Wed, aa Dec 2024 23:20:57 GMT': undefined, // NaN daty + 'Wed, aa Dec 2024 23:20:57 GMT': undefined, // NaN day 'aaa, 06 Dec 2024 23:20:57 GMT': undefined, // Invalid day name 'Wed, 01 aaa 2024 23:20:57 GMT': undefined, // Invalid month 'Wed, 6 Dec 2024 23:20:07 GMT': undefined, // No leading zero @@ -33,7 +33,7 @@ describe('parseHttpDate', () => { 'Sunday, 06-Nov-94 08:49:37 GMT': new Date(Date.UTC(1994, 10, 6, 8, 49, 37)), 'Thursday, 18-Aug-50 02:01:18 GMT': new Date(Date.UTC(2050, 7, 18, 2, 1, 18)), 'Wednesday, 11-Dec-24 23:20:57 GMT': new Date(Date.UTC(2024, 11, 11, 23, 20, 57)), - 'Wednesday, aa Dec 2024 23:20:57 GMT': undefined, // NaN daty + 'Wednesday, aa Dec 2024 23:20:57 GMT': undefined, // NaN day 'aaa, 06 Dec 2024 23:20:57 GMT': undefined, // Invalid day name 'Wednesday, 01-aaa-24 23:20:57 GMT': undefined, // Invalid month 'Wednesday, 6-Dec-24 23:20:07 GMT': undefined, // No leading zero @@ -56,7 +56,7 @@ describe('parseHttpDate', () => { 'Sun Nov 6 08:49:37 1994': new Date(Date.UTC(1994, 10, 6, 8, 49, 37)), 'Thu Aug 18 02:01:18 1950': new Date(Date.UTC(1950, 7, 18, 2, 1, 18)), 'Wed Dec 11 23:20:57 2024': new Date(Date.UTC(2024, 11, 11, 23, 20, 57)), - 'Wed Dec aa 23:20:57 2024': undefined, // NaN daty + 'Wed Dec aa 23:20:57 2024': undefined, // NaN day 'aaa Dec 06 23:20:57 2024': undefined, // Invalid day name 'Wed aaa 01 23:20:57 2024': undefined, // Invalid month 'Wed Dec 6 23:20:07 2024': undefined, // No leading zero diff --git a/test/websocket/issue-2844.js b/test/websocket/issue-2844.js index d103a1722ff..cbecbf3665c 100644 --- a/test/websocket/issue-2844.js +++ b/test/websocket/issue-2844.js @@ -40,7 +40,7 @@ test('The server must reply with at least one subprotocol the client sends', asy await completed }) -test('The connection fails when the client sends subprotocols that the server does not responc with', async (t) => { +test('The connection fails when the client sends subprotocols that the server does not response with', async (t) => { const { completed, fail, ok } = tspl(t, { plan: 1 }) const wss = new WebSocketServer({