@ai-matrx/content-ir 0.10.1 → 0.10.3

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/dist/index.cjs CHANGED
@@ -1660,9 +1660,10 @@ var KindStreamParser = class {
1660
1660
  }
1661
1661
  validateFinalFieldValue(fieldSchema, value, fieldName, objectKind) {
1662
1662
  if (fieldSchema.type === "json") return null;
1663
+ if (value === null && fieldSchema.nullable === true) return null;
1663
1664
  if (fieldSchema.type === "json[]") {
1664
1665
  if (value === null) {
1665
- return fieldSchema.nullable ? null : `Field "${fieldName}" on kind "${objectKind}" cannot be null.`;
1666
+ return `Field "${fieldName}" on kind "${objectKind}" cannot be null.`;
1666
1667
  }
1667
1668
  if (!Array.isArray(value)) {
1668
1669
  return `Field "${fieldName}" on kind "${objectKind}" must be an array.`;
@@ -1759,6 +1760,7 @@ var KindStreamParser = class {
1759
1760
  if (fieldSchema.type === "json") {
1760
1761
  return null;
1761
1762
  }
1763
+ if (value === null && fieldSchema.nullable === true) return null;
1762
1764
  if (fieldSchema.type === "array" || fieldSchema.type === "json[]") {
1763
1765
  return valueKind === "array" ? null : `Field "${fieldName}" must be an array.`;
1764
1766
  }
@@ -1887,6 +1889,8 @@ var KindStreamParser = class {
1887
1889
  const fieldKey = this.fieldKeyFromPath(path);
1888
1890
  if (!fieldKey) return void 0;
1889
1891
  const parentPath = path.slice(0, -1);
1892
+ const inlineFields = this.inlineSchemas.get(this.pathKey(parentPath));
1893
+ if (inlineFields) return inlineFields[fieldKey];
1890
1894
  const parentKind = this.getObjectKindForPath(parentPath);
1891
1895
  if (!parentKind) return void 0;
1892
1896
  return this.lookupSchema(parentKind)?.fields[fieldKey];