Metakit / @doeixd/metakit/fn

GuardSubject

const · packages/metakit/src/fnTypes.ts:157

const GuardSubject: Data.TaggedEnum.Constructor<
  | { readonly _tag: 'Param'; readonly name: string }
  | {
      readonly _tag: 'Obligation'
      readonly kind: FnObligation<unknown>['kind']
      readonly label: string
    }
  | { readonly _tag: 'Result' }
>

Its type

type GuardSubject = Data.TaggedEnum<{
  Param: {
    readonly name: string
  }
  Obligation: {
    readonly kind: FnObligation<unknown>['kind']
    readonly label: string
  }
  Result: {}
}>

The value a guarded call checks: a parameter, a composed function's obligation, or the result.