1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-14 22:45:40 +02:00
Files
misskey/packages/frontend/src/utility/element-contains.ts
syuilo 41592eafb3 refactor: make noImplicitAny true (#17083)
* wip

* Update emojis.emoji.vue

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update manager.ts

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update analytics.ts
2026-01-09 22:06:40 +09:00

16 lines
434 B
TypeScript

/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
export function elementContains(parent: Element | null, child: Element | null, checkSame = true) {
if (parent === null || child === null) return false;
if (checkSame && parent === child) return true;
let node = child.parentNode;
while (node) {
if (node === parent) return true;
node = node.parentNode;
}
return false;
}