1 parent 3536ae5 commit a09026cCopy full SHA for a09026c
1 file changed
scripts/backup-helper/commands/commit.mjs
@@ -158,7 +158,10 @@ function renderCommitProgress(summary) {
158
const parkingResultSchema = z
159
.object({
160
count: z.number().int().nonnegative(),
161
- pieces: z.array(z.string()),
+ pieces: z
162
+ .array(z.string())
163
+ .nullable()
164
+ .transform((pieces) => pieces ?? []),
165
})
166
.refine((value) => value.count === value.pieces.length, {
167
message: 'count must match pieces length',
@@ -193,7 +196,7 @@ async function runParkingBinary(dir, target) {
193
196
throw new Error(`commit: parking command returned invalid JSON: ${err?.message || err}`)
194
197
}
195
198
- return parkingResultSchema.parse(parsed)
199
+ return /** @type {ParkingResult} */ (parkingResultSchema.parse(parsed))
200
201
202
/**
0 commit comments