MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / getBookmarks

Function getBookmarks

web/src/lib/bookmarks.ts:5–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3const KEY = "pbp_bookmarks_v1";
4
5export function getBookmarks(): string[] {
6 if (typeof window === "undefined") return [];
7 try {
8 return (JSON.parse(localStorage.getItem(KEY) || "[]") as string[]) || [];
9 } catch {
10 return [];
11 }
12}
13
14function setBookmarks(arr: string[]): void {
15 if (typeof window === "undefined") return;

Callers 2

HomeFunction · 0.90
toggleBookmarkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected