From 465e77de4ce06bdd4971a7a49b00f1db4131d492 Mon Sep 17 00:00:00 2001 From: Elisha Date: Tue, 28 Oct 2025 22:44:44 +0600 Subject: [PATCH] dom manupulatioin --- HTTP/server.ts | 7 +++++++ virtual_dom_with_JS/dom.jsx | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/HTTP/server.ts b/HTTP/server.ts index c16ad24..4007451 100644 --- a/HTTP/server.ts +++ b/HTTP/server.ts @@ -481,3 +481,10 @@ function startServer(port: number): void { // Start the server startServer(8080); + +function foo(blaz: { + oddly: "long" | "type"; + but: "hey" | "this" | "is" | number; +}) {} + +function new_fn(bar: number) {} diff --git a/virtual_dom_with_JS/dom.jsx b/virtual_dom_with_JS/dom.jsx index bee7779..9b854e9 100644 --- a/virtual_dom_with_JS/dom.jsx +++ b/virtual_dom_with_JS/dom.jsx @@ -55,3 +55,17 @@ const f = ( const $root = document.getElementById("root"); $root.appendChild(createElement(f)); + +function removeBooleanProp($target, name) { + $target.removeAttribute(name); + $target[name] = false; +} +function removeProp($target, name, value) { + if (isCustomProp(name)) { + return; + } else if (name === "className") { + $target.removeAttribute("class"); + } else if (typeof value === "boolean") { + removeBooleanProp($target, name); + } +}