2019-11-18 20:15:03 +00:00
|
|
|
import arr from "./var/arr.js";
|
|
|
|
import getProto from "./var/getProto.js";
|
|
|
|
import slice from "./var/slice.js";
|
|
|
|
import flat from "./var/flat.js";
|
|
|
|
import push from "./var/push.js";
|
|
|
|
import indexOf from "./var/indexOf.js";
|
|
|
|
import class2type from "./var/class2type.js";
|
|
|
|
import toString from "./var/toString.js";
|
|
|
|
import hasOwn from "./var/hasOwn.js";
|
|
|
|
import fnToString from "./var/fnToString.js";
|
|
|
|
import ObjectFunctionString from "./var/ObjectFunctionString.js";
|
|
|
|
import support from "./var/support.js";
|
|
|
|
import isWindow from "./var/isWindow.js";
|
|
|
|
import DOMEval from "./core/DOMEval.js";
|
|
|
|
import toType from "./core/toType.js";
|
|
|
|
|
|
|
|
// When custom compilation is used, the version string can get large.
|
|
|
|
// eslint-disable-next-line max-len
|
2019-07-29 19:14:46 +00:00
|
|
|
var version = "@VERSION",
|
|
|
|
|
|
|
|
rhtmlSuffix = /HTML$/i,
|
2012-06-04 16:48:18 +00:00
|
|
|
|
|
|
|
// Define a local copy of jQuery
|
|
|
|
jQuery = function( selector, context ) {
|
2015-08-16 06:59:58 +00:00
|
|
|
|
2009-05-20 21:12:08 +00:00
|
|
|
// The jQuery object is actually just the init constructor 'enhanced'
|
2013-09-10 00:13:01 +00:00
|
|
|
// Need init if jQuery is called (just allow error to be thrown if not included)
|
|
|
|
return new jQuery.fn.init( selector, context );
|
2019-04-29 20:56:09 +00:00
|
|
|
};
|
2009-03-31 17:35:20 +00:00
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
jQuery.fn = jQuery.prototype = {
|
2015-08-16 06:59:58 +00:00
|
|
|
|
2012-11-26 08:20:43 +00:00
|
|
|
// The current version of jQuery being used
|
2013-08-15 18:15:49 +00:00
|
|
|
jquery: version,
|
2012-11-26 08:20:43 +00:00
|
|
|
|
2010-10-10 00:32:54 +00:00
|
|
|
constructor: jQuery,
|
2013-08-15 18:15:49 +00:00
|
|
|
|
2009-07-17 01:47:26 +00:00
|
|
|
// The default length of a jQuery object is 0
|
|
|
|
length: 0,
|
|
|
|
|
2009-12-22 00:58:13 +00:00
|
|
|
toArray: function() {
|
2013-08-15 18:15:49 +00:00
|
|
|
return slice.call( this );
|
2009-07-23 13:22:55 +00:00
|
|
|
},
|
2009-07-16 07:31:32 +00:00
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
// Get the Nth element in the matched element set OR
|
|
|
|
// Get the whole matched element set as a clean array
|
|
|
|
get: function( num ) {
|
|
|
|
|
2016-07-15 17:42:25 +00:00
|
|
|
// Return all the elements in a clean array
|
|
|
|
if ( num == null ) {
|
|
|
|
return slice.call( this );
|
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2016-07-15 17:42:25 +00:00
|
|
|
// Return just the one element from the set
|
|
|
|
return num < 0 ? this[ num + this.length ] : this[ num ];
|
2008-01-14 22:30:48 +00:00
|
|
|
},
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
// Take an array of elements and push it onto the stack
|
|
|
|
// (returning the new matched element set)
|
2012-10-24 00:22:34 +00:00
|
|
|
pushStack: function( elems ) {
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2012-06-28 00:55:36 +00:00
|
|
|
// Build a new jQuery matched element set
|
|
|
|
var ret = jQuery.merge( this.constructor(), elems );
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// Add the old object onto the stack (as a reference)
|
|
|
|
ret.prevObject = this;
|
2008-12-19 04:37:10 +00:00
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
// Return the newly-formed element set
|
|
|
|
return ret;
|
|
|
|
},
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
// Execute a callback for every element in the matched set.
|
2015-02-17 07:09:54 +00:00
|
|
|
each: function( callback ) {
|
|
|
|
return jQuery.each( this, callback );
|
2008-01-14 22:30:48 +00:00
|
|
|
},
|
2011-01-05 21:41:23 +00:00
|
|
|
|
2013-09-28 15:57:46 +00:00
|
|
|
map: function( callback ) {
|
2015-08-16 06:59:58 +00:00
|
|
|
return this.pushStack( jQuery.map( this, function( elem, i ) {
|
2013-09-28 15:57:46 +00:00
|
|
|
return callback.call( elem, i, elem );
|
2015-08-16 06:59:58 +00:00
|
|
|
} ) );
|
2013-09-28 15:57:46 +00:00
|
|
|
},
|
|
|
|
|
2012-10-19 21:08:50 +00:00
|
|
|
slice: function() {
|
2013-08-15 18:15:49 +00:00
|
|
|
return this.pushStack( slice.apply( this, arguments ) );
|
2009-12-10 17:25:25 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
first: function() {
|
|
|
|
return this.eq( 0 );
|
|
|
|
},
|
|
|
|
|
|
|
|
last: function() {
|
|
|
|
return this.eq( -1 );
|
|
|
|
},
|
|
|
|
|
2019-09-24 00:04:53 +00:00
|
|
|
even: function() {
|
|
|
|
return this.pushStack( jQuery.grep( this, function( _elem, i ) {
|
|
|
|
return ( i + 1 ) % 2;
|
|
|
|
} ) );
|
|
|
|
},
|
|
|
|
|
|
|
|
odd: function() {
|
|
|
|
return this.pushStack( jQuery.grep( this, function( _elem, i ) {
|
|
|
|
return i % 2;
|
|
|
|
} ) );
|
|
|
|
},
|
|
|
|
|
2012-10-19 21:08:50 +00:00
|
|
|
eq: function( i ) {
|
|
|
|
var len = this.length,
|
|
|
|
j = +i + ( i < 0 ? len : 0 );
|
2015-08-16 06:59:58 +00:00
|
|
|
return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
|
2009-12-10 17:25:25 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
end: function() {
|
2015-07-02 06:33:38 +00:00
|
|
|
return this.prevObject || this.constructor();
|
2019-09-24 00:12:36 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
jQuery.extend = jQuery.fn.extend = function() {
|
2011-02-15 21:03:23 +00:00
|
|
|
var options, name, src, copy, copyIsArray, clone,
|
2015-08-16 06:59:58 +00:00
|
|
|
target = arguments[ 0 ] || {},
|
2010-11-09 16:09:07 +00:00
|
|
|
i = 1,
|
|
|
|
length = arguments.length,
|
|
|
|
deep = false;
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// Handle a deep copy situation
|
2008-11-17 16:32:05 +00:00
|
|
|
if ( typeof target === "boolean" ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
deep = target;
|
2013-09-28 15:57:46 +00:00
|
|
|
|
2014-04-25 22:26:36 +00:00
|
|
|
// Skip the boolean and the target
|
2013-09-28 15:57:46 +00:00
|
|
|
target = arguments[ i ] || {};
|
|
|
|
i++;
|
2008-01-14 22:30:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Handle case when target is a string or something (possible in deep copy)
|
2019-04-29 20:56:09 +00:00
|
|
|
if ( typeof target !== "object" && typeof target !== "function" ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
target = {};
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2014-04-25 22:26:36 +00:00
|
|
|
// Extend jQuery itself if only one argument is passed
|
2013-09-28 15:57:46 +00:00
|
|
|
if ( i === length ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
target = this;
|
2013-09-28 15:57:46 +00:00
|
|
|
i--;
|
2008-01-14 22:30:48 +00:00
|
|
|
}
|
|
|
|
|
2009-03-31 17:35:20 +00:00
|
|
|
for ( ; i < length; i++ ) {
|
2015-08-16 06:59:58 +00:00
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
// Only deal with non-null/undefined values
|
2015-08-16 06:59:58 +00:00
|
|
|
if ( ( options = arguments[ i ] ) != null ) {
|
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
// Extend the base object
|
2009-03-31 17:35:20 +00:00
|
|
|
for ( name in options ) {
|
|
|
|
copy = options[ name ];
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2019-03-25 16:57:30 +00:00
|
|
|
// Prevent Object.prototype pollution
|
2008-01-14 22:30:48 +00:00
|
|
|
// Prevent never-ending loop
|
2019-03-25 16:57:30 +00:00
|
|
|
if ( name === "__proto__" || target === copy ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
continue;
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2010-01-30 18:50:49 +00:00
|
|
|
// Recurse if we're merging plain objects or arrays
|
2015-08-16 06:59:58 +00:00
|
|
|
if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
|
2016-08-14 10:54:16 +00:00
|
|
|
( copyIsArray = Array.isArray( copy ) ) ) ) {
|
2018-12-12 16:13:18 +00:00
|
|
|
src = target[ name ];
|
2014-07-17 17:25:59 +00:00
|
|
|
|
2018-12-12 16:13:18 +00:00
|
|
|
// Ensure proper type for the source value
|
|
|
|
if ( copyIsArray && !Array.isArray( src ) ) {
|
|
|
|
clone = [];
|
|
|
|
} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
|
|
|
|
clone = {};
|
2010-01-30 18:50:49 +00:00
|
|
|
} else {
|
2018-12-12 16:13:18 +00:00
|
|
|
clone = src;
|
2010-01-30 18:50:49 +00:00
|
|
|
}
|
2018-12-12 16:13:18 +00:00
|
|
|
copyIsArray = false;
|
2009-07-16 07:32:03 +00:00
|
|
|
|
|
|
|
// Never move original objects, clone them
|
|
|
|
target[ name ] = jQuery.extend( deep, clone, copy );
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// Don't bring in undefined values
|
2009-03-31 17:35:20 +00:00
|
|
|
} else if ( copy !== undefined ) {
|
2008-04-30 00:09:55 +00:00
|
|
|
target[ name ] = copy;
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
}
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// Return the modified object
|
|
|
|
return target;
|
|
|
|
};
|
|
|
|
|
2015-08-16 06:59:58 +00:00
|
|
|
jQuery.extend( {
|
|
|
|
|
2013-02-25 20:48:22 +00:00
|
|
|
// Unique for each copy of jQuery on the page
|
2013-08-15 18:15:49 +00:00
|
|
|
expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
|
|
|
|
|
|
|
|
// Assume jQuery is ready without the ready module
|
|
|
|
isReady: true,
|
2013-02-25 20:48:22 +00:00
|
|
|
|
2013-09-28 15:57:46 +00:00
|
|
|
error: function( msg ) {
|
|
|
|
throw new Error( msg );
|
|
|
|
},
|
|
|
|
|
|
|
|
noop: function() {},
|
|
|
|
|
2009-12-06 22:11:51 +00:00
|
|
|
isPlainObject: function( obj ) {
|
2016-03-14 20:46:51 +00:00
|
|
|
var proto, Ctor;
|
2015-08-16 06:59:58 +00:00
|
|
|
|
2016-03-14 20:46:51 +00:00
|
|
|
// Detect obvious negatives
|
|
|
|
// Use toString instead of jQuery.type to catch host objects
|
|
|
|
if ( !obj || toString.call( obj ) !== "[object Object]" ) {
|
2009-11-08 23:26:01 +00:00
|
|
|
return false;
|
|
|
|
}
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2016-03-14 20:46:51 +00:00
|
|
|
proto = getProto( obj );
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2016-03-14 20:46:51 +00:00
|
|
|
// Objects with no prototype (e.g., `Object.create( null )`) are plain
|
|
|
|
if ( !proto ) {
|
|
|
|
return true;
|
|
|
|
}
|
2016-03-03 23:29:45 +00:00
|
|
|
|
2016-03-14 20:46:51 +00:00
|
|
|
// Objects with prototype are plain iff they were constructed by a global Object function
|
|
|
|
Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
|
|
|
|
return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
|
2009-07-16 07:32:03 +00:00
|
|
|
},
|
|
|
|
|
2009-07-16 07:32:31 +00:00
|
|
|
isEmptyObject: function( obj ) {
|
2012-07-10 01:38:11 +00:00
|
|
|
var name;
|
2016-05-10 09:12:28 +00:00
|
|
|
|
2012-07-10 01:38:11 +00:00
|
|
|
for ( name in obj ) {
|
2009-07-16 15:16:44 +00:00
|
|
|
return false;
|
2009-07-19 19:55:21 +00:00
|
|
|
}
|
2009-07-16 15:16:44 +00:00
|
|
|
return true;
|
2009-07-16 07:32:31 +00:00
|
|
|
},
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2020-02-10 18:17:22 +00:00
|
|
|
// Evaluates a script in a provided context; falls back to the global one
|
|
|
|
// if not specified.
|
|
|
|
globalEval: function( code, options, doc ) {
|
|
|
|
DOMEval( code, { nonce: options && options.nonce }, doc );
|
2008-01-14 22:30:48 +00:00
|
|
|
},
|
|
|
|
|
2015-02-17 07:09:54 +00:00
|
|
|
each: function( obj, callback ) {
|
2015-06-25 04:18:04 +00:00
|
|
|
var length, i = 0;
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2015-06-25 04:18:04 +00:00
|
|
|
if ( isArrayLike( obj ) ) {
|
|
|
|
length = obj.length;
|
2015-02-17 07:09:54 +00:00
|
|
|
for ( ; i < length; i++ ) {
|
|
|
|
if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
|
|
|
|
break;
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
} else {
|
2015-02-17 07:09:54 +00:00
|
|
|
for ( i in obj ) {
|
|
|
|
if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
|
|
|
|
break;
|
2011-03-30 17:17:48 +00:00
|
|
|
}
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
}
|
|
|
|
|
2012-06-29 01:39:58 +00:00
|
|
|
return obj;
|
2008-01-14 22:30:48 +00:00
|
|
|
},
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2019-07-29 19:14:46 +00:00
|
|
|
|
|
|
|
// Retrieve the text value of an array of DOM nodes
|
|
|
|
text: function( elem ) {
|
|
|
|
var node,
|
|
|
|
ret = "",
|
|
|
|
i = 0,
|
|
|
|
nodeType = elem.nodeType;
|
|
|
|
|
|
|
|
if ( !nodeType ) {
|
|
|
|
|
|
|
|
// If no nodeType, this is expected to be an array
|
|
|
|
while ( ( node = elem[ i++ ] ) ) {
|
|
|
|
|
|
|
|
// Do not traverse comment nodes
|
|
|
|
ret += jQuery.text( node );
|
|
|
|
}
|
|
|
|
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
|
|
|
|
|
|
|
|
// Use textContent for elements
|
|
|
|
// innerText usage removed for consistency of new lines (jQuery #11153)
|
|
|
|
if ( typeof elem.textContent === "string" ) {
|
|
|
|
return elem.textContent;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// Traverse its children
|
|
|
|
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
|
|
|
|
ret += jQuery.text( elem );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if ( nodeType === 3 || nodeType === 4 ) {
|
|
|
|
return elem.nodeValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Do not include comment or processing instruction nodes
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
},
|
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2009-11-18 02:26:42 +00:00
|
|
|
// results is for internal usage only
|
2012-06-29 01:39:58 +00:00
|
|
|
makeArray: function( arr, results ) {
|
2012-12-10 18:52:02 +00:00
|
|
|
var ret = results || [];
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2012-06-29 01:39:58 +00:00
|
|
|
if ( arr != null ) {
|
2015-06-25 04:18:04 +00:00
|
|
|
if ( isArrayLike( Object( arr ) ) ) {
|
2012-12-10 18:52:02 +00:00
|
|
|
jQuery.merge( ret,
|
|
|
|
typeof arr === "string" ?
|
|
|
|
[ arr ] : arr
|
|
|
|
);
|
2009-03-31 17:35:20 +00:00
|
|
|
} else {
|
2013-08-15 18:15:49 +00:00
|
|
|
push.call( ret, arr );
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-04-25 03:48:07 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
},
|
|
|
|
|
2012-06-29 01:39:58 +00:00
|
|
|
inArray: function( elem, arr, i ) {
|
2013-08-15 18:15:49 +00:00
|
|
|
return arr == null ? -1 : indexOf.call( arr, elem, i );
|
2008-01-14 22:30:48 +00:00
|
|
|
},
|
|
|
|
|
2019-07-29 19:14:46 +00:00
|
|
|
isXMLDoc: function( elem ) {
|
|
|
|
var namespace = elem.namespaceURI,
|
|
|
|
docElem = ( elem.ownerDocument || elem ).documentElement;
|
|
|
|
|
|
|
|
// Assume HTML when documentElement doesn't yet exist, such as inside
|
|
|
|
// document fragments.
|
|
|
|
return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" );
|
|
|
|
},
|
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
merge: function( first, second ) {
|
2013-09-03 05:24:01 +00:00
|
|
|
var len = +second.length,
|
|
|
|
j = 0,
|
|
|
|
i = first.length;
|
2009-05-02 19:22:55 +00:00
|
|
|
|
2013-09-03 05:24:01 +00:00
|
|
|
for ( ; j < len; j++ ) {
|
|
|
|
first[ i++ ] = second[ j ];
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2009-12-10 05:43:20 +00:00
|
|
|
first.length = i;
|
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
return first;
|
|
|
|
},
|
|
|
|
|
2013-09-28 15:57:46 +00:00
|
|
|
grep: function( elems, callback, invert ) {
|
|
|
|
var callbackInverse,
|
|
|
|
matches = [],
|
2012-07-10 01:38:11 +00:00
|
|
|
i = 0,
|
2013-09-28 15:57:46 +00:00
|
|
|
length = elems.length,
|
|
|
|
callbackExpect = !invert;
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// Go through the array, only saving the items
|
|
|
|
// that pass the validator function
|
2012-07-10 01:38:11 +00:00
|
|
|
for ( ; i < length; i++ ) {
|
2013-09-28 15:57:46 +00:00
|
|
|
callbackInverse = !callback( elems[ i ], i );
|
|
|
|
if ( callbackInverse !== callbackExpect ) {
|
|
|
|
matches.push( elems[ i ] );
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2013-09-28 15:57:46 +00:00
|
|
|
return matches;
|
2008-01-14 22:30:48 +00:00
|
|
|
},
|
|
|
|
|
2009-12-04 17:28:47 +00:00
|
|
|
// arg is for internal usage only
|
|
|
|
map: function( elems, callback, arg ) {
|
2015-06-25 04:18:04 +00:00
|
|
|
var length, value,
|
2011-04-05 06:59:54 +00:00
|
|
|
i = 0,
|
2012-12-10 18:52:02 +00:00
|
|
|
ret = [];
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2013-09-22 08:19:28 +00:00
|
|
|
// Go through the array, translating each of the items to their new values
|
2015-06-25 04:18:04 +00:00
|
|
|
if ( isArrayLike( elems ) ) {
|
|
|
|
length = elems.length;
|
2011-03-21 19:12:31 +00:00
|
|
|
for ( ; i < length; i++ ) {
|
|
|
|
value = callback( elems[ i ], i, arg );
|
|
|
|
|
2011-02-27 18:47:35 +00:00
|
|
|
if ( value != null ) {
|
2013-09-28 15:57:46 +00:00
|
|
|
ret.push( value );
|
2011-02-27 18:47:35 +00:00
|
|
|
}
|
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2011-04-22 01:51:23 +00:00
|
|
|
// Go through every key on the object,
|
2011-04-05 06:59:54 +00:00
|
|
|
} else {
|
2012-12-10 18:52:02 +00:00
|
|
|
for ( i in elems ) {
|
|
|
|
value = callback( elems[ i ], i, arg );
|
2011-03-21 19:12:31 +00:00
|
|
|
|
|
|
|
if ( value != null ) {
|
2013-09-28 15:57:46 +00:00
|
|
|
ret.push( value );
|
2011-03-21 19:12:31 +00:00
|
|
|
}
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
}
|
|
|
|
|
2010-11-27 22:15:33 +00:00
|
|
|
// Flatten any nested arrays
|
2019-08-19 08:04:01 +00:00
|
|
|
return flat( ret );
|
2009-03-31 17:35:20 +00:00
|
|
|
},
|
|
|
|
|
2009-12-31 20:06:45 +00:00
|
|
|
// A global GUID counter for objects
|
|
|
|
guid: 1,
|
|
|
|
|
2013-08-26 22:54:13 +00:00
|
|
|
// jQuery.support is not used in Core but other projects attach their
|
|
|
|
// properties to it so it needs to exist.
|
|
|
|
support: support
|
2015-08-16 06:59:58 +00:00
|
|
|
} );
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2015-06-01 21:25:38 +00:00
|
|
|
if ( typeof Symbol === "function" ) {
|
|
|
|
jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
|
|
|
|
}
|
|
|
|
|
2010-08-27 23:14:59 +00:00
|
|
|
// Populate the class2type map
|
2015-10-02 22:28:34 +00:00
|
|
|
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
|
2019-05-13 20:25:11 +00:00
|
|
|
function( _i, name ) {
|
2010-08-27 23:14:59 +00:00
|
|
|
class2type[ "[object " + name + "]" ] = name.toLowerCase();
|
2015-08-16 06:59:58 +00:00
|
|
|
} );
|
2010-08-27 23:14:59 +00:00
|
|
|
|
2015-06-25 04:18:04 +00:00
|
|
|
function isArrayLike( obj ) {
|
2015-04-04 19:34:07 +00:00
|
|
|
|
2019-04-29 20:56:09 +00:00
|
|
|
var length = !!obj && obj.length,
|
2018-01-14 08:46:20 +00:00
|
|
|
type = toType( obj );
|
2012-12-10 18:52:02 +00:00
|
|
|
|
2019-04-29 20:56:09 +00:00
|
|
|
if ( typeof obj === "function" || isWindow( obj ) ) {
|
2012-12-10 18:52:02 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-09-28 15:57:46 +00:00
|
|
|
return type === "array" || length === 0 ||
|
|
|
|
typeof length === "number" && length > 0 && ( length - 1 ) in obj;
|
2012-12-10 18:52:02 +00:00
|
|
|
}
|
|
|
|
|
2019-11-18 20:15:03 +00:00
|
|
|
export default jQuery;
|