repo_description: Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿
repo_topics: blockchain crypto dapp graphql hacktoberfest lens-protocol nextjs react social-media tailwindcss turborepo typescript vitest wagmi web3
code: import type { AnyPostFragment } from "@/indexer/generated";
  
  type Typename<T = string> = { [key in "__typename"]?: T };
  
  type PickByTypename<
    T extends Typename,
    P extends T["__typename"] | undefined
  > = T extends {
    __typename?: P;
  }
    ? T
    : never;
  
  export const isRepost = <T extends AnyPostFragment>(
    post: null | T
  ): post is PickByTypename<T, "Repost"> => {
    return post?.__typename === "Repost";
  };
  