1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-30 08:26:59 +02:00
joplin/ReactNativeClient/lib/shim.js

16 lines
341 B
JavaScript
Raw Normal View History

let shim = {};
shim.fetch = typeof fetch !== 'undefined' ? fetch : null;
2017-07-06 21:29:09 +02:00
shim.FormData = typeof FormData !== 'undefined' ? FormData : null;
if (!shim.fetch) {
let moduleName = 'node-fetch';
shim.fetch = require(moduleName);
}
if (!shim.FormData) {
let moduleName = 'form-data';
shim.FormData = require(moduleName);
}
export { shim };