1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-03 08:35:29 +02:00
joplin/ReactNativeClient/lib/shim.js

19 lines
510 B
JavaScript
Raw Normal View History

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();
};
shim.fetch = typeof fetch !== 'undefined' ? fetch : null;
2017-07-06 21:29:09 +02:00
shim.FormData = typeof FormData !== 'undefined' ? FormData : null;
shim.fs = null;
shim.FileApiDriverLocal = null;
shim.readLocalFileBase64 = () => { throw new Error('Not implemented'); }
2017-08-01 23:40:14 +02:00
shim.uploadBlob = () => { throw new Error('Not implemented'); }
export { shim };