Skip to content

Commit 48b30ee

Browse files
authored
Merge pull request #12846 from ethereum/fixFileIdsData
Only save .md files to file-ids JSON
2 parents 7ee1347 + e29df21 commit 48b30ee

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/scripts/crowdin/source-files/fetchAndSaveFileIds.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,12 @@ async function fetchFileIdsForDirectory(
3131
return []
3232
}
3333

34-
return response.data.map(
35-
(item: ResponseObject<SourceFilesModel.File>): FileItem => {
36-
return {
37-
id: item.data.id,
38-
path: item.data.path,
39-
}
40-
}
41-
)
34+
return response.data
35+
.map((item: ResponseObject<SourceFilesModel.File>): FileItem => ({
36+
id: item.data.id,
37+
path: item.data.path,
38+
}))
39+
.filter((file: FileItem) => file.path.endsWith('.md')); // filter out non-md files
4240
} catch (error: unknown) {
4341
if (error instanceof Error) {
4442
console.error(

0 commit comments

Comments
 (0)