INNER CODE UNIT · TypeScript
buildIndex
rit3zh/reacticx · cloudflare/codebase/index.ts:110
function buildIndex(files: readonly CodeFile[]) {
const grouped = Object.fromEntries(
config.sources.map((source) => [
source.id,
{
prefix: source.prefix,
source: source.dir,
files: files
.filter((file) => file.source === source.id)
.map((file) => ({
path: file.relativePath,
key: file.key,
size: file.size,
hash: file.hash,
contentType: file.contentType,
})),
},
]),