From 75087c23ca2428b387971c383d2c05e32154c4f3 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Fri, 7 Feb 2025 10:58:39 +0100 Subject: [PATCH] Make mini-skooma more similar to original skooma --- mini.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mini.js b/mini.js index f4cecb1..36f2aeb 100644 --- a/mini.js +++ b/mini.js @@ -1,7 +1,16 @@ export default new Proxy(document, { - get: (_, tag) => content => { + /** @param {string} tag */ + get: (_, tag) => /** @param {any[]} args */ (...args) => { let node = document.createElement(tag) - for (let key in content) node[key] = content[key] + for (const arg of args) { + if (arg instanceof HTMLElement) { + node.append(arg) + } else if (arg instanceof Object) { + for (let key in arg) { + node[key] = arg[key] + } + } + } return node } })