feat: Replace eslint => oxlint + oxfmt
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import * as z from "zod";
|
||||
import type { AcfSocialFragment } from "#graphql/operations";
|
||||
|
||||
const socialProfile = z.object({ url: z.url() }).transform(({ url }) => ({ url, icon: getSocialIcon(url) }));
|
||||
const socialProfile = z
|
||||
.object({ url: z.url() })
|
||||
.transform(({ url }) => ({ url, icon: getSocialIcon(url) }));
|
||||
const acfSocialSchema = z.object({
|
||||
profiles: z.array(socialProfile),
|
||||
});
|
||||
@@ -10,8 +12,7 @@ export type AcfSocialOutput = z.infer<typeof acfSocialSchema>;
|
||||
export function parseAcfSocial(data?: AcfSocialFragment) {
|
||||
try {
|
||||
return acfSocialSchema.parse(data);
|
||||
}
|
||||
catch {
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user