You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
375 B
10 lines
375 B
import { z } from "zod";
|
|
|
|
export const VISIBILITY_VALUES = ["private", "unlisted", "public"] as const;
|
|
export type Visibility = (typeof VISIBILITY_VALUES)[number];
|
|
|
|
export const visibilitySchema = z.enum(VISIBILITY_VALUES);
|
|
|
|
export function isVisibility(v: unknown): v is Visibility {
|
|
return typeof v === "string" && (VISIBILITY_VALUES as readonly string[]).includes(v);
|
|
}
|
|
|