2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-11 18:02:32 +03:00

Adding xsrf protection

This commit is contained in:
Matt Zabriskie
2014-08-29 01:17:40 -06:00
parent 3ae6670f77
commit 7aef479c7e
14 changed files with 534 additions and 99 deletions
+23 -1
View File
@@ -12,6 +12,26 @@ function isArray(val) {
return toString.call(val) === '[object Array]';
}
/**
* Determine if a value is a String
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a String, otherwise false
*/
function isString(val) {
return typeof val === 'string';
}
/**
* Determine if a value is a Number
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Number, otherwise false
*/
function isNumber(val) {
return typeof val === 'number';
}
/**
* Determine if a value is an Object
*
@@ -49,7 +69,7 @@ function isFile(val) {
* @returns {boolean} True if value is a Blob, otherwise false
*/
function isBlob(val) {
return toString.call(val) !== '[object Blob]';
return toString.call(val) === '[object Blob]';
}
/**
@@ -133,6 +153,8 @@ function merge(obj1/*, obj2, obj3, ...*/) {
module.exports = {
isArray: isArray,
isString: isString,
isNumber: isNumber,
isObject: isObject,
isDate: isDate,
isFile: isFile,