()
| 10 | |
| 11 | /** A hash of the grammar's sources, recorded beside the .wasm when it's built. */ |
| 12 | export const grammarSourceHash = (): string => { |
| 13 | const hash = createHash("sha256") |
| 14 | for (const source of sources) hash.update(readFileSync(new URL(source, root))) |
| 15 | return hash.digest("hex") |
| 16 | } |
| 17 | |
| 18 | export const isBuildCurrent = (): boolean => |
| 19 | readFileSync(stampPath, "utf8").trim() === grammarSourceHash() |
no test coverage detected