mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-07-07 00:02:47 +08:00
replace all typeof calls
This commit is contained in:
@@ -67,7 +67,7 @@ var publicInterface = {
|
||||
throw new Error(messages.ADDING_COOKIES_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
if (typeof value !== 'string') {
|
||||
if (helpers.getTypeOf(value) !== 'String') {
|
||||
throw new Error(messages.HEADER_VALUE_MUST_BE_STRING);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@ var validSerializers = ['urlencoded', 'json', 'utf8' ];
|
||||
|
||||
module.exports = {
|
||||
b64EncodeUnicode: b64EncodeUnicode,
|
||||
getTypeOf: getTypeOf,
|
||||
checkHeaders: checkHeaders,
|
||||
onInvalidHeader: onInvalidHeader,
|
||||
checkSerializer: checkSerializer,
|
||||
@@ -45,7 +46,7 @@ function checkHeaders(headers) {
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
key = keys[i];
|
||||
|
||||
if (typeof headers[key] !== 'string') {
|
||||
if (getTypeOf(headers[key]) !== 'String') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user