// 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 Subject = string & { readonly __brand: "Subject" };

export const Subject = {
  of(value: string): Result<Subject, ValidationError> {
    if (!(value.length > 0)) {
      return Err({ field: "Subject", message: "must be non-empty", value });
    }
    return Ok(value as Subject);
  },
  unsafe(value: string): Subject {
    return value as Subject;
  },
};

export function greeting(subject: Subject, count: number): string {
  return `Hello, ${String(subject)}! You are visitor #${String(count)} — cost \$0 \`free\`.`;
}

