import { Effect, Option } from "effect";
export function asRequest(result) {
  if (Option.isOption(result)) return result;
  return result == null ? Option.none() : Option.some(result);
}
export function fetchJsonOption(result) {
  return Option.match(asRequest(result), {
    onNone: () => Effect.succeed(Option.none()),
    onSome: (builder) => Effect.map(builder.json(), Option.some)
  });
}
