File Explorer

/var/lang/lib/node_modules/npm/node_modules/make-fetch-happen/lib

This explorer reads the filesystem of the server it runs on, so /workspace/user isn't present here. Browsing and the terminal still work against this server's own disk from /.

index.js1.1 KB · 42 lines
const { FetchError, Headers, Request, Response } = require('minipass-fetch') const configureOptions = require('./options.js')const fetch = require('./fetch.js') const makeFetchHappen = (url, opts) => {  const options = configureOptions(opts)   const request = new Request(url, options)  return fetch(request, options)} makeFetchHappen.defaults = (defaultUrl, defaultOptions = {}, wrappedFetch = makeFetchHappen) => {  if (typeof defaultUrl === 'object') {    defaultOptions = defaultUrl    defaultUrl = null  }   const defaultedFetch = (url, options = {}) => {    const finalUrl = url || defaultUrl    const finalOptions = {      ...defaultOptions,      ...options,      headers: {        ...defaultOptions.headers,        ...options.headers,      },    }    return wrappedFetch(finalUrl, finalOptions)  }   defaultedFetch.defaults = (defaultUrl1, defaultOptions1 = {}) =>    makeFetchHappen.defaults(defaultUrl1, defaultOptions1, defaultedFetch)  return defaultedFetch} module.exports = makeFetchHappenmodule.exports.FetchError = FetchErrormodule.exports.Headers = Headersmodule.exports.Request = Requestmodule.exports.Response = Response