🔧
This commit is contained in:
18
node_modules/axios/lib/utils.js
generated
vendored
18
node_modules/axios/lib/utils.js
generated
vendored
@@ -6,6 +6,7 @@ import bind from './helpers/bind.js';
|
||||
|
||||
const {toString} = Object.prototype;
|
||||
const {getPrototypeOf} = Object;
|
||||
const {iterator, toStringTag} = Symbol;
|
||||
|
||||
const kindOf = (cache => thing => {
|
||||
const str = toString.call(thing);
|
||||
@@ -132,7 +133,7 @@ const isPlainObject = (val) => {
|
||||
}
|
||||
|
||||
const prototype = getPrototypeOf(val);
|
||||
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
|
||||
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -483,13 +484,13 @@ const isTypedArray = (TypedArray => {
|
||||
* @returns {void}
|
||||
*/
|
||||
const forEachEntry = (obj, fn) => {
|
||||
const generator = obj && obj[Symbol.iterator];
|
||||
const generator = obj && obj[iterator];
|
||||
|
||||
const iterator = generator.call(obj);
|
||||
const _iterator = generator.call(obj);
|
||||
|
||||
let result;
|
||||
|
||||
while ((result = iterator.next()) && !result.done) {
|
||||
while ((result = _iterator.next()) && !result.done) {
|
||||
const pair = result.value;
|
||||
fn.call(obj, pair[0], pair[1]);
|
||||
}
|
||||
@@ -610,7 +611,7 @@ const toFiniteNumber = (value, defaultValue) => {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isSpecCompliantForm(thing) {
|
||||
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
|
||||
return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
||||
}
|
||||
|
||||
const toJSONObject = (obj) => {
|
||||
@@ -679,6 +680,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
|
||||
|
||||
// *********************
|
||||
|
||||
|
||||
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
||||
|
||||
|
||||
export default {
|
||||
isArray,
|
||||
isArrayBuffer,
|
||||
@@ -734,5 +739,6 @@ export default {
|
||||
isAsyncFn,
|
||||
isThenable,
|
||||
setImmediate: _setImmediate,
|
||||
asap
|
||||
asap,
|
||||
isIterable
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user