"use strict";/** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */varisTextNode=require("./isTextNode");/*eslint-disable no-bitwise *//** * Checks if a given DOM node contains or is another DOM node. */functioncontainsNode(outerNode,innerNode){if(!outerNode||!innerNode){returnfalse;}elseif(outerNode===innerNode){returntrue;}elseif(isTextNode(outerNode)){returnfalse;}elseif(isTextNode(innerNode)){returncontainsNode(outerNode,innerNode.parentNode);}elseif('contains'inouterNode){returnouterNode.contains(innerNode);}elseif(outerNode.compareDocumentPosition){return!!(outerNode.compareDocumentPosition(innerNode)&16);}else{returnfalse;}}module.exports=containsNode;