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

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

