Update src/lib/data.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -19,11 +19,20 @@ const deployImports = import.meta.glob('../../data/deploys/*.json', {
|
|||||||
import: 'default'
|
import: 'default'
|
||||||
}) as Record<string, DeployFile>;
|
}) as Record<string, DeployFile>;
|
||||||
|
|
||||||
|
// Validate that deployImports succeeded
|
||||||
|
if (!deployImports || Object.keys(deployImports).length === 0) {
|
||||||
|
console.warn('No deploy data files found');
|
||||||
|
}
|
||||||
|
|
||||||
const beaconImports = import.meta.glob('../../data/beacons/*.json', {
|
const beaconImports = import.meta.glob('../../data/beacons/*.json', {
|
||||||
eager: true,
|
eager: true,
|
||||||
import: 'default'
|
import: 'default'
|
||||||
}) as Record<string, BeaconFile>;
|
}) as Record<string, BeaconFile>;
|
||||||
|
|
||||||
|
// Validate that beaconImports succeeded
|
||||||
|
if (!beaconImports || Object.keys(beaconImports).length === 0) {
|
||||||
|
console.warn('No beacon data files found');
|
||||||
|
}
|
||||||
function flatten<T extends { ts: string }>(files: Record<string, T[]>): T[] {
|
function flatten<T extends { ts: string }>(files: Record<string, T[]>): T[] {
|
||||||
return Object.values(files)
|
return Object.values(files)
|
||||||
.flat()
|
.flat()
|
||||||
|
|||||||
Reference in New Issue
Block a user