// Generated by bynkc — do not edit by hand.
// commons test

import { Ok, Err, Some, None, type Result, type Option, type ValidationError } from "./runtime.js";

export type Reps = number & { readonly __brand: "Reps" };

export const Reps = {
  of(value: number): Result<Reps, ValidationError> {
    if (!Number.isInteger(value)) {
      return Err({ field: "Reps", message: "must be an integer", value });
    }
    if (!(value >= 1 && value <= 100)) {
      return Err({ field: "Reps", message: "must be in range [1, 100]", value });
    }
    return Ok(value as Reps);
  },
  unsafe(value: number): Reps {
    return value as Reps;
  },
};

export function make(n: number): Result<Reps, ValidationError> {
  return Reps.of(n);
}

