security/codeql-dependabot-gitleaks
| 1 | import fs from "fs/promises" |
| 2 | import { generateHash } from "../utils" |
| 3 | import { getLayoutFilesFromSources } from "./helpers" |
| 4 | |
| 5 | export async function generateLayoutHash( |
| 6 | sources: Set<string> |
| 7 | ): Promise<string> { |
| 8 | const files = await getLayoutFilesFromSources(sources) |
| 9 | const contents = await Promise.all( |
| 10 | files.map((file) => fs.readFile(file, "utf-8")) |
| 11 | ) |
| 12 | return generateHash(contents.join("")) |
| 13 | } |