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