2bbe5a3d0e
Each folder now has: - types.ts for all type definitions - index.ts with pure re-exports only - Cross-folder imports go through index.ts Closes #106
10 lines
214 B
TypeScript
10 lines
214 B
TypeScript
import type { Result } from "./types.js";
|
|
|
|
export function ok<T>(value: T): Result<T, never> {
|
|
return { ok: true, value };
|
|
}
|
|
|
|
export function err<E>(error: E): Result<never, E> {
|
|
return { ok: false, error };
|
|
}
|