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

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

/**
 * The docs.demo commons.
 *
 * A small commons used to demonstrate documentation blocks attached to the
 * commons itself, rather than to any specific declaration.
 */

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

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

