]> Untitled Git - lemmy-ui.git/blob - src/shared/utils/app/get-depth-from-comment.ts
fix: Fix badge alignment and break out into component
[lemmy-ui.git] / src / shared / utils / app / get-depth-from-comment.ts
1 import { Comment } from "lemmy-js-client";
2
3 export default function getDepthFromComment(
4   comment?: Comment
5 ): number | undefined {
6   const len = comment?.path.split(".").length;
7   return len ? len - 2 : undefined;
8 }