ntms
Version:
A dead simple way to add i18n to your Next.js app using the Notion API and Deepl
17 lines (14 loc) • 457 B
text/typescript
import { RichText, annotationsKey } from "../types";
const hasAnnotations = (rich_text: RichText[]): boolean => {
return rich_text.some((c: RichText) => {
return (
// @ts-ignore
Object.keys(c.annotations).some((key: annotationsKey) => {
const value = c.annotations[key];
if (key === "color") return !!value && value !== "default";
return value;
}) || !!c.href
);
});
};
export default hasAnnotations;