Function
emit
(decision: "approve" | "block", reason?: string)
Source from the content-addressed store, hash-verified
| 166 | } |
| 167 | |
| 168 | function emit(decision: "approve" | "block", reason?: string): never { |
| 169 | const out: { decision: string; reason?: string } = { decision }; |
| 170 | if (reason !== undefined && reason !== "") { |
| 171 | out.reason = reason; |
| 172 | } |
| 173 | process.stdout.write(`${JSON.stringify(out)}\n`); |
| 174 | process.exit(0); |
| 175 | } |
| 176 | |
| 177 | function allow(reason?: string): never { |
| 178 | emit("approve", reason); |
Tested by
no test coverage detected