Skip to content

Commit c1d2c28

Browse files
committed
fix broken type
1 parent 3079c46 commit c1d2c28

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/generator/disclaimer.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,15 @@ export const gfs = {
5252
*/
5353
export async function main() {
5454
const res = await request<LibraryMetadata[]>({url: libraryListUrl});
55-
const disclaimers = res.data.map(lib => {
56-
return {
57-
api: lib.api_id.split('.')[0],
58-
package: lib.distribution_name,
59-
};
60-
});
55+
// console.log(typeof res.data)
56+
const disclaimers = JSON.parse(res.data as unknown as string).map(
57+
(lib: LibraryMetadata) => {
58+
return {
59+
api: lib.api_id.split('.')[0],
60+
package: lib.distribution_name,
61+
};
62+
},
63+
);
6164
gfs.writeFileSync('./disclaimers.json', JSON.stringify(disclaimers, null, 2));
6265
}
6366

0 commit comments

Comments
 (0)