(
filename: string,
resolve: (value: ComponentStatus | null) => void,
reject: (value: unknown) => void,
)
| 22 | const promises: Promise<ComponentStatus | null>[] = [] |
| 23 | |
| 24 | const handleCallback = ( |
| 25 | filename: string, |
| 26 | resolve: (value: ComponentStatus | null) => void, |
| 27 | reject: (value: unknown) => void, |
| 28 | ) => { |
| 29 | fs.readFile(path.resolve(dir, filename), 'utf-8', (err, content) => { |
| 30 | if (err) return reject(err) |
| 31 | |
| 32 | if (fm.test(content)) { |
| 33 | const { |
| 34 | attributes: {title, status}, |
| 35 | } = fm(content) |
| 36 | |
| 37 | if (status) { |
| 38 | return resolve({[title]: status}) |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | resolve(null) |
| 43 | }) |
| 44 | } |
| 45 | |
| 46 | for (const filename of filenames) { |
| 47 | const promise: Promise<ComponentStatus | null> = new Promise((resolve, reject) => { |
no test coverage detected