mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: videos
This commit is contained in:
1 parent
0fd17d9c96
commit
dd41cac3ac
3 files changed
+81
-2
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { asset } from './asset';
|
||||
|
||||
export const videoDefinitions = fetch(asset('definitions/videos.csv'))
|
||||
.then((response) => response.text())
|
||||
.then((text) =>
|
||||
text
|
||||
.split('\n')
|
||||
.map((line) => {
|
||||
const [idString, ...videos] = line.split(',');
|
||||
const id = Number(idString);
|
||||
return { id, videos };
|
||||
})
|
||||
.filter(({ videos }) => videos.length > 0)
|
||||
.reduce<Record<number, string[]>>((accumulator, { id, videos }) => {
|
||||
accumulator[id] = videos;
|
||||
return accumulator;
|
||||
}, {}),
|
||||
);
|
||||
Reference in new issue
Block a user