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

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

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

export const UserId = {
  of(value: number): Result<UserId, ValidationError> {
    if (!Number.isInteger(value)) {
      return Err({ field: "UserId", message: "must be an integer", value });
    }
    if (!(value > 0)) {
      return Err({ field: "UserId", message: "must be positive", value });
    }
    return Ok(value as UserId);
  },
  unsafe(value: number): UserId {
    return value as UserId;
  },
};

