mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-27 08:21:03 +02:00
16 lines
341 B
JavaScript
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 }; |