()
| 120 | } |
| 121 | |
| 122 | export async function getAllFeatureSlugs(): Promise<string[]> { |
| 123 | try { |
| 124 | const files = readdirSync(contentDir); |
| 125 | return files |
| 126 | .filter((file) => file.endsWith('.json')) |
| 127 | .map((file) => file.replace('.json', '')); |
| 128 | } catch (error) { |
| 129 | console.error('Error reading features directory:', error); |
| 130 | return []; |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | export async function loadFeatureSource(): Promise<FeatureData[]> { |
| 135 | const slugs = await getAllFeatureSlugs(); |
no test coverage detected