index-fetch.js 507 B

12345678910111213141516
  1. 'use strict'
  2. const fetchImpl = require('./lib/fetch').fetch
  3. module.exports.fetch = async function fetch (resource) {
  4. try {
  5. return await fetchImpl(...arguments)
  6. } catch (err) {
  7. Error.captureStackTrace(err, this)
  8. throw err
  9. }
  10. }
  11. module.exports.FormData = require('./lib/fetch/formdata').FormData
  12. module.exports.Headers = require('./lib/fetch/headers').Headers
  13. module.exports.Response = require('./lib/fetch/response').Response
  14. module.exports.Request = require('./lib/fetch/request').Request