Normalized project hooks (known events only), or undefined if none.
(cwd: string)
| 104 | |
| 105 | /** Normalized project hooks (known events only), or undefined if none. */ |
| 106 | function readProjectHooks(cwd: string): HooksConfig | undefined { |
| 107 | const merged: HooksConfig = {} |
| 108 | mergeHooksInto(merged, readJson(getProjectSettingsPath(cwd))?.hooks) |
| 109 | return Object.keys(merged).length > 0 ? merged : undefined |
| 110 | } |
| 111 | |
| 112 | function hashHooks(hooks: HooksConfig): string { |
| 113 | return crypto.createHash("sha256").update(JSON.stringify(hooks)).digest("hex").slice(0, 16) |
no test coverage detected