char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Aleksander Grygierui: Linting & Formatting scripts (#26819)92d1bb0c9

char/aliceai-t5-moe
300 B21 linesraw
1export function portalToBody(node: HTMLElement) {
2	if (typeof document === 'undefined') {
3		return;
4	}
5
6	const target = document.body;
7
8	if (!target) {
9		return;
10	}
11
12	target.appendChild(node);
13
14	return {
15		destroy() {
16			if (node.parentNode === target) {
17				target.removeChild(node);
18			}
19		}
20	};
21}