From 4760c611a356d4e8b8584a17d5f730d103ebfb14 Mon Sep 17 00:00:00 2001 From: Geoff Doty Date: Wed, 22 May 2024 12:02:58 -0400 Subject: [PATCH] tweak tag export function --- src/index.js | 5 ++--- src/tag.js | 10 ++++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/index.js b/src/index.js index 0cb1f35..fc75276 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,5 @@ -import tag from "./tag.js"; +import h from "./tag.js"; import app from "./app.js"; export {app}; -/** exports tag as h */ -export const h = tag; +export {h}; diff --git a/src/tag.js b/src/tag.js index 2669ab0..4dfa215 100644 --- a/src/tag.js +++ b/src/tag.js @@ -1,12 +1,14 @@ /** - * Creates new DOM element(s) from tag name(s) and attributes + * HTML Tag Scripting Function * - * @param {string} tag - tag to create - * @param {...any} args - attributes and/or child tag elements + * creates new DOM element(s) from tag name(s) and attributes + * + * @param {String} tag - tag to create + * @param {*} args - attributes and/or child tag elements * * @returns {HTMLElement} The created DOM element(s) */ -export default function tag(tag, ...args) { +export default function h(tag, ...args) { const el = document.createElement(tag); // support all scalar values as TextNodes