commit
This commit is contained in:
parent
13ec9babde
commit
68f4b60012
1429 changed files with 2481 additions and 272836 deletions
22
node_modules/undici/index.js
generated
vendored
22
node_modules/undici/index.js
generated
vendored
|
@ -20,10 +20,6 @@ const DecoratorHandler = require('./lib/handler/DecoratorHandler')
|
|||
const RedirectHandler = require('./lib/handler/RedirectHandler')
|
||||
const createRedirectInterceptor = require('./lib/interceptor/redirectInterceptor')
|
||||
|
||||
const nodeVersion = process.versions.node.split('.')
|
||||
const nodeMajor = Number(nodeVersion[0])
|
||||
const nodeMinor = Number(nodeVersion[1])
|
||||
|
||||
let hasCrypto
|
||||
try {
|
||||
require('crypto')
|
||||
|
@ -100,7 +96,7 @@ function makeDispatcher (fn) {
|
|||
module.exports.setGlobalDispatcher = setGlobalDispatcher
|
||||
module.exports.getGlobalDispatcher = getGlobalDispatcher
|
||||
|
||||
if (nodeMajor > 16 || (nodeMajor === 16 && nodeMinor >= 8)) {
|
||||
if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
|
||||
let fetchImpl = null
|
||||
module.exports.fetch = async function fetch (resource) {
|
||||
if (!fetchImpl) {
|
||||
|
@ -125,18 +121,30 @@ if (nodeMajor > 16 || (nodeMajor === 16 && nodeMinor >= 8)) {
|
|||
|
||||
module.exports.setGlobalOrigin = setGlobalOrigin
|
||||
module.exports.getGlobalOrigin = getGlobalOrigin
|
||||
|
||||
const { CacheStorage } = require('./lib/cache/cachestorage')
|
||||
const { kConstruct } = require('./lib/cache/symbols')
|
||||
|
||||
// Cache & CacheStorage are tightly coupled with fetch. Even if it may run
|
||||
// in an older version of Node, it doesn't have any use without fetch.
|
||||
module.exports.caches = new CacheStorage(kConstruct)
|
||||
}
|
||||
|
||||
if (nodeMajor >= 16) {
|
||||
if (util.nodeMajor >= 16) {
|
||||
const { deleteCookie, getCookies, getSetCookies, setCookie } = require('./lib/cookies')
|
||||
|
||||
module.exports.deleteCookie = deleteCookie
|
||||
module.exports.getCookies = getCookies
|
||||
module.exports.getSetCookies = getSetCookies
|
||||
module.exports.setCookie = setCookie
|
||||
|
||||
const { parseMIMEType, serializeAMimeType } = require('./lib/fetch/dataURL')
|
||||
|
||||
module.exports.parseMIMEType = parseMIMEType
|
||||
module.exports.serializeAMimeType = serializeAMimeType
|
||||
}
|
||||
|
||||
if (nodeMajor >= 18 && hasCrypto) {
|
||||
if (util.nodeMajor >= 18 && hasCrypto) {
|
||||
const { WebSocket } = require('./lib/websocket/websocket')
|
||||
|
||||
module.exports.WebSocket = WebSocket
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue