Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 | 2x 1872x 1872x | import type { PostType } from "../../shared/types/PostType.ts";
export const parseKey = (key: string): { type: PostType; id: number } | null => {
const match = /^(posts|pages)-(\d+)$/.exec(key);
return match ? { type: match[1] as PostType, id: Number(match[2]) } : null;
};
|