1
1
import { readFile } from "fs/promises"
2
2
import { promisify } from "util"
3
+ // @ts -expect-error -- types are missing
3
4
import * as frontmatterParser from "parser-front-matter"
4
5
import { Library } from "../sort-libraries/sort-libraries"
5
6
@@ -41,12 +42,14 @@ export async function updateCodeData(
41
42
const languageSupportDirIndex = pathArr . indexOf ( "language-support" )
42
43
const languageNameSlugIndex = languageSupportDirIndex + 1
43
44
const languageNameSlug = pathArr [ languageNameSlugIndex ]
45
+ // @ts -expect-error fixme
44
46
const languageName = slugMap [ languageNameSlug ]
45
47
codeData . Languages ||= { }
46
48
codeData . Languages [ languageName ] ||= { }
47
49
48
50
const categoryNameSlugIndex = languageSupportDirIndex + 2
49
51
const categoryNameSlug = pathArr [ categoryNameSlugIndex ]
52
+ // @ts -expect-error fixme
50
53
const categoryName = slugMap [ categoryNameSlug ]
51
54
codeData . Languages [ languageName ] [ categoryName ] ||= [ ]
52
55
codeData . Languages [ languageName ] [ categoryName ] . push ( {
@@ -65,11 +68,13 @@ export async function updateCodeData(
65
68
const toolSupportDirIndex = pathArr . indexOf ( "tools" )
66
69
const toolNameSlugIndex = toolSupportDirIndex + 1
67
70
const toolNameSlug = pathArr [ toolNameSlugIndex ]
71
+ // @ts -expect-error fixme
68
72
const toolName = slugMap [ toolNameSlug ]
69
73
codeData . Tools ||= { }
70
74
codeData . Tools [ toolName ] ||= { }
71
75
const categoryToolsNameSlugIndex = toolSupportDirIndex + 2
72
76
const categoryToolsNameSlug = pathArr [ categoryToolsNameSlugIndex ]
77
+ // @ts -expect-error fixme
73
78
const categoryToolsName = slugMap [ categoryToolsNameSlug ]
74
79
codeData . Tools [ toolName ] [ categoryToolsName ] ||= [ ]
75
80
@@ -89,8 +94,11 @@ export async function updateCodeData(
89
94
const codeDirIndex = pathArr . indexOf ( "code" )
90
95
const categoryNameSlugIndex = codeDirIndex + 1
91
96
const categoryNameSlug = pathArr [ categoryNameSlugIndex ]
97
+ // @ts -expect-error fixme
92
98
const categoryName = slugMap [ categoryNameSlug ]
99
+ // @ts -expect-error fixme
93
100
codeData [ categoryName ] ||= [ ]
101
+ // @ts -expect-error fixme
94
102
codeData [ categoryName ] . push ( {
95
103
name,
96
104
description,
0 commit comments