mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 18:34:02 +00:00
Format extracted vessel components
This commit is contained in:
1 parent
2f4839e8f2
commit
a0b2d9f6aa
17 files changed
+2693
-2385
No files matched your search
@@ -5,13 +5,19 @@ import { fileURLToPath } from 'node:url';
|
||||
/** Read actual component owners for structural regression assertions. */
|
||||
export function readLayerSource(file) {
|
||||
const path = file instanceof URL ? fileURLToPath(file) : file;
|
||||
if (!['flights.js', 'militaryFlights.js', 'aisLiveVessels.js'].includes(basename(path)))
|
||||
if (
|
||||
!['flights.js', 'militaryFlights.js', 'aisLiveVessels.js'].includes(
|
||||
basename(path),
|
||||
)
|
||||
)
|
||||
return readFileSync(path, 'utf8');
|
||||
const directory = join(
|
||||
dirname(path),
|
||||
basename(path) === 'flights.js'
|
||||
? '../layers/flights'
|
||||
: basename(path) === 'militaryFlights.js' ? '../layers/military' : '../layers/vessels',
|
||||
: basename(path) === 'militaryFlights.js'
|
||||
? '../layers/military'
|
||||
: '../layers/vessels',
|
||||
);
|
||||
return readdirSync(directory)
|
||||
.filter((name) => name.endsWith('.js'))
|
||||
|
||||
Reference in new issue
Block a user