mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
12 lines
344 B
TypeScript
12 lines
344 B
TypeScript
import { IFileExistenceInput, IFileExistenceChecker } from '../schema'
|
|
|
|
export async function checkFiles(
|
|
checker: IFileExistenceChecker,
|
|
files: IFileExistenceInput[]
|
|
) {
|
|
const existences = await Promise.all(
|
|
files.map((file) => checker.exists(file))
|
|
)
|
|
return existences.every((exists, index) => exists === files[index].exists)
|
|
}
|