From 6114e5cf5e232ebe5f5731304abc201e60fb17b6 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Wed, 5 Nov 2025 15:46:25 -0800 Subject: [PATCH] false/null = no attr --- src/ribbit.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ribbit.ts b/src/ribbit.ts index 981ad71..0c76fac 100644 --- a/src/ribbit.ts +++ b/src/ribbit.ts @@ -77,10 +77,11 @@ const tagBlock = async (tagName: string, props = {}, fn: Function) => { } const tagCall = (tagName: string, atNamed = {}, ...args: any[]) => { - console.log('tagCall:', { tagName, atNamed, args }) args = args.map(arg => typeof arg === 'function' ? arg.tagName : arg) - const attrs = Object.entries(atNamed).map(([key, value]) => `${key}="${typeof value === 'function' ? (value as any).tagName : value}"`) + const attrs = Object.entries(atNamed) + .filter(([key, value]) => value) + .map(([key, value]) => `${key}="${typeof value === 'function' ? (value as any).tagName : value}"`) const space = attrs.length ? ' ' : '' const children = args .reverse()