1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00
joplin/ReactNativeClient/lib/shim.js
2017-07-06 19:29:09 +00:00

16 lines
341 B
JavaScript

let shim = {};
shim.fetch = typeof fetch !== 'undefined' ? fetch : null;
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 };