2015-02-20 04:10:52 +00:00
|
|
|
/**
|
2015-03-23 20:35:08 +00:00
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-02-20 04:10:52 +00:00
|
|
|
*
|
2018-05-11 02:06:46 +00:00
|
|
|
* @format
|
2015-02-20 04:10:52 +00:00
|
|
|
*/
|
2017-07-10 19:01:50 +00:00
|
|
|
|
2018-05-11 02:06:46 +00:00
|
|
|
/* globals Headers, Request, Response */
|
2017-07-10 19:01:50 +00:00
|
|
|
|
2015-02-20 04:10:52 +00:00
|
|
|
'use strict';
|
|
|
|
|
2018-04-05 13:14:52 +00:00
|
|
|
const whatwg = require('whatwg-fetch');
|
2015-02-20 04:10:52 +00:00
|
|
|
|
2017-09-11 16:36:25 +00:00
|
|
|
if (whatwg && whatwg.fetch) {
|
|
|
|
module.exports = whatwg;
|
|
|
|
} else {
|
|
|
|
module.exports = {fetch, Headers, Request, Response};
|
|
|
|
}
|