mirror of
https://github.com/morluto/rea.git
synced 2026-11-06 23:06:18 +00:00
8 lines
343 B
TypeScript
8 lines
343 B
TypeScript
import type { JsonValue } from "../domain/jsonValue.js";
|
|
import type { Result } from "../domain/result.js";
|
|
|
|
/** Flatten a finalized outcome only when returning the command's JSON output. */
|
|
export const projectCliAnalysisResult = <Value>(
|
|
result: Result<Value, JsonValue>,
|
|
): Value | JsonValue => (result.ok ? result.value : result.error);
|