From cf3aaca28a1ad9a21d67acdd1425f2b4b863d712 Mon Sep 17 00:00:00 2001 From: sss Date: Thu, 5 Jun 2025 15:24:29 -0700 Subject: [PATCH] Bump version to 0.3.0 and add `ontop` method to `$`. Improve code consistency in `index.js`. --- index.html | 2 +- index.js | 7 ++++--- package.json | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index f8dbda5..8137a68 100644 --- a/index.html +++ b/index.html @@ -2,12 +2,12 @@ +

Testing index.js Module Import

diff --git a/index.js b/index.js index d0c0d44..0c85009 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,11 @@ -export const $ = (selector) => +const $ = (selector) => { const el = document.querySelector(selector) el.render = (html) => el.innerHTML = html el.inject = (html) => el.insertAdjacentHTML('beforeend', html) + el.ontop = (html) => el.insertAdjacentHTML('beforebegin', html) return el; }; -export const $$ = (selector) => return document.querySelectorAll(selector) -export const _ = msg => console.log(msg); // _('hello') +const $$ = (selector) => { return document.querySelectorAll(selector)} +const _ = msg => console.log(msg); // _('hello') diff --git a/package.json b/package.json index 622aa47..74c5c49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qthtml", - "version": "0.2.0", + "version": "0.3.0", "description": "", "main": "index.js", "type": "module",