mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-04-24 00:00:03 +08:00
- WIP: implement data pre-processor for #101
- implement checks for #101 - add some specs
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user