···66import isEmpty from "just-is-empty";
7788export const AltTextSchema = z.object({
99- alt: z.string().trim().max(MAX_ALT_TEXT, "alt text is too long").prefault("")
99+ alt: z.string().trim()
1010+ .max(MAX_ALT_TEXT, "alt text is too long")
1111+ .prefault("")
1012});
11131214export const ImageEmbedSchema = z.object({
···4951 }),
5052 type: z.literal(EmbedDataType.WebLink),
5153 title: z.string().trim().default(""),
5252- /* uri is the link to the website */
5454+ /* NOTE: uri is the link to the website here,
5555+ content is used as the thumbnail */
5356 uri: z.url({
5457 normalize: true,
5558 protocol: /^https?$/,
5659 hostname: z.regexes.domain,
5760 error: "provided weblink is not in the correct form of an url"
5858- }).trim().nonoptional("link embeds require a url"),
6161+ }).trim()
6262+ .nonoptional("link embeds require a url"),
5963 description: z.string().trim().default("")
6064});
6165···6569 protocol: /^https?$/,
6670 hostname: z.regexes.domain,
6771 error: "post/feed/list/followgraph record url is invalid"
6868- }).trim().toLowerCase().regex(postRecordURI, "url is not a post/feed/list/followgraph record").nonoptional("post/feed/list/followgraph records require a url"),
7272+ }).trim()
7373+ .toLowerCase()
7474+ .regex(postRecordURI, "url is not a post/feed/list/followgraph record")
7575+ .nonoptional("post/feed/list/followgraph records require a url"),
6976 type: z.literal(EmbedDataType.Record),
7077});