Quantumbraid's picture
download
raw
544 Bytes
/* eslint-disable no-bitwise, no-cond-assign */
/**
* Checks if an element contains another given element.
*
* @param context the context element
* @param node the element to check
*/
export default function contains(context, node) {
// HTML DOM and SVG DOM may have different support levels,
// so we need to check on context instead of a document root element.
if (context.contains) return context.contains(node);
if (context.compareDocumentPosition) return context === node || !!(context.compareDocumentPosition(node) & 16);
}

Xet Storage Details

Size:
544 Bytes
·
Xet hash:
d5a6bb689b43bfe152d5b46a1c5a20ae39232661861d8950256043c51efb8719

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.