feat: enhance layout of search
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { resources } from "@lib/resources.ts";
|
||||
|
||||
export function formatDate(date: Date): string {
|
||||
const options = { year: "numeric", month: "long", day: "numeric" } as const;
|
||||
return new Intl.DateTimeFormat("en-US", options).format(date);
|
||||
@@ -92,3 +94,9 @@ export function getCookie(name: string): string | null {
|
||||
return decodeURIComponent(cookie.substring(nameLenPlus));
|
||||
})[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));
|
||||
|
||||
Reference in New Issue
Block a user