File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff 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 (
Original file line number Diff line number Diff line change @@ -3,9 +3,11 @@ import matter from 'gray-matter'
33
44import 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
1113export async function readMarkdownFile ( filePath : string ) {
You can’t perform that action at this time.
0 commit comments