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

export const Slug = {
  of(value: string): Result<Slug, ValidationError> {
    if (!new RegExp("^" + "[a-z][a-z0-9-]*" + "$").test(value)) {
      return Err({ field: "Slug", message: "must match /[a-z][a-z0-9-]*/", value });
    }
    return Ok(value as Slug);
  },
  unsafe(value: string): Slug {
    return value as Slug;
  },
};

