2015-02-19 20:10:52 -08:00
|
|
|
/**
|
2015-03-23 13:35:08 -07:00
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-16 18:24:55 -08: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-19 20:10:52 -08:00
|
|
|
*
|
2018-05-10 19:06:46 -07:00
|
|
|
* @format
|
2015-02-19 20:10:52 -08:00
|
|
|
*/
|
2017-07-10 12:01:50 -07:00
|
|
|
|
2018-05-10 19:06:46 -07:00
|
|
|
/* globals Headers, Request, Response */
|
2017-07-10 12:01:50 -07:00
|
|
|
|
2015-02-19 20:10:52 -08:00
|
|
|
'use strict';
|
|
|
|
|
2018-04-05 06:14:52 -07:00
|
|
|
const whatwg = require('whatwg-fetch');
|
2015-02-19 20:10:52 -08:00
|
|
|
|
2017-09-11 09:36:25 -07:00
|
|
|
if (whatwg && whatwg.fetch) {
|
|
|
|
module.exports = whatwg;
|
|
|
|
} else {
|
|
|
|
module.exports = {fetch, Headers, Request, Response};
|
|
|
|
}
|