From c2957f56d3cca8ae92c07c6b53c10a390821e023 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Wed, 6 Mar 2024 14:11:08 +0100 Subject: [PATCH] fix: too strict type --- .changeset/violet-dancers-film.md | 5 +++++ packages/lit-helpers/localizedLabel.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/violet-dancers-film.md diff --git a/.changeset/violet-dancers-film.md b/.changeset/violet-dancers-film.md new file mode 100644 index 00000000..4de242e6 --- /dev/null +++ b/.changeset/violet-dancers-film.md @@ -0,0 +1,5 @@ +--- +'@rdfjs-elements/lit-helpers': patch +--- + +The `fallback` parameter of `localizedLabel` should allow any type and let lit render it diff --git a/packages/lit-helpers/localizedLabel.js b/packages/lit-helpers/localizedLabel.js index bc8eb735..dd7605a6 100644 --- a/packages/lit-helpers/localizedLabel.js +++ b/packages/lit-helpers/localizedLabel.js @@ -12,7 +12,7 @@ class LocalizedLabelDirective extends Directive { * @param {PointerLike} resource * @param {object} [options] * @param {import('@rdfjs/types').NamedNode | Array} [options.property] - * @param {string} [options.fallback] + * @param {*} [options.fallback] * @returns {string|*} */ render(resource, { property = rdfs.label, fallback = '' } = {}) {