PageSourceSearch

https://www.seeedstudio.com/blog/wp-content/plugins/the-events-cal…/src/resources/js/underscore-before.js

js seeedstudio.com collected 2026-09-24 08:32:33 UTC 1,278 bytes, 42 lines download raw bytes

1(function(){
2
3	/**
4	 * Function that search if an object has all the specified methods and all those methods are functions.
5	 *
6	 * @since 4.7.7
7	 *
8	 * @param {Object} obj The object where all the methods might be stored
9	 * @param {Array} methods An array with the name of all the methods to be tested
10	 * @return {boolean} True if has all the methods false otherwise.
11	 */
12	function search_for_methods( obj, methods ) {
13
14		// Object is not defined or does not exist on window nothing to do.
15		if ( ! obj || window[ obj ] ) {
16			return false;
17		}
18
19		var search = methods.filter( function( name ) {
20			// Test if the method is part of Obj and if is a function.
21			return obj[ name ] && 'function' === typeof obj[ name ];
22		});
23		return methods.length === search.length;
24	}
25
26	/**
27	 * Function to compare if the variable _ is from lodash by testing some of us unique methods.
28	 *
29	 * @since 4.7.7
30	 *
31	 * @return {boolean} True if the global _ is from lodash.
32	 */
33	function is_lodash() {
34		return search_for_methods( window._, [ 'get', 'set', 'at', 'cloneDeep', 'some', 'every' ] );
35	}
36
37	window._lodash_tmp = false;
38	// If current _ is from lodash Store it in a temp variable before underscore is loaded
39	if ( '_' in window && is_lodash() ) {
40		window._lodash_tmp = _;
41	}
42})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.