dd/node_modules/jquery/src/selector/testContext.js
2026-06-14 15:46:45 +08:00

9 lines
320 B
JavaScript

/**
* Checks a node for validity as a jQuery selector context
* @param {Element|Object=} context
* @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
*/
export function testContext( context ) {
return context && typeof context.getElementsByTagName !== "undefined" && context;
}