import { Schema as S } from "@effect/schema"
import { Match, pipe } from "effect"
class Input extends S.Class<Input>("Input")({
word1: S.optional(S.String),
word2: S.optional(S.String)
}) {}
const print = (
input: typeof Input.Type
) =>
pipe(
Match.value(input),
Match.whenAnd({ word1: Match.undefined } , { word2: Match.undefined }, () =>
console.log("first case")
),
Match.orElse(() =>
console.log("ANYWAY")
)
)
print({ })
import { Schema as S } from "@effect/schema"
import { Match, pipe } from "effect"
class Input extends S.Class<Input>("Input")({
word1: S.optional(S.String),
word2: S.optional(S.String)
}) {}
const print = (
input: typeof Input.Type
) =>
pipe(
Match.value(input),
Match.whenAnd({ word1: Match.undefined } , { word2: Match.undefined }, () =>
console.log("first case")
),
Match.orElse(() =>
console.log("ANYWAY")
)
)
print({ })