@coderich/autograph 0.13.52 → 0.13.53

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coderich/autograph",
3
3
  "main": "index.js",
4
- "version": "0.13.52",
4
+ "version": "0.13.53",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -564,7 +564,7 @@ module.exports = class Schema {
564
564
  const [modelKey, ...fieldKeys] = path.split('.');
565
565
  const $model = Object.values(this.#schema.models).find(el => el[prop] === modelKey);
566
566
  if (!$model || !fieldKeys.length) return $model;
567
- return fieldKeys.reduce((parent, key) => Object.values(parent.fields || parent.model.fields).find(el => el[prop] === key) || parent, $model);
567
+ return fieldKeys.reduce((parent, key) => Object.values(parent.fields || parent.model?.fields || {}).find(el => el[prop] === key) || parent, $model);
568
568
  })();
569
569
  return resolvePathCache[path];
570
570
  };