fix: exercise production evidence asset lookup
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
export const evidenceAssets = {
|
||||
"fetch-strategy-boundary": {
|
||||
src: "/media/fetch-strategy-boundary.svg",
|
||||
width: 1080,
|
||||
height: 420,
|
||||
triggerLabel: "Fetch Join과 Batch Fetch 비교 다이어그램 크게 보기",
|
||||
dialogLabel: "Fetch Join과 Batch Fetch의 페이징 경계 확대",
|
||||
},
|
||||
} as const;
|
||||
|
||||
export type SupportedEvidenceKey = keyof typeof evidenceAssets;
|
||||
|
||||
export function isSupportedEvidenceKey(
|
||||
key: string,
|
||||
): key is SupportedEvidenceKey {
|
||||
return Object.hasOwn(evidenceAssets, key);
|
||||
}
|
||||
|
||||
export function getEvidenceAsset(key: string) {
|
||||
if (!isSupportedEvidenceKey(key)) {
|
||||
throw new Error(`Unknown local evidence asset: ${key}`);
|
||||
}
|
||||
|
||||
return evidenceAssets[key];
|
||||
}
|
||||
Reference in New Issue
Block a user