@zag-js/core
Advanced tools
Comparing version 0.62.0 to 0.62.1
@@ -156,3 +156,3 @@ export { Ref, proxy, ref, snapshot, subscribe } from '@zag-js/store'; | ||
type StateInitObject<TContext, TState extends StateSchema> = { | ||
context: TContext; | ||
context?: TContext; | ||
value: TState["value"] | null; | ||
@@ -159,0 +159,0 @@ tags?: TState["tags"][]; |
@@ -76,22 +76,2 @@ "use strict"; | ||
// ../utilities/core/src/split-props.ts | ||
function splitProps(props, keys) { | ||
const rest = {}; | ||
const result = {}; | ||
const keySet = new Set(keys); | ||
for (const key in props) { | ||
if (keySet.has(key)) { | ||
result[key] = props[key]; | ||
} else { | ||
rest[key] = props[key]; | ||
} | ||
} | ||
return [result, rest]; | ||
} | ||
var createSplitProps = (keys) => { | ||
return function split(props) { | ||
return splitProps(props, keys); | ||
}; | ||
}; | ||
// ../utilities/core/src/object.ts | ||
@@ -115,5 +95,2 @@ function compact(obj) { | ||
}; | ||
function omit(obj, keys) { | ||
return createSplitProps(keys)(obj)[1]; | ||
} | ||
@@ -873,6 +850,4 @@ // ../utilities/core/src/warning.ts | ||
const state = this.getState(); | ||
const computedKeys = Object.keys(this.config.computed ?? {}); | ||
return { | ||
value: state.value, | ||
context: omit(state.context, computedKeys), | ||
tags: state.tags | ||
@@ -879,0 +854,0 @@ }; |
{ | ||
"name": "@zag-js/core", | ||
"version": "0.62.0", | ||
"version": "0.62.1", | ||
"description": "A minimal implementation of xstate fsm for UI machines", | ||
@@ -30,7 +30,7 @@ "keywords": [ | ||
"klona": "2.0.6", | ||
"@zag-js/store": "0.62.0" | ||
"@zag-js/store": "0.62.1" | ||
}, | ||
"devDependencies": { | ||
"clean-package": "2.2.0", | ||
"@zag-js/utils": "0.62.0" | ||
"@zag-js/utils": "0.62.1" | ||
}, | ||
@@ -37,0 +37,0 @@ "clean-package": "../../clean-package.config.json", |
@@ -13,3 +13,2 @@ import { ref, snapshot, subscribe } from "@zag-js/store" | ||
noop, | ||
omit, | ||
runIfFn, | ||
@@ -805,6 +804,4 @@ uuid, | ||
const state = this.getState() | ||
const computedKeys = Object.keys(this.config.computed ?? {}) | ||
return { | ||
value: state.value, | ||
context: omit(state.context, computedKeys) as any, | ||
tags: state.tags, | ||
@@ -811,0 +808,0 @@ } |
@@ -279,3 +279,3 @@ /* ----------------------------------------------------------------------------- | ||
export type StateInitObject<TContext, TState extends StateSchema> = { | ||
context: TContext | ||
context?: TContext | ||
value: TState["value"] | null | ||
@@ -282,0 +282,0 @@ tags?: TState["tags"][] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
298251
3560
+ Added@zag-js/store@0.62.1(transitive)
- Removed@zag-js/store@0.62.0(transitive)
Updated@zag-js/store@0.62.1