Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
rbardini/htmlTiny html tag function for no-build JSX-like syntax, compatible with all modern browsers and runtimes.
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
JSR Score
100%
Published
4 months ago (1.0.1)
/** * Interprets a template literal as an HTML template. * @param strings The string parts * @param values The values to interpolate * @returns The concatenated string parts with values interpolated */ export function html( strings: TemplateStringsArray, ...values: unknown[] ): string { return strings.reduce((acc, string, i) => { const value = values[i] if (Array.isArray(value)) return acc + string + value.join('') if (value != null && !!value !== value) return acc + string + value return acc + string }, '') }