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

export const CountryCode = {
  of(value: string): Result<CountryCode, ValidationError> {
    if (!(value.length === 2)) {
      return Err({ field: "CountryCode", message: "length must be exactly 2", value });
    }
    return Ok(value as CountryCode);
  },
  unsafe(value: string): CountryCode {
    return value as CountryCode;
  },
};

