Option2 무결성 강화: integrity index 추가, 인덱스 정렬/교차 검증, referencedAt 매트릭스, README 문서화 (TDD)
This commit is contained in:
@@ -7,6 +7,7 @@ export type AssetsIndex = {
|
||||
}
|
||||
|
||||
export function buildAssetsIndex(am: AssetManager): Uint8Array {
|
||||
// 그룹별 경로 수집
|
||||
const images: string[] = []
|
||||
const fonts: string[] = []
|
||||
const other: string[] = []
|
||||
@@ -15,6 +16,10 @@ export function buildAssetsIndex(am: AssetManager): Uint8Array {
|
||||
else if (ref.mimeType.startsWith('font/')) fonts.push(ref.path)
|
||||
else other.push(ref.path)
|
||||
}
|
||||
// 경로 사전순 정렬로 일정한 출력 보장
|
||||
images.sort()
|
||||
fonts.sort()
|
||||
other.sort()
|
||||
const obj: AssetsIndex = { images, fonts, other }
|
||||
const json = JSON.stringify(obj, null, 2)
|
||||
return new TextEncoder().encode(json)
|
||||
|
||||
Reference in New Issue
Block a user