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

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

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

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

