From a10f4910ac5be52a9bfe2900850bc5528088d12e Mon Sep 17 00:00:00 2001 From: webreflection Date: Mon, 13 Nov 2023 10:21:34 +0100 Subject: [PATCH] Fixed typo (ref name) and added basic test --- esm/rabbit.js | 4 ++-- test/index.html | 50 +++++++++++++++++++++++++++++++++++++++++++++++ types/rabbit.d.ts | 2 +- 3 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 test/index.html diff --git a/esm/rabbit.js b/esm/rabbit.js index f790952..6a272a4 100644 --- a/esm/rabbit.js +++ b/esm/rabbit.js @@ -11,11 +11,11 @@ const parseSVG = create(parser(true)); * @param {Hole} hole * @returns {Node} */ -export const unroll = (cache, { s: stack, t: template, v: values }) => { +export const unroll = (cache, { s: svg, t: template, v: values }) => { if (values.length && cache.s === empty) cache.s = []; unrollValues(cache, values); if (cache.t !== template) { - const { n: node, d: details } = (stack ? parseSVG : parseHTML)(template, values); + const { n: node, d: details } = (svg ? parseSVG : parseHTML)(template, values); cache.t = template; cache.n = node; cache.d = details; diff --git a/test/index.html b/test/index.html new file mode 100644 index 0000000..93d390f --- /dev/null +++ b/test/index.html @@ -0,0 +1,50 @@ + + + + + + udom + + + +
+
+ + diff --git a/types/rabbit.d.ts b/types/rabbit.d.ts index 252e6ce..83d1254 100644 --- a/types/rabbit.d.ts +++ b/types/rabbit.d.ts @@ -1,4 +1,4 @@ -export function unroll(cache: import("./literals.js").Cache, { s: stack, t: template, v: values }: Hole): Node; +export function unroll(cache: import("./literals.js").Cache, { s: svg, t: template, v: values }: Hole): Node; /** * Holds all details needed to render the content on a render. * @constructor