@@ -27,33 +27,19 @@ const path = require('path');
2727// Import shared utilities library
2828const sharedUtils = require ( '../shared/lib/utils' ) ;
2929
30- // Try to load company database (different filenames for different repos)
31- // Main repos: companies.json
32- // SEO repos: software.json, data-science.json, hardware.json, etc.
30+ // Load company database if present (New-Grad and Internships repos have companies.json;
31+ // SEO repos do not — company emoji/career URL features degrade gracefully to defaults)
3332let companies = { } ;
34- const possibleFiles = [ 'companies.json' , 'software.json' , 'data-science.json' , 'hardware.json' , 'nursing.json' ] ;
3533
36- for ( const file of possibleFiles ) {
37- const filePath = path . join ( __dirname , file ) ;
38- if ( fs . existsSync ( filePath ) ) {
39- companies = JSON . parse ( fs . readFileSync ( filePath , 'utf8' ) ) ;
40- break ;
41- }
42- }
34+ const companiesPath = path . join ( __dirname , 'companies.json' ) ;
35+ if ( fs . existsSync ( companiesPath ) ) {
36+ companies = JSON . parse ( fs . readFileSync ( companiesPath , 'utf8' ) ) ;
4337
44- // Initialize shared library with this repo's company data (if found and compatible format)
45- // Main repos use format: {category: [{name, api_names}, ...] }
46- // SEO repos use format: {category: {title, companies: [names]}}
47- // Only initialize for Main repo format to avoid errors
48- if ( Object . keys ( companies ) . length > 0 ) {
38+ // Only initialize for the expected format: {category: [{name, api_names}, ...] }
4939 const firstCategory = Object . values ( companies ) [ 0 ] ;
50-
51- // Check if Main repo format (array of company objects)
5240 if ( Array . isArray ( firstCategory ) ) {
5341 sharedUtils . initCompanyDatabase ( companies ) ;
5442 }
55- // SEO repo format - skip company init, just use shared filtering logic
56- // Company-specific features won't work, but core filtering (US location, experience level) will
5743}
5844
5945// Re-export all shared utilities
0 commit comments