How to use the node-fetch.apply 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 node-webrtc / node-webrtc / test / web-platform-tests / run-single-wpt.js View on Github external
window.fetch = function safeFetch() {
        const args = [].slice.call(arguments);
        const url = args[0];
        try {
          new window.URL(url);
        } catch (error) {
          args[0] = window.location.protocol + '//' + window.location.host + url;
        }
        return fetch.apply(null, args);
      };