blob: 32a84baa28c70d5bfa4fb4d71ae17041ff537d97 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import type { Bookmark } from "@/timeline";
import type { SnapPoint } from "@/timeline/snapping";
export function getBookmarkSnapPoints({
bookmarks,
excludeBookmarkTime,
}: {
bookmarks: Bookmark[];
excludeBookmarkTime?: number;
}): SnapPoint[] {
return bookmarks.flatMap((bookmark) => {
if (excludeBookmarkTime != null && bookmark.time === excludeBookmarkTime) {
return [];
}
return [
{ time: bookmark.time, type: "bookmark" satisfies SnapPoint["type"] },
];
});
}
|