fix: refactor some stuff
This commit is contained in:
@@ -3,30 +3,25 @@ export const resources = {
|
||||
emoji: "House with Garden.png",
|
||||
name: "Home",
|
||||
link: "/",
|
||||
prefix: "",
|
||||
},
|
||||
"recipe": {
|
||||
emoji: "Fork and Knife with Plate.png",
|
||||
name: "Recipes",
|
||||
link: "/recipes",
|
||||
prefix: "Recipes/",
|
||||
},
|
||||
"movie": {
|
||||
emoji: "Popcorn.png",
|
||||
name: "Movies",
|
||||
link: "/movies",
|
||||
prefix: "Media/movies/",
|
||||
},
|
||||
"article": {
|
||||
emoji: "Writing Hand Medium-Light Skin Tone.png",
|
||||
name: "Articles",
|
||||
link: "/articles",
|
||||
prefix: "Media/articles/",
|
||||
},
|
||||
"series": {
|
||||
emoji: "Television.png",
|
||||
name: "Series",
|
||||
link: "/series",
|
||||
prefix: "Media/series/",
|
||||
},
|
||||
} as const;
|
||||
|
||||
@@ -97,12 +97,6 @@ export function getCookie(name: string): string | null {
|
||||
})[0] || null;
|
||||
}
|
||||
|
||||
const resourcePrefixes = Object.values(resources).map((v) => v.prefix).filter(
|
||||
(s) => s.length > 2,
|
||||
);
|
||||
export const isLocalImage = (src: string) =>
|
||||
resourcePrefixes.some((p) => src.startsWith(p));
|
||||
|
||||
export const isString = (input: string | undefined): input is string => {
|
||||
return typeof input === "string";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user