@fedify/vocab-tools 2.0.29-dev.2107 → 2.0.29-dev.2139

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.
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/vocab-tools",
3
- "version": "2.0.29-dev.2107+5ab4c99b",
3
+ "version": "2.0.29-dev.2139+7e5d091d",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./src/mod.ts"
package/dist/mod.cjs CHANGED
@@ -8,7 +8,7 @@ let yaml = require("yaml");
8
8
  let es_toolkit = require("es-toolkit");
9
9
  //#region deno.json
10
10
  var name = "@fedify/vocab-tools";
11
- var version = "2.0.29-dev.2107+5ab4c99b";
11
+ var version = "2.0.29-dev.2139+7e5d091d";
12
12
  //#endregion
13
13
  //#region src/type.ts
14
14
  const HEURISTICS_CONTEXTS = [
@@ -1634,7 +1634,16 @@ async function* generateProperty(type, property, types) {
1634
1634
  ${JSON.stringify(property.compactName)}];
1635
1635
  const doc = Array.isArray(prop) ? prop[0] : prop;
1636
1636
  if (doc != null && typeof doc === "object" && "@context" in doc) {
1637
- v = await this.#${property.singularName}_fromJsonLd(doc, options);
1637
+ try {
1638
+ v = await this.#${property.singularName}_fromJsonLd(doc, options);
1639
+ } catch (error) {
1640
+ if (!options.suppressError) throw error;
1641
+ getLogger(["fedify", "vocab"]).debug(
1642
+ "Failed to parse embedded value of {property}: {error}",
1643
+ { property: ${JSON.stringify(property.uri)}, error },
1644
+ );
1645
+ return null;
1646
+ }
1638
1647
  }
1639
1648
  }
1640
1649
  `;
@@ -1731,7 +1740,16 @@ async function* generateProperty(type, property, types) {
1731
1740
  ${JSON.stringify(property.compactName)}];
1732
1741
  const obj = Array.isArray(prop) ? prop[i] : prop;
1733
1742
  if (obj != null && typeof obj === "object" && "@context" in obj) {
1734
- v = await this.#${property.singularName}_fromJsonLd(obj, options);
1743
+ try {
1744
+ v = await this.#${property.singularName}_fromJsonLd(obj, options);
1745
+ } catch (error) {
1746
+ if (!options.suppressError) throw error;
1747
+ getLogger(["fedify", "vocab"]).debug(
1748
+ "Failed to parse embedded value of {property} at index {index}: {error}",
1749
+ { property: ${JSON.stringify(property.uri)}, index: i, error },
1750
+ );
1751
+ continue;
1752
+ }
1735
1753
  }
1736
1754
  }
1737
1755
  `;
package/dist/mod.js CHANGED
@@ -7,7 +7,7 @@ import { parse } from "yaml";
7
7
  import { pascalCase } from "es-toolkit";
8
8
  //#region deno.json
9
9
  var name = "@fedify/vocab-tools";
10
- var version = "2.0.29-dev.2107+5ab4c99b";
10
+ var version = "2.0.29-dev.2139+7e5d091d";
11
11
  //#endregion
12
12
  //#region src/type.ts
13
13
  const HEURISTICS_CONTEXTS = [
@@ -1633,7 +1633,16 @@ async function* generateProperty(type, property, types) {
1633
1633
  ${JSON.stringify(property.compactName)}];
1634
1634
  const doc = Array.isArray(prop) ? prop[0] : prop;
1635
1635
  if (doc != null && typeof doc === "object" && "@context" in doc) {
1636
- v = await this.#${property.singularName}_fromJsonLd(doc, options);
1636
+ try {
1637
+ v = await this.#${property.singularName}_fromJsonLd(doc, options);
1638
+ } catch (error) {
1639
+ if (!options.suppressError) throw error;
1640
+ getLogger(["fedify", "vocab"]).debug(
1641
+ "Failed to parse embedded value of {property}: {error}",
1642
+ { property: ${JSON.stringify(property.uri)}, error },
1643
+ );
1644
+ return null;
1645
+ }
1637
1646
  }
1638
1647
  }
1639
1648
  `;
@@ -1730,7 +1739,16 @@ async function* generateProperty(type, property, types) {
1730
1739
  ${JSON.stringify(property.compactName)}];
1731
1740
  const obj = Array.isArray(prop) ? prop[i] : prop;
1732
1741
  if (obj != null && typeof obj === "object" && "@context" in obj) {
1733
- v = await this.#${property.singularName}_fromJsonLd(obj, options);
1742
+ try {
1743
+ v = await this.#${property.singularName}_fromJsonLd(obj, options);
1744
+ } catch (error) {
1745
+ if (!options.suppressError) throw error;
1746
+ getLogger(["fedify", "vocab"]).debug(
1747
+ "Failed to parse embedded value of {property} at index {index}: {error}",
1748
+ { property: ${JSON.stringify(property.uri)}, index: i, error },
1749
+ );
1750
+ continue;
1751
+ }
1734
1752
  }
1735
1753
  }
1736
1754
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/vocab-tools",
3
- "version": "2.0.29-dev.2107+5ab4c99b",
3
+ "version": "2.0.29-dev.2139+7e5d091d",
4
4
  "description": "Code generator for Activity Vocabulary APIs",
5
5
  "homepage": "https://fedify.dev/",
6
6
  "repository": {