Skip to content

Commit cae3600

Browse files
committed
CR - Fix types
1 parent 658eff3 commit cae3600

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/app/agents/utils/get-rfs-data.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ export const OPEN_REQUESTS_DIR = path.join(
99
'src/app/agents/data/open-requests',
1010
)
1111

12-
export async function getRFSData(slug: string) {
12+
type RFSDataItem = Awaited<ReturnType<typeof readRFSFile>>
13+
14+
export async function getRFSData(slug: string): Promise<RFSDataItem> {
1315
return readRFSFile(slug)
1416
}
1517

16-
export async function getAllRFSData() {
18+
export async function getAllRFSData(): Promise<RFSDataItem[]> {
1719
const slugs = await getMarkdownSlugs(OPEN_REQUESTS_DIR)
1820
const results = await Promise.all(slugs.map(getRFSData))
1921
return results.sort(

src/utils/markdown.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import matter from 'gray-matter'
33

44
import fs from 'node:fs/promises'
55

6-
export async function getMarkdownSlugs(directoryPath: string) {
6+
export async function getMarkdownSlugs(
7+
directoryPath: string,
8+
): Promise<string[]> {
79
const filenames = await fg('*.md', { cwd: directoryPath })
8-
return filenames.map((file) => file.replace('.md', ''))
10+
return filenames.map((file: string) => file.replace('.md', ''))
911
}
1012

1113
export async function readMarkdownFile(filePath: string) {

0 commit comments

Comments
 (0)