@rotorsoft/act 0.35.2 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/internal/merge.d.ts.map +1 -1
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1374,7 +1374,11 @@ function mergeIntoExisting(state2, existing, states, actions, events) {
|
|
|
1374
1374
|
}
|
|
1375
1375
|
for (const name of Object.keys(state2.events)) {
|
|
1376
1376
|
if (existing.events[name] === state2.events[name]) continue;
|
|
1377
|
-
if (existing.events[name])
|
|
1377
|
+
if (existing.events[name]) {
|
|
1378
|
+
throw new Error(
|
|
1379
|
+
`Event "${name}" in state "${state2.name}" is declared with different Zod schemas across slices. Cross-slice event schemas must reference the same instance \u2014 extract a shared schema (e.g. \`export const ${name} = z.object({ ... })\` in a shared module) and import it in every slice that declares it.`
|
|
1380
|
+
);
|
|
1381
|
+
}
|
|
1378
1382
|
if (events[name]) throw new Error(`Duplicate event "${name}"`);
|
|
1379
1383
|
}
|
|
1380
1384
|
const mergedPatch = mergePatches(existing.patch, state2.patch, state2.name);
|