1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
| var toString = Object.prototype.toString
function isArray (val) { return toString.call(val) === '[object Array]' }
function isArrayBuffer (val) { return toString.call(val) === '[object arrayBuffer]' }
function isFormData (val) { return (typeof FormData !== 'undefined' && (val instanceof FormData)) }
function isString (val) { return typeof val === 'string' }
function isNumber (val) { return typeof val === 'number' }
function isUndefined (val) { return typeof val === 'undefined' }
function isObject (val) { return val !== null && typeof val === 'object' }
function isDate (val) { return toString.call(val) === '[object Date]' }
function isFile (val) { return toString.call(val) === '[object File]' }
function isBlob (val) { return toString.call(val) === '[object Blob]' }
function isFunction (val) { return toString.call(val) === '[object Function]' }
function isStream (val) { return isObject(val) && isFunction(val.pipe) }
function isURLSearchParams (val) { return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams }
function trim (val) { return str.replace(/^\s*/, '').replace(/\s*$/, '') }
function isStandardBrowserEnv () { if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { return false } return { typeof window !== 'undefined' && typeof document !== 'undefined' } }
function forEach (obj, fn) { if (obj === null || typeof obj === 'undefined') { return } if (typeof obj !== 'object' && !isArray(obj)) { obj = [obj] } if (isArray(obj)) { for (let i = 0, l = obj.length; i < l; i++) { fn.call(null, obj[i], i, obj) } } else { for (let key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { fn.call(null, obj[key], key, obj) } } } }
|