@rotorsoft/act 1.32.3 → 1.32.5
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/dist/.tsbuildinfo +1 -1
- package/dist/@types/builders/merge.d.ts.map +1 -1
- package/dist/@types/internal/autoclose-window.d.ts.map +1 -1
- package/dist/@types/internal/drain-cycle.d.ts.map +1 -1
- package/dist/index.cjs +22 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -15
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -809,7 +809,7 @@ function next_window_open(window, now) {
|
|
|
809
809
|
const boundary = new Date(
|
|
810
810
|
candidate.getTime() - candidate.getTime() % 36e5
|
|
811
811
|
);
|
|
812
|
-
if (is_dst_gap_open(boundary, window.timeZone, window.start))
|
|
812
|
+
if (boundary.getTime() >= start_ms && is_dst_gap_open(boundary, window.timeZone, window.start))
|
|
813
813
|
return boundary;
|
|
814
814
|
}
|
|
815
815
|
return new Date(start_ms + 864e5);
|
|
@@ -3050,6 +3050,7 @@ var DrainController = class {
|
|
|
3050
3050
|
if (!cycle) {
|
|
3051
3051
|
this._deps.breaker.passed();
|
|
3052
3052
|
this._armed = false;
|
|
3053
|
+
if (this._defer.size > 0) this._defer.schedule();
|
|
3053
3054
|
return EMPTY_DRAIN;
|
|
3054
3055
|
}
|
|
3055
3056
|
const { leased, fetched, handled, acked, blocked, closeable } = cycle;
|
|
@@ -4950,23 +4951,29 @@ function base_type_name(zodType) {
|
|
|
4950
4951
|
return t.constructor.name;
|
|
4951
4952
|
}
|
|
4952
4953
|
function merge_schemas(existing, incoming, state_name) {
|
|
4953
|
-
if (existing
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4954
|
+
if (existing === incoming) return existing;
|
|
4955
|
+
const existing_object = as_object(existing, "existing", state_name);
|
|
4956
|
+
const incoming_object = as_object(incoming, "incoming", state_name);
|
|
4957
|
+
const existing_shape = existing_object.shape;
|
|
4958
|
+
const incoming_shape = incoming_object.shape;
|
|
4959
|
+
for (const key of Object.keys(incoming_shape)) {
|
|
4960
|
+
if (key in existing_shape) {
|
|
4961
|
+
const existing_base = base_type_name(existing_shape[key]);
|
|
4962
|
+
const incoming_base = base_type_name(incoming_shape[key]);
|
|
4963
|
+
if (existing_base !== incoming_base) {
|
|
4964
|
+
throw new Error(
|
|
4965
|
+
`Schema conflict in "${state_name}": key "${key}" has type "${existing_base}" but incoming partial declares "${incoming_base}"`
|
|
4966
|
+
);
|
|
4965
4967
|
}
|
|
4966
4968
|
}
|
|
4967
|
-
return existing.extend(incoming_shape);
|
|
4968
4969
|
}
|
|
4969
|
-
return
|
|
4970
|
+
return existing_object.extend(incoming_shape);
|
|
4971
|
+
}
|
|
4972
|
+
function as_object(schema, side, state_name) {
|
|
4973
|
+
if (schema instanceof ZodObject) return schema;
|
|
4974
|
+
throw new Error(
|
|
4975
|
+
`Cannot merge state schemas for "${state_name}": the ${side} partial's schema is a ${schema.constructor.name}, not a z.object. Partials of the same state are merged by extending their shapes, so declare every partial's state as a plain z.object({ ... }).`
|
|
4976
|
+
);
|
|
4970
4977
|
}
|
|
4971
4978
|
function merge_inits(existing, incoming) {
|
|
4972
4979
|
return () => ({ ...existing(), ...incoming() });
|