forked from pretenderjs/pretender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiife-wrapper.js
37 lines (30 loc) · 1.01 KB
/
iife-wrapper.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var Pretender = (function(self) {
function getModuleDefault(module) {
return module.default || module;
}
var appearsBrowserified =
typeof self !== 'undefined' &&
typeof process !== 'undefined' &&
(Object.prototype.toString.call(process) === '[object Object]' ||
Object.prototype.toString.call(process) === '[object process]');
var RouteRecognizer = appearsBrowserified
? getModuleDefault(require('route-recognizer'))
: self.RouteRecognizer;
var FakeXMLHttpRequest = appearsBrowserified
? getModuleDefault(require('fake-xml-http-request'))
: self.FakeXMLHttpRequest;
// fetch related ponyfills
var FakeFetch = appearsBrowserified
? getModuleDefault(require('whatwg-fetch'))
: self.WHATWGFetch;
/*==ROLLUP_CONTENT==*/
if (typeof module === 'object') {
module.exports = Pretender;
} else if (typeof define !== 'undefined') {
define('pretender', [], function() {
return Pretender;
});
}
self.Pretender = Pretender;
return Pretender;
})(self);