Files
cordova-plugin-advanced-http/www/dependency-validator.js
T
Sefa Ilkimen 867b8ea202 - WIP: implement data pre-processor for #101
- implement checks for #101
- add some specs
2019-11-10 06:40:31 +01:00

23 lines
600 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
module.exports = function init(FormData, console, messages) {
var interface = {
checkFormDataApi: checkFormDataApi,
logWarnings: logWarnings,
};
return interface;
function logWarnings() {
if (!FormData) {
console.warn(messages.MISSING_FORMDATA_API);
} else if (!FormData.prototype || !FormData.prototype.entries) {
console.warn(messages.MISSING_FORMDATA_ENTRIES_API);
}
}
function checkFormDataApi() {
if (!FormData || !FormData.prototype || !FormData.prototype.entries) {
throw new Error(messages.MISSING_FORMDATA_ENTRIES_API);
}
}
};