Skip to content

Commit 80a52c7

Browse files
committed
refactor: move web stuff into their own folder
Refs: #2732
1 parent 02107fe commit 80a52c7

40 files changed

+23
-23
lines changed

index-fetch.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
const fetchImpl = require('./lib/fetch').fetch
3+
const fetchImpl = require('./lib/web/fetch').fetch
44

55
module.exports.fetch = function fetch (resource, init = undefined) {
66
return fetchImpl(resource, init).catch((err) => {
@@ -10,12 +10,12 @@ module.exports.fetch = function fetch (resource, init = undefined) {
1010
throw err
1111
})
1212
}
13-
module.exports.FormData = require('./lib/fetch/formdata').FormData
14-
module.exports.Headers = require('./lib/fetch/headers').Headers
15-
module.exports.Response = require('./lib/fetch/response').Response
16-
module.exports.Request = require('./lib/fetch/request').Request
13+
module.exports.FormData = require('./lib/web/fetch/formdata').FormData
14+
module.exports.Headers = require('./lib/web/fetch/headers').Headers
15+
module.exports.Response = require('./lib/web/fetch/response').Response
16+
module.exports.Request = require('./lib/web/fetch/request').Request
1717

18-
module.exports.WebSocket = require('./lib/websocket/websocket').WebSocket
19-
module.exports.MessageEvent = require('./lib/websocket/events').MessageEvent
18+
module.exports.WebSocket = require('./lib/web/websocket/websocket').WebSocket
19+
module.exports.MessageEvent = require('./lib/web/websocket/events').MessageEvent
2020

21-
module.exports.EventSource = require('./lib/eventsource/eventsource').EventSource
21+
module.exports.EventSource = require('./lib/web/eventsource/eventsource').EventSource

index.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function makeDispatcher (fn) {
9494
module.exports.setGlobalDispatcher = setGlobalDispatcher
9595
module.exports.getGlobalDispatcher = getGlobalDispatcher
9696

97-
const fetchImpl = require('./lib/fetch').fetch
97+
const fetchImpl = require('./lib/web/fetch').fetch
9898
module.exports.fetch = async function fetch (init, options = undefined) {
9999
try {
100100
return await fetchImpl(init, options)
@@ -106,39 +106,39 @@ module.exports.fetch = async function fetch (init, options = undefined) {
106106
throw err
107107
}
108108
}
109-
module.exports.Headers = require('./lib/fetch/headers').Headers
110-
module.exports.Response = require('./lib/fetch/response').Response
111-
module.exports.Request = require('./lib/fetch/request').Request
112-
module.exports.FormData = require('./lib/fetch/formdata').FormData
113-
module.exports.File = require('./lib/fetch/file').File
114-
module.exports.FileReader = require('./lib/fileapi/filereader').FileReader
109+
module.exports.Headers = require('./lib/web/fetch/headers').Headers
110+
module.exports.Response = require('./lib/web/fetch/response').Response
111+
module.exports.Request = require('./lib/web/fetch/request').Request
112+
module.exports.FormData = require('./lib/web/fetch/formdata').FormData
113+
module.exports.File = require('./lib/web/fetch/file').File
114+
module.exports.FileReader = require('./lib/web/fileapi/filereader').FileReader
115115

116-
const { setGlobalOrigin, getGlobalOrigin } = require('./lib/fetch/global')
116+
const { setGlobalOrigin, getGlobalOrigin } = require('./lib/web/fetch/global')
117117

118118
module.exports.setGlobalOrigin = setGlobalOrigin
119119
module.exports.getGlobalOrigin = getGlobalOrigin
120120

121-
const { CacheStorage } = require('./lib/cache/cachestorage')
122-
const { kConstruct } = require('./lib/cache/symbols')
121+
const { CacheStorage } = require('./lib/web/cache/cachestorage')
122+
const { kConstruct } = require('./lib/web/cache/symbols')
123123

124124
// Cache & CacheStorage are tightly coupled with fetch. Even if it may run
125125
// in an older version of Node, it doesn't have any use without fetch.
126126
module.exports.caches = new CacheStorage(kConstruct)
127127

128-
const { deleteCookie, getCookies, getSetCookies, setCookie } = require('./lib/cookies')
128+
const { deleteCookie, getCookies, getSetCookies, setCookie } = require('./lib/web/cookies')
129129

130130
module.exports.deleteCookie = deleteCookie
131131
module.exports.getCookies = getCookies
132132
module.exports.getSetCookies = getSetCookies
133133
module.exports.setCookie = setCookie
134134

135-
const { parseMIMEType, serializeAMimeType } = require('./lib/fetch/dataURL')
135+
const { parseMIMEType, serializeAMimeType } = require('./lib/web/fetch/dataURL')
136136

137137
module.exports.parseMIMEType = parseMIMEType
138138
module.exports.serializeAMimeType = serializeAMimeType
139139

140-
const { CloseEvent, ErrorEvent, MessageEvent } = require('./lib/websocket/events')
141-
module.exports.WebSocket = require('./lib/websocket/websocket').WebSocket
140+
const { CloseEvent, ErrorEvent, MessageEvent } = require('./lib/web/websocket/events')
141+
module.exports.WebSocket = require('./lib/web/websocket/websocket').WebSocket
142142
module.exports.CloseEvent = CloseEvent
143143
module.exports.ErrorEvent = ErrorEvent
144144
module.exports.MessageEvent = MessageEvent
@@ -154,6 +154,6 @@ module.exports.MockPool = MockPool
154154
module.exports.MockAgent = MockAgent
155155
module.exports.mockErrors = mockErrors
156156

157-
const { EventSource } = require('./lib/eventsource/eventsource')
157+
const { EventSource } = require('./lib/web/eventsource/eventsource')
158158

159159
module.exports.EventSource = EventSource
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)