diff --git a/index.js b/index.js index 77fa2b9ffde..f72ea8a540e 100644 --- a/index.js +++ b/index.js @@ -16,11 +16,11 @@ const MockClient = require('./lib/mock/mock-client') const MockAgent = require('./lib/mock/mock-agent') const MockPool = require('./lib/mock/mock-pool') const mockErrors = require('./lib/mock/mock-errors') -const RetryHandler = require('./lib/handler/RetryHandler') +const RetryHandler = require('./lib/handler/retry-handler') const { getGlobalDispatcher, setGlobalDispatcher } = require('./lib/global') -const DecoratorHandler = require('./lib/handler/DecoratorHandler') -const RedirectHandler = require('./lib/handler/RedirectHandler') -const createRedirectInterceptor = require('./lib/interceptor/redirectInterceptor') +const DecoratorHandler = require('./lib/handler/decorator-handler') +const RedirectHandler = require('./lib/handler/redirect-handler') +const createRedirectInterceptor = require('./lib/interceptor/redirect-interceptor') Object.assign(Dispatcher.prototype, api) @@ -134,7 +134,7 @@ module.exports.getCookies = getCookies module.exports.getSetCookies = getSetCookies module.exports.setCookie = setCookie -const { parseMIMEType, serializeAMimeType } = require('./lib/web/fetch/dataURL') +const { parseMIMEType, serializeAMimeType } = require('./lib/web/fetch/data-url') module.exports.parseMIMEType = parseMIMEType module.exports.serializeAMimeType = serializeAMimeType diff --git a/lib/dispatcher/agent.js b/lib/dispatcher/agent.js index d91c412382f..98f1486cac0 100644 --- a/lib/dispatcher/agent.js +++ b/lib/dispatcher/agent.js @@ -6,7 +6,7 @@ const DispatcherBase = require('./dispatcher-base') const Pool = require('./pool') const Client = require('./client') const util = require('../core/util') -const createRedirectInterceptor = require('../interceptor/redirectInterceptor') +const createRedirectInterceptor = require('../interceptor/redirect-interceptor') const kOnConnect = Symbol('onConnect') const kOnDisconnect = Symbol('onDisconnect') diff --git a/lib/dispatcher/client.js b/lib/dispatcher/client.js index 29dde5cdab3..e7fb02fb34a 100644 --- a/lib/dispatcher/client.js +++ b/lib/dispatcher/client.js @@ -358,7 +358,7 @@ class Client extends DispatcherBase { } } -const createRedirectInterceptor = require('../interceptor/redirectInterceptor.js') +const createRedirectInterceptor = require('../interceptor/redirect-interceptor.js') function onError (client, err) { if ( diff --git a/lib/dispatcher/retry-agent.js b/lib/dispatcher/retry-agent.js index 2ca82b0d02c..0c2120d6f26 100644 --- a/lib/dispatcher/retry-agent.js +++ b/lib/dispatcher/retry-agent.js @@ -1,7 +1,7 @@ 'use strict' const Dispatcher = require('./dispatcher') -const RetryHandler = require('../handler/RetryHandler') +const RetryHandler = require('../handler/retry-handler') class RetryAgent extends Dispatcher { #agent = null diff --git a/lib/handler/DecoratorHandler.js b/lib/handler/decorator-handler.js similarity index 100% rename from lib/handler/DecoratorHandler.js rename to lib/handler/decorator-handler.js diff --git a/lib/handler/RedirectHandler.js b/lib/handler/redirect-handler.js similarity index 100% rename from lib/handler/RedirectHandler.js rename to lib/handler/redirect-handler.js diff --git a/lib/handler/RetryHandler.js b/lib/handler/retry-handler.js similarity index 100% rename from lib/handler/RetryHandler.js rename to lib/handler/retry-handler.js diff --git a/lib/interceptor/redirectInterceptor.js b/lib/interceptor/redirect-interceptor.js similarity index 90% rename from lib/interceptor/redirectInterceptor.js rename to lib/interceptor/redirect-interceptor.js index 7cc035e096c..896ee8db939 100644 --- a/lib/interceptor/redirectInterceptor.js +++ b/lib/interceptor/redirect-interceptor.js @@ -1,6 +1,6 @@ 'use strict' -const RedirectHandler = require('../handler/RedirectHandler') +const RedirectHandler = require('../handler/redirect-handler') function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { return (dispatch) => { diff --git a/lib/web/cache/util.js b/lib/web/cache/util.js index d168d45351b..5ac9d846ddc 100644 --- a/lib/web/cache/util.js +++ b/lib/web/cache/util.js @@ -1,7 +1,7 @@ 'use strict' const assert = require('node:assert') -const { URLSerializer } = require('../fetch/dataURL') +const { URLSerializer } = require('../fetch/data-url') const { isValidHeaderName } = require('../fetch/util') /** diff --git a/lib/web/cookies/parse.js b/lib/web/cookies/parse.js index 8d60d1cb69b..3c48c26b93f 100644 --- a/lib/web/cookies/parse.js +++ b/lib/web/cookies/parse.js @@ -2,7 +2,7 @@ const { maxNameValuePairSize, maxAttributeValueSize } = require('./constants') const { isCTLExcludingHtab } = require('./util') -const { collectASequenceOfCodePointsFast } = require('../fetch/dataURL') +const { collectASequenceOfCodePointsFast } = require('../fetch/data-url') const assert = require('node:assert') /** diff --git a/lib/web/eventsource/eventsource.js b/lib/web/eventsource/eventsource.js index 6b34976e31b..cf5093e1bdf 100644 --- a/lib/web/eventsource/eventsource.js +++ b/lib/web/eventsource/eventsource.js @@ -6,7 +6,7 @@ const { makeRequest } = require('../fetch/request') const { getGlobalOrigin } = require('../fetch/global') const { webidl } = require('../fetch/webidl') const { EventSourceStream } = require('./eventsource-stream') -const { parseMIMEType } = require('../fetch/dataURL') +const { parseMIMEType } = require('../fetch/data-url') const { MessageEvent } = require('../websocket/events') const { isNetworkError } = require('../fetch/response') const { delay } = require('./util') diff --git a/lib/web/fetch/body.js b/lib/web/fetch/body.js index 4b81fcedc42..932df3e6532 100644 --- a/lib/web/fetch/body.js +++ b/lib/web/fetch/body.js @@ -19,7 +19,7 @@ const assert = require('node:assert') const { isErrored } = require('../../core/util') const { isArrayBuffer } = require('node:util/types') const { File: UndiciFile } = require('./file') -const { serializeAMimeType } = require('./dataURL') +const { serializeAMimeType } = require('./data-url') const { Readable } = require('node:stream') /** @type {globalThis['File']} */ diff --git a/lib/web/fetch/dataURL.js b/lib/web/fetch/data-url.js similarity index 99% rename from lib/web/fetch/dataURL.js rename to lib/web/fetch/data-url.js index ee7f72e9c93..a966ace3b8e 100644 --- a/lib/web/fetch/dataURL.js +++ b/lib/web/fetch/data-url.js @@ -1,3 +1,5 @@ +'use strict' + const assert = require('node:assert') const encoder = new TextEncoder() diff --git a/lib/web/fetch/file.js b/lib/web/fetch/file.js index 61a232017b2..e00b58cdb58 100644 --- a/lib/web/fetch/file.js +++ b/lib/web/fetch/file.js @@ -5,7 +5,7 @@ const { types } = require('node:util') const { kState } = require('./symbols') const { isBlobLike } = require('./util') const { webidl } = require('./webidl') -const { parseMIMEType, serializeAMimeType } = require('./dataURL') +const { parseMIMEType, serializeAMimeType } = require('./data-url') const { kEnumerableProperty } = require('../../core/util') const encoder = new TextEncoder() diff --git a/lib/web/fetch/index.js b/lib/web/fetch/index.js index e7115b2e7e6..0ae6a704e11 100644 --- a/lib/web/fetch/index.js +++ b/lib/web/fetch/index.js @@ -60,7 +60,7 @@ const { const EE = require('node:events') const { Readable, pipeline } = require('node:stream') const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor, bufferToLowerCasedHeaderName } = require('../../core/util') -const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require('./dataURL') +const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require('./data-url') const { getGlobalDispatcher } = require('../../global') const { webidl } = require('./webidl') const { STATUS_CODES } = require('node:http') diff --git a/lib/web/fetch/request.js b/lib/web/fetch/request.js index f8759626a1e..afe92499267 100644 --- a/lib/web/fetch/request.js +++ b/lib/web/fetch/request.js @@ -27,7 +27,7 @@ const { kEnumerableProperty } = util const { kHeaders, kSignal, kState, kGuard, kRealm, kDispatcher } = require('./symbols') const { webidl } = require('./webidl') const { getGlobalOrigin } = require('./global') -const { URLSerializer } = require('./dataURL') +const { URLSerializer } = require('./data-url') const { kHeadersList, kConstruct } = require('../../core/symbols') const assert = require('node:assert') const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require('node:events') diff --git a/lib/web/fetch/response.js b/lib/web/fetch/response.js index 355c2847aba..e31f619590f 100644 --- a/lib/web/fetch/response.js +++ b/lib/web/fetch/response.js @@ -21,7 +21,7 @@ const { kState, kHeaders, kGuard, kRealm } = require('./symbols') const { webidl } = require('./webidl') const { FormData } = require('./formdata') const { getGlobalOrigin } = require('./global') -const { URLSerializer } = require('./dataURL') +const { URLSerializer } = require('./data-url') const { kHeadersList, kConstruct } = require('../../core/symbols') const assert = require('node:assert') const { types } = require('node:util') diff --git a/lib/web/fetch/util.js b/lib/web/fetch/util.js index 49ab59e8876..92bcb6cb202 100644 --- a/lib/web/fetch/util.js +++ b/lib/web/fetch/util.js @@ -4,7 +4,7 @@ const { Transform } = require('node:stream') const zlib = require('node:zlib') const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require('./constants') const { getGlobalOrigin } = require('./global') -const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require('./dataURL') +const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require('./data-url') const { performance } = require('node:perf_hooks') const { isBlobLike, ReadableStreamFrom, isValidHTTPToken } = require('../../core/util') const assert = require('node:assert') diff --git a/lib/web/fileapi/util.js b/lib/web/fileapi/util.js index ce8b10aa2de..9110b872a81 100644 --- a/lib/web/fileapi/util.js +++ b/lib/web/fileapi/util.js @@ -9,7 +9,7 @@ const { } = require('./symbols') const { ProgressEvent } = require('./progressevent') const { getEncoding } = require('./encoding') -const { serializeAMimeType, parseMIMEType } = require('../fetch/dataURL') +const { serializeAMimeType, parseMIMEType } = require('../fetch/data-url') const { types } = require('node:util') const { StringDecoder } = require('string_decoder') const { btoa } = require('node:buffer') diff --git a/lib/web/websocket/websocket.js b/lib/web/websocket/websocket.js index 0072da48193..c08f02cbe38 100644 --- a/lib/web/websocket/websocket.js +++ b/lib/web/websocket/websocket.js @@ -1,7 +1,7 @@ 'use strict' const { webidl } = require('../fetch/webidl') -const { URLSerializer } = require('../fetch/dataURL') +const { URLSerializer } = require('../fetch/data-url') const { getGlobalOrigin } = require('../fetch/global') const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = require('./constants') const { diff --git a/test/fetch/data-uri.js b/test/fetch/data-uri.js index 7c99c8e9422..feab3408d90 100644 --- a/test/fetch/data-uri.js +++ b/test/fetch/data-uri.js @@ -9,7 +9,7 @@ const { stringPercentDecode, parseMIMEType, collectAnHTTPQuotedString -} = require('../../lib/web/fetch/dataURL') +} = require('../../lib/web/fetch/data-url') const { fetch } = require('../..') test('https://url.spec.whatwg.org/#concept-url-serializer', async (t) => { diff --git a/test/jest/interceptor.test.js b/test/jest/interceptor.test.js index 9caa0758936..84e6210fb8d 100644 --- a/test/jest/interceptor.test.js +++ b/test/jest/interceptor.test.js @@ -2,7 +2,7 @@ const { createServer } = require('node:http') const { Agent, request } = require('../../index') -const DecoratorHandler = require('../../lib/handler/DecoratorHandler') +const DecoratorHandler = require('../../lib/handler/decorator-handler') /* global expect */ const defaultOpts = { keepAliveTimeout: 10, keepAliveMaxTimeout: 10 }