MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / getOrCreateBodyContainer

Function getOrCreateBodyContainer

web/packages/framework/src/utils/index.ts:11–21  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

9 * @returns container
10 */
11export function getOrCreateBodyContainer(id: string): HTMLElement {
12 const ele = document.getElementById(id);
13 if (ele?.parentNode.isEqualNode(document.body)) {
14 return ele;
15 }
16 ele?.remove();
17 const container = document.createElement('div');
18 container.id = id;
19 document.body.appendChild(container);
20 return container;
21}
22
23/**
24 * 判断是否是 Promise 类型

Callers 5

index.tsFile · 0.90
index.tsxFile · 0.90
index.tsxFile · 0.90
hotkey.tsxFile · 0.90
index.tsxFile · 0.90

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected