@trainheroic-unofficial/dto 3.5.0 → 3.5.1
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/index.mjs +6 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -744,6 +744,12 @@ const exerciseSpecSchema = z.object({
|
|
|
744
744
|
instr: z.string().optional(),
|
|
745
745
|
param_1_type: z.number().optional(),
|
|
746
746
|
param_2_type: z.number().optional()
|
|
747
|
+
}).superRefine((exercise, ctx) => {
|
|
748
|
+
if (Array.isArray(exercise.reps) && Array.isArray(exercise.weight) && exercise.reps.length !== exercise.weight.length) ctx.addIssue({
|
|
749
|
+
code: "custom",
|
|
750
|
+
message: `Per-set reps and weight arrays must have the same length; received ${exercise.reps.length} reps and ${exercise.weight.length} weights.`,
|
|
751
|
+
path: ["weight"]
|
|
752
|
+
});
|
|
747
753
|
});
|
|
748
754
|
/** A block's Red-Zone leaderboard: a unit string/number, or an object with options. */
|
|
749
755
|
const leaderboardSpecSchema = z.union([
|