Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@json-layout/core

Package Overview
Dependencies
Maintainers
0
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@json-layout/core - npm Package Compare versions

Comparing version 0.26.0 to 0.26.1

2

package.json
{
"name": "@json-layout/core",
"version": "0.26.0",
"version": "0.26.1",
"description": "Compilation and state management utilities for JSON Layout.",

@@ -5,0 +5,0 @@ "type": "module",

@@ -298,2 +298,6 @@ // eslint-disable-next-line import/no-named-default

}
// @ts-ignore
if (this._options._debugCache) createStateTreeContext._debugCache = this._lastCreateStateTreeContext?._debugCache ?? {}
this._stateTree = createStateTree(

@@ -300,0 +304,0 @@ createStateTreeContext,

@@ -273,7 +273,16 @@ import { isSwitchStruct, childIsCompObject, isCompositeLayout, isFocusableLayout, isItemsLayout, isGetItemsExpression, isGetItemsFetch } from '@json-layout/vocabulary'

// TODO: implement a cleaner way to filter context.errors while being able to reuse nodes with errors
if (skeleton.pure && reusedNode && !reusedNode.error && !reusedNode.childError) {
cacheKey = [parentOptions, compiledLayout, fullKey, skeleton, childDefinition, parentDisplay.width, validationState, context.activatedItems, context.initial, data]
if (context.cacheKeys[fullKey] && shallowEqualArray(context.cacheKeys[fullKey], cacheKey)) {
if (skeleton.pure && !reusedNode?.error && !reusedNode?.childError) {
const validatedCacheKey = validationState.validatedForm || validationState.validatedChildren.includes(fullKey)
cacheKey = [parentOptions, compiledLayout, fullKey, skeleton, childDefinition, parentDisplay.width, validatedCacheKey, context.activatedItems, context.initial, data]
if (reusedNode && context.cacheKeys[fullKey] && shallowEqualArray(context.cacheKeys[fullKey], cacheKey)) {
// @ts-ignore
if (context._debugCache) context._debugCache[fullKey] = (context._debugCache[fullKey] ?? []).concat(['hit'])
return reusedNode
} else {
// @ts-ignore
if (context._debugCache) context._debugCache[fullKey] = (context._debugCache[fullKey] ?? []).concat(['miss'])
}
} else {
// @ts-ignore
if (context._debugCache) context._debugCache[fullKey] = (context._debugCache[fullKey] ?? []).concat(['skip'])
}

@@ -432,15 +441,15 @@

}
let nodeData = data
if (nodeData === null && !layout.nullable) nodeData = undefined
const validated = validationState.validatedForm ||
validationState.validatedChildren.includes(fullKey) ||
(validationState.initialized === false && options.initialValidation === 'always') ||
(validationState.initialized === false && options.initialValidation === 'withData' && !isDataEmpty(data))
(validationState.initialized === false && options.initialValidation === 'withData' && !isDataEmpty(nodeData))
let nodeData = data
if (nodeData === null && !layout.nullable) nodeData = undefined
/** @type {unknown} */
if (typeof nodeData === 'object' && !(nodeData instanceof File)) {
if ((typeof nodeData === 'object' || (nodeData === undefined && children?.length)) && !(nodeData instanceof File)) {
nodeData = produceStateNodeData(
/** @type {Record<string, unknown>} */(nodeData ?? {}),
/** @type {Record<string, unknown>} */(nodeData ?? (typeof children?.[0]?.key === 'number' ? [] : {})),
dataPath,

@@ -447,0 +456,0 @@ children,

@@ -79,3 +79,3 @@ import { type ErrorObject } from 'ajv/dist/2019.js'

// [parentOptions, compiledLayout, fullKey, skeleton, childDefinition, parentWidth, validationState, activatedItems, initial, data]
// [parentOptions, compiledLayout, fullKey, skeleton, childDefinition, parentWidth, validated, activatedItems, initial, data]
export type StateNodeCacheKey = [

@@ -88,3 +88,3 @@ StateNodeOptions,

number,
ValidationState,
boolean,
Record<string, number>,

@@ -91,0 +91,0 @@ boolean,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc