@domql/state
Advanced tools
Comparing version 2.3.141 to 2.3.144
@@ -30,3 +30,6 @@ 'use strict' | ||
if (skipApplyMethods) { | ||
state.parent = element.parent.state | ||
if (element.parent && element.parent.state) | ||
element.state.parent = element.parent.state | ||
else | ||
element.state.parent = element.state // self loop | ||
return element.state | ||
@@ -33,0 +36,0 @@ } |
@@ -31,3 +31,3 @@ "use strict"; | ||
const createState = function(element, parent, options) { | ||
const skip = options && options.skip ? options.skip : false; | ||
const skipApplyMethods = Boolean(options == null ? void 0 : options.skipApplyMethods); | ||
const objectizeState = checkForTypes(element); | ||
@@ -48,4 +48,9 @@ if (objectizeState === false) | ||
element.state = dependentState; | ||
if (skip) | ||
if (skipApplyMethods) { | ||
if (element.parent && element.parent.state) | ||
element.state.parent = element.parent.state; | ||
else | ||
element.state.parent = element.state; | ||
return element.state; | ||
} | ||
applyMethods(element); | ||
@@ -52,0 +57,0 @@ (0, import_event.triggerEventOn)("stateCreated", element); |
@@ -44,3 +44,3 @@ "use strict"; | ||
}; | ||
const getChildStateInKey = (stateKey, parentState, options) => { | ||
const getChildStateInKey = (stateKey, parentState, options = {}) => { | ||
const arr = stateKey.split("/"); | ||
@@ -47,0 +47,0 @@ const arrLength = arr.length - 1; |
@@ -104,3 +104,3 @@ "use strict"; | ||
}); | ||
const hasNotUpdated = !options.preventUpdate || !options.preventHoistElementUpdate; | ||
const hasNotUpdated = options.preventUpdate !== true || !options.preventHoistElementUpdate; | ||
if (!options.preventStateUpdateListener && hasNotUpdated) { | ||
@@ -121,3 +121,3 @@ (0, import_event.triggerEventOnUpdate)("stateUpdated", obj, element, options); | ||
const element = state.__element; | ||
if (!options.preventUpdate) { | ||
if (options.preventUpdate !== true) { | ||
element.update({}, { | ||
@@ -124,0 +124,0 @@ ...options, |
{ | ||
"name": "@domql/state", | ||
"version": "2.3.141", | ||
"version": "2.3.144", | ||
"license": "MIT", | ||
@@ -29,3 +29,3 @@ "type": "module", | ||
}, | ||
"gitHead": "c867d7db9e2450d67e97a15ffc7b61692713c234" | ||
"gitHead": "9204bcbe3bb5a7f42c5172b3d1b174a032311d49" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
34553
15
919
0