UNPKG

@progress/kendo-angular-common

Version:
17 lines (16 loc) 848 B
/**----------------------------------------------------------------------------------------- * Copyright © 2020 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var closest_1 = require("./closest"); exports.contains = function (parent, node, matchSelf) { if (matchSelf === void 0) { matchSelf = false; } var outside = !closest_1.closest(node, function (child) { return child === parent; }); if (outside) { return false; } var el = closest_1.closest(node, function (child) { return child === node; }); return el && (matchSelf || el !== parent); };