@json-layout/core
Advanced tools
Comparing version 0.24.0 to 0.24.1
{ | ||
"name": "@json-layout/core", | ||
"version": "0.24.0", | ||
"version": "0.24.1", | ||
"description": "Compilation and state management utilities for JSON Layout.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -425,6 +425,10 @@ import { isSwitchStruct, childIsCompObject, isCompositeLayout, isFocusableLayout, isItemsLayout, isGetItemsExpression, isGetItemsFetch } from '@json-layout/vocabulary' | ||
let nodeData = data | ||
if (nodeData === null && !layout.nullable) nodeData = undefined | ||
/** @type {unknown} */ | ||
let nodeData = typeof data === 'object' && !(data instanceof File) | ||
? produceStateNodeData( | ||
/** @type {Record<string, unknown>} */(data ?? {}), | ||
if (typeof nodeData === 'object' && !(nodeData instanceof File)) { | ||
nodeData = produceStateNodeData( | ||
/** @type {Record<string, unknown>} */(nodeData ?? {}), | ||
dataPath, | ||
@@ -436,10 +440,10 @@ children, | ||
) | ||
: data | ||
// the producer is not perfect, sometimes data is considered mutated but it is actually the same | ||
// we double check here to avoid unnecessary re-renders | ||
if (nodeData !== data) { | ||
if (Array.isArray(data) && Array.isArray(nodeData)) nodeData = shallowProduceArray(data, nodeData) | ||
// @ts-ignore | ||
else if (typeof data === 'object' && typeof nodeData === 'object') nodeData = shallowProduceObject(data, nodeData) | ||
// the producer is not perfect, sometimes data is considered mutated but it is actually the same | ||
// we double check here to avoid unnecessary re-renders | ||
if (nodeData !== data) { | ||
if (Array.isArray(data) && Array.isArray(nodeData)) nodeData = shallowProduceArray(data, nodeData) | ||
// @ts-ignore | ||
else if (typeof data === 'object' && typeof nodeData === 'object') nodeData = shallowProduceObject(data, nodeData) | ||
} | ||
} | ||
@@ -446,0 +450,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
151412
62
3441