mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-27 15:24:43 +02:00
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
This commit is contained in:
15
packages/frontend/src/utility/element-contains.ts
Normal file
15
packages/frontend/src/utility/element-contains.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
Reference in New Issue
Block a user