ochre-sdk 1.0.46 → 1.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -301,8 +301,7 @@ var MultilingualString = class MultilingualString {
301
301
  * Check if the multilingual string has any content
302
302
  */
303
303
  hasContent() {
304
- const contentEntries = Object.values(this._content);
305
- for (const entries of contentEntries) for (const entry of entries ?? []) if (entry.text.trim().length > 0 || entry.richText.trim().length > 0) return true;
304
+ for (const language of this._availableLanguages) for (const entry of this._content[language] ?? []) if (entry.text.trim().length > 0 || entry.richText.trim().length > 0) return true;
306
305
  return false;
307
306
  }
308
307
  /**
@@ -636,7 +636,7 @@ function parseWebElementProperties(componentProperty, elementResource, options,
636
636
  const queryVariant = componentReader.valueOr("query-variant", "submit");
637
637
  const boundElementUuid = componentReader.uuid("bound-element");
638
638
  const href = parseWebsiteLinkTarget(componentReader.valueNode("link-to"), context);
639
- if (!boundElementUuid && !href) throw new Error(formatComponentError("Bound element or href not found", componentName, elementResource), { cause: componentProperty });
639
+ if (boundElementUuid === null && href === null) throw new Error(formatComponentError("Bound element or href not found", componentName, elementResource), { cause: componentProperty });
640
640
  properties = {
641
641
  component: "search-bar",
642
642
  queryVariant,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "1.0.46",
3
+ "version": "1.0.47",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Node.js library for working with OCHRE (Online Cultural and Historical Research Environment) data",