* Narrows the focus to the variant of a tagged union with the given * `_tag` value. * * **Details** * * - On a Prism, returns a Prism. * - On an Optional, returns an Optional. * - Shorthand for `.refine(s => s._tag === tag)`. * - A non-matching value fails wit
(
this: Prism<S, A>,
tag: Tag
)
| 662 | * @see `.refine()` — for arbitrary type guards |
| 663 | */ |
| 664 | tag<S, A extends { readonly _tag: SchemaAST.LiteralValue }, Tag extends A["_tag"]>( |
| 665 | this: Prism<S, A>, |
| 666 | tag: Tag |
| 667 | ): Prism<S, Extract<A, { readonly _tag: Tag }>> |
no outgoing calls