(u: unknown): u is QuitErrorReturns true if the provided value is a Terminal.QuitError.
When to use
Use to narrow unknown failures to QuitError when handling terminal input
cancellation.
Details
Returns true when the value carries the QuitError runtime marker and
narrows it to QuitError.
export const const isQuitError: (
u: unknown
) => u is QuitError
Returns true if the provided value is a Terminal.QuitError.
When to use
Use to narrow unknown failures to QuitError when handling terminal input
cancellation.
Details
Returns true when the value carries the QuitError runtime marker and
narrows it to QuitError.
isQuitError = (u: unknownu: unknown): u: unknownu is class QuitErrorclass QuitError {
effect/platform/Terminal/QuitError: 'effect/platform/Terminal/QuitError';
_tag: 'QuitError';
name: string;
message: string;
stack: string;
cause: unknown;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Represents an error that occurs when a user attempts to
quit out of a Terminal prompt for input (usually by entering ctrl+c).
When to use
Use when implementing terminal input or prompts that need to signal
user-requested cancellation through the typed error channel.
QuitError => import PredicatePredicate.hasProperty(u: unknownu, const QuitErrorTypeId: "effect/platform/Terminal/QuitError"QuitErrorTypeId)