@adobe/helix-md2jcr 1.1.22 → 1.1.23

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.1.23](https://github.com/adobe/helix-md2jcr/compare/v1.1.22...v1.1.23) (2025-06-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * gracefully handle non existing models ([#106](https://github.com/adobe/helix-md2jcr/issues/106)) ([7564c93](https://github.com/adobe/helix-md2jcr/commit/7564c938c51dd00af66c292c5b0c71a306462127))
7
+
1
8
  ## [1.1.22](https://github.com/adobe/helix-md2jcr/compare/v1.1.21...v1.1.22) (2025-06-12)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-md2jcr",
3
- "version": "1.1.22",
3
+ "version": "1.1.23",
4
4
  "description": "Helix Service that converts markdown to JCR content structure",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -38,7 +38,7 @@ function findModelById(models, modelId) {
38
38
  * @return {Field} field The field or undefined if not found.
39
39
  */
40
40
  function getField(model, fieldName) {
41
- return model.fields.find((field) => field.name === fieldName);
41
+ return model ? model.fields.find((field) => field.name === fieldName) : undefined;
42
42
  }
43
43
 
44
44
  /**
@@ -47,9 +47,11 @@ function getField(model, fieldName) {
47
47
  * @return {Array<string>} An array of field names.
48
48
  */
49
49
  function getModelFieldNames(model) {
50
- return model.fields
51
- .map((f) => f.name)
52
- .filter((f) => f !== 'classes');
50
+ return model
51
+ ? model.fields
52
+ .map((f) => f.name)
53
+ .filter((f) => f !== 'classes')
54
+ : [];
53
55
  }
54
56
 
55
57
  export {