How to use the node-fetch.call function in node-fetch

To help you get started, we’ve selected a few node-fetch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ianlancaster / react-native-web-quickstart / App / Utilities / isomorphic-fetch / fetch-npm-node.js View on Github external
module.exports = function (url, options) {
  if (/^\/\//.test(url)) {
    url = 'https:' + url
  }
  return realFetch.call(this, url, options)
}
github nfl / react-wildcat / packages / react-wildcat / src / polyfills / fetch.js View on Github external
module.exports = function fetch(url, options) {
    if (/^\/\//.test(url)) {
        url = `https:${url}`;
    }

    return realFetch.call(this, url, options);
};
github lucasfeliciano / fetch-everywhere / fetch-npm-node.js View on Github external
module.exports = function(url, options) {
	if (/^\/\//.test(url)) {
		url = 'https:' + url;
	}
	return realFetch.call(this, url, options);
};
github sebastian-software / edge / packages / edge-core / src / server.js View on Github external
global.fetch = function fetch(url, options) {
    const normalized = (/^\/\//).test(url) ? `https:${url}` : url
    return realFetch.call(this, normalized, options)
  }
  global.Response = realFetch.Response
github peter-mouland / react-lego / src / server / utils / node-fetch.js View on Github external
module.exports = (url, options) => {
  const secureUrl = (/^\/\//.test(url))
    ? `https:${url}`
    : url;
  return realFetch.call(this, secureUrl, options);
};
github Shopify / quilt / packages / polyfills / src / fetch.node.ts View on Github external
function wrappedFetch(url: string | Request, options) {
  if (typeof url !== 'string') {
    return nodeFetch.call(this, url, options);
  }

  const finalURL = url.startsWith('//') ? `https:${url}` : url;
  return nodeFetch.call(this, finalURL, options);
}
github Shopify / quilt / packages / polyfills / src / fetch.node.ts View on Github external
function wrappedFetch(url: string | Request, options) {
  if (typeof url !== 'string') {
    return nodeFetch.call(this, url, options);
  }

  const finalURL = url.startsWith('//') ? `https:${url}` : url;
  return nodeFetch.call(this, finalURL, options);
}