2017-07-06 20:58:01 +02:00
|
|
|
let shim = {};
|
|
|
|
|
2017-07-10 20:09:58 +02:00
|
|
|
shim.isNode = () => {
|
|
|
|
if (typeof process === 'undefined') return false;
|
2017-08-01 23:40:14 +02:00
|
|
|
return process.title == 'node';
|
2017-07-10 20:09:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
shim.isReactNative = () => {
|
|
|
|
return !shim.isNode();
|
|
|
|
};
|
|
|
|
|
2017-07-06 20:58:01 +02:00
|
|
|
shim.fetch = typeof fetch !== 'undefined' ? fetch : null;
|
2017-07-06 21:29:09 +02:00
|
|
|
shim.FormData = typeof FormData !== 'undefined' ? FormData : null;
|
2017-07-24 20:01:40 +02:00
|
|
|
shim.fs = null;
|
|
|
|
shim.FileApiDriverLocal = null;
|
2017-07-26 20:36:16 +02:00
|
|
|
shim.readLocalFileBase64 = () => { throw new Error('Not implemented'); }
|
2017-08-01 23:40:14 +02:00
|
|
|
shim.uploadBlob = () => { throw new Error('Not implemented'); }
|
2017-07-06 20:58:01 +02:00
|
|
|
|
|
|
|
export { shim };
|