@json-layout/core
Advanced tools
Comparing version 0.19.0 to 0.20.0
{ | ||
"name": "@json-layout/core", | ||
"version": "0.19.0", | ||
"version": "0.20.0", | ||
"description": "Compilation and state management utilities for JSON Layout.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -115,3 +115,12 @@ // import Debug from 'debug' | ||
/** @type {import('./types.js').SkeletonNode} */ | ||
const node = { key: key ?? '', pointer, parentPointer, pure, propertyKeys: [], roPropertyKeys: [] } | ||
const node = { | ||
key: key ?? '', | ||
pointer, | ||
parentPointer, | ||
pure, | ||
propertyKeys: [], | ||
roPropertyKeys: [], | ||
nullable, | ||
required: required && !nullable | ||
} | ||
@@ -118,0 +127,0 @@ if (condition) { |
@@ -74,2 +74,4 @@ import type ajvModule from 'ajv/dist/2019.js' | ||
childrenTrees?: SkeletonTree[] // other trees that can be instantiated with separate validation (for example in the case of new array items of oneOfs, etc) | ||
required?: boolean | ||
nullable?: boolean | ||
} |
@@ -429,3 +429,7 @@ // eslint-disable-next-line import/no-named-default | ||
if (!parentNode) throw new Error(`parent with key "${node.parentFullKey}" not found`) | ||
const newParentValue = producePatchedData(parentNode.data ?? (typeof node.key === 'number' ? [] : {}), node, data) | ||
const newParentValue = producePatchedData( | ||
parentNode.data ?? (typeof node.key === 'number' ? [] : {}), | ||
node, | ||
(data === null || data === undefined) ? (node.skeleton.nullable ? null : undefined) : data | ||
) | ||
this.applyInput(parentNode, newParentValue, validated) | ||
@@ -432,0 +436,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95464
22
2449